next up previous contents index
Next: Graphical Input Up: GKS-3D Primer Previous: But I don't

Segments

Segmentation operates in GKS-3D in the same way as for GKS, described in section on Page gif, 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:
X0, Y0, Z0
(real) a fixed reference point about which 3D rotations take place.
DX, DY, DZ
(real) a translation (or shift) vector.
ROTX, Y, Z
(real) angles of rotation about the X, Y, and Z axes.
FX, FY, FZ
(real) X, Y, and Z scale factors.
SW
(enumerated) a switch specifying whether the reference point and shift vector are given in World Coordinates or Normalized Device Coordinates ('GWC' or 'GNDC').
MXOUT
(real) 3 x 4 output matrix composed in the order: scale, rotate, shift. In the case of GACTM, the matrix MXIN is pre-concatenated with that formed from the scale, rotate, and shift parameters, so MXOUT = SHIFT * ROTATE * SCALE * MXIN.

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


next up previous contents index
Next: Graphical Input Up: GKS-3D Primer Previous: But I don't


Janne Saarela
Mon Apr 3 17:00:12 METDST 1995