Segmentation operates in GKS-3D in the same way as for GKS, described in section on Page , except that the segment transformation matrix is defined to be 3 x 4. (3 x 3 for scaling and rotation plus 3 x 1 for translation). Thus, the 2D utility routines which calculate a segment transformation matrix, GEVTM and GACTM, are modified as follows:
CALL GEVTM3(X0, Y0, Z0, DX, DY, DZ, ROTX, ROTY, ROTZ, FX, FY, FZ, SW, MXOUT) CALL GACTM3(MXIN, X0, Y0, Z0, DX, DY, DZ, ROTX, ROTY, ROTZ, FX, FY, FZ, SW, MXOUT)Similarly to the 2D case, GEVTM3 evaluates a matrix (MXOUT), whilst GACTM3 accumulates changes to an existing matrix (MXIN). Both routines require the definition of:
Once the transformation matrix has been evaluated, it may then be set in the segment by calling the routine:
CALL GSSGT3(SGNA, MTX)To INsert a SeGment into the output stream GINSG becomes:
CALL GINSG3(SGNA, MTX)
Because GKS-3D is upwards compatible to GKS, one can still use the
2D versions of these routines.
In this case, 2 x 3 matrices will be automatically filled-out
to 3 x 4 by the suitable additions of 0s and 1s.
GKS segment transformations are provided in order to orient the
contents of segments with respect to the coordinate system in which
their primitives were originally specified. In most cases it is
extremely inefficient to modify the transformations in each segment
in order to view a scene from a different direction. The viewing
transformation should be used for this purpose