next up previous contents index
Next: Workstation Transformation Up: Viewing in 3D Previous: The View Mapping

Setting the 3D View Representation

Having described the concepts, this section will attempt to explain how all these parameters are actually set. This is an area of the GKS-3D standard which was modified fairly late, and release 2.0 of GKSGRAL-3D still took place before the publication of the Draft International Standard for the FORTRAN binding [7].

As for the Normalization Transformation, there may be more than one Viewing Transformation (actually, combined Viewing and Projection Transformation plus Clip), and the different transformations are specified by a View Index. However, unlike the Normalization Transformation, which applies to all primitives no matter on which workstation they are displayed, the Viewing Transformation is workstation-dependent, and so the same VieW Index (VWI) may produce a different effect on each active display. The View Index is set using the routine:

CALL GSVWI(VWI)
Following this call all primitives will be transformed according to the parameters specified by viewing attribute bundle VWI, assuming that the deferral mode set has allowed the workstation to be brought up-to-date. The default viewing attributes, corresponding to VWI = 0, define identity matrices for the View Orientation and View Mapping transformations, and place the clip limits at the boundary of NPC3 space.

As indicated, the attribute values contained in the viewing attribute bundle specified by VWI must be defined separately for each workstation using the call:

CALL GSVWR(WKID, VWI, VWM, PRM, VCLP, CLW, CLB, CLF)
WKID
Workstation Identifier
VWI
The View Index
VWM
The View Orientation Matrix (a 4 x 4 real array), which may be calculated by the function GEVVWM
PRM
The Projection (View Mapping) Matrix (a 4 x 4 real array), which may be calculated by the function GEVPJM
VCLP
The View Clipping Limits (XMIN, XMAX, YMIN, YMAX, ZMIN, ZMAX)
CLW
Clip Indicator for Window Clipping ('GNCLIP', 'GCLIP')
CLB
Clip Indicator for Back Plane Clipping ('GNCLIP', 'GCLIP')
CLF
Clip Indicator for Front Plane Clipping ('GNCLIP', 'GCLIP')

The utility functions provided to evaluate the matrices are EValuate VieW orientation Matrix and EValuate ProJection (View Mapping) Matrix:

CALL GEVVWM(VRPX, VRPY, VRPZ, VUPX, VUPY, VUPZ,
                    VPNX, VPNY, VPNZ, CSW, ERR, VWM)
VRPX/Y/Z
The View Reference Point in NDC3 or WC3
VUPX/Y/Z
The View Up Vector in NDC3 or WC3
VPNX/Y/Z
The View Plane Normal in NDC3 or WC3
CSW
Switch specifying whether the vectors are given in World Coordinates or Normalized Device Coordinates ('GWC' or 'GNDC')
ERR
(out) Error indicator
VWM
(out) View Matrix (a 4 x 4 real array)

CALL GEVPJM(UMIN, UMAX, VMIN, VMAX, PRVP, PROTYP,
                    PRPU, PRPV, PRPN, VPD, BPD, FPD, ERR, PRM)
U, V
(MIN,MAX) The limits of the View Window on the View Reference Plane measured relative to the View Reference Point. UMIN, VMIN is the bottom left corner, UMAX, VMAX is the top right corner.
PRVP
The Projection Viewport Limits (a 6 element real array containing XMIN, XMAX, YMIN, YMAX, ZMIN, ZMAX)
PROTYP
The Projection Type flag integer ('GPARL' or 'GPERS')
PRUP/V/N
The Projection Reference Point.
VPD
The View Plane Distance from the View Reference Point along the N axis. (Note that the View Reference Point does not have to be contained in the View Plane).
BPD, FPD
The Back and Front Plane Distances from the View Reference Point along the N axis. FPD must be greater than BPD.
ERR
(out) Error indicator
PRM
(out) Projection Matrix (a 4 x 4 real array)


next up previous contents index
Next: Workstation Transformation Up: Viewing in 3D Previous: The View Mapping


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