The coordinate systems and transformations

The coordinate systems and transformations are the same as for GKS. Three coordinate systems are used, namely the world coordinates (WC), normalized device coordinates (NDC) and device coordinates (DC) systems. Two transformations are then necessary, the normalization transformation (NT) going from world coordinates to normalized device coordinates space and the workstation transformation (WT) going from normalized device coordinates to device coordinates space. The normalized device coordinates space is a fixed space, a square whose bottom left corner (the origin) has the coordinates (0.,0.) and the top right corner has the coordinates (1.,1.). The mapping from normalized device coordinates to device coordinates and in general the knowledge of device parameters is supplied by default by the standard initialization function (but user callable routines are also provided). The complete viewing pipeline is described on figure [more info]. For devices with variable windowing capabilities, HIGZ gives the possibility to change dynamically or after a clear (see ICLRWK) the device viewport, and to inform the basic graphics package of this via the routine IGQWK (see section [more info]).


                                                                           

Figure: Normalization and Workstation Transformations.

[NTWT]

Workstation window definition

                +----------------------------------------+
                |CALL  ISWKWN (KWKID,XMIN,XMAX,YMIN,YMAX) |
                +----------------------------------------+
                                  
Action: This routine defines a workstation window in the normalized device coordinates space. It sets the (requested) workstation window on a previously opened workstation. The workstation window, specified in normalized device coordinates (i.e., 0.-1. by 0.-1.) is the portion of normalized device coordinates space that the application wishes to appear on the given workstation. This permits primitives which are created when multiple workstations are active to be clipped and scaled differently on the different workstations. The workstation window (together with the workstation viewport and the rule that the aspect ratio of the workstation window must be preserved) determines the mapping (uniform scale with translation) from normalized device coordinates to device coordinates. The requested workstation window becomes the current workstation window either during the invocation of ISWKWN (if the display surface is empty or if it does not cause an implicit regeneration) or at some later time (for example, during an invocation of ICLRWK). Parameter Description:
KWKID
Workstation identifier
XMIN
X coordinate of the lower left hand corner in NDC space.
XMAX
X coordinate of the upper right hand corner in NDC space.
YMIN
Y coordinate of the lower left hand corner in NDC space.
YMAX
Y coordinate of the upper right hand corner in NDC space.
The four last parameters must be between 0.0 and 1.0 (inclusive) and must satisfy XMIN < XMAX and YMIN < YMAX.

Workstation viewport definition

                +----------------------------------------+
                |CALL  ISWKVP (KWKID,XMIN,XMAX,YMIN,YMAX) |
                +----------------------------------------+
                                  
Action: This routine sets the (requested) workstation viewport on a previously opened workstation. The workstation viewport, specified in device coordinates, is the portion of the maximum available display surface that the application wishes to use (see section [more info]). The workstation viewport (together with the workstation window and the rule that aspect ratios must be preserved) also determines the mapping (uniform scaling with translation) from normalized device coordinates to device coordinates. The requested workstation viewport becomes the current workstation viewport either during the invocation of ISWKVP (if the display surface is empty or if it does not cause an implicit regeneration) or at some later time (for example, during an invocation of ICLRWK). The device coordinates region specified by the parameters must be contained in or equal to the maximum available display surface. The initial requested workstation viewport is the entire display surface. Parameter Description:
KWKID
Workstation identifier
XMIN
X coordinate of the lower left hand corner in DC space
XMAX
X coordinate of the upper right hand corner in DC space
YMIN
Y coordinate of the lower left hand corner in DC space
YMAX
Y coordinate of the upper right hand corner in DC space
The last four parameters must satisfy the conditions XMIN < XMAX and YMIN < YMAX.

Normalization Transformation window definition


                  +------------------------------------+
                  | CALL  ISWN (NT,XMIN,XMAX,YMIN,YMAX) |
                  +------------------------------------+
                                  
Action: This routine sets the boundaries of the window of a normalization transformation. The window must be specified in world coordinates. The boundaries of the window, together with the boundaries of the viewport (which are in normalized device coordinates) determine a transformation from world coordinates to normalized device coordinates consisting of separate X and Y scale factors and a translation in two dimensions. The normalization transformation is selected by using routine ISELNT. Parameter Description:
NT
Normalization transformation index (0XMIN
X coordinate of the lower left hand corner in WC space.
XMAX
X coordinate of the upper right hand corner in WC space.
YMIN
Y coordinate of the lower left hand corner in WC space.
YMAX
Y coordinate of the upper right hand corner in WC space.
The last four parameters must satisfy the conditions XMIN < XMAX and YMIN < YMAX.

Normalization Transformation viewport definition

                  +------------------------------------+
                  | CALL  ISVP (NT,XMIN,XMAX,YMIN,YMAX) |
                  +------------------------------------+
                                  
Action: This routine sets the boundaries of the viewport of a normalization transformation. The viewport must be specified in normalized device coordinates. The boundaries of the viewport have two roles:
  1. Together with the boundaries of the window (which are in world coordinates) they determine a transformation from world coordinates to normalized device coordinates consisting of separate X and Y scale factors and a translation in two dimensions.
  2. When the clipping indicator is 1 (see routine ISCLIP), primitives are clipped to the boundary of the viewport (once the primitives are transformed to normalized device coordinates)
The normalization transformation is selected with the routine ISELNT. Parameter Description:
NT
Normalization transformation index (0XMIN
X coordinate of the lower left hand corner in DC space (0.0<=XMIN< =1.0).
XMAX
X coordinate of the upper right hand corner in DC space (0.0<=XMAX< =1.0).
YMIN
Y coordinate of the lower left hand corner in DC space (0.0<=YMIN< =1.0).
YMAX
Y coordinate of the upper right hand corner in DC space (0.0<=YMAX< =1.0).
The last four parameters must satisfy the conditions XMIN < XMAX and YMIN < YMAX.

Normalization transformation selection

                           +------------------+
                           | CALL  ISELNT (NT) |
                           +------------------+
                                  
Action: This routine selects the normalization transformation to be used when world coordinates must be mapped to or from normalized device coordinates (NDC). These mappings usually take place during invocations of primitives ( IFA, IPL, IPM, and ITX) and during graphics input ( IRQLC). Transformation 0 always has a window and a viewport that are the unit square (0.-1. by 0.-1.) and cannot be changed with ISVP or ISWN. Transformation 0 is selected by default. Parameter Description:
NT
Normalization transformation index (0

Simplified way to define the viewing pipeline

Very often the user of a graphics package wants to define the dimensions of the physical output in centimeters and centered on the output devices (screen or paper). This can be done with HIGZ with simply one call to the routine IGRNG.
                       +--------------------------+
                       | CALL  IGRNG (XSIZE,YSIZE) |
                       +--------------------------+
                                  
Action: This routine is used to determine the physical dimensions (in centimeter) and to optimize the aspect ratio and the centering of a picture. If the X or Y dimension of output device are smaller than XSIZE or YSIZE, a scaling factor is applied to the final size of the picture but the aspect ratio is kept. When an Encapsulated PostScript workstation is active, a call to this routine is mandatory in order to define the size of the picture (e.g the PostScript BoundingBox). Parameter Description:
XSIZE
Picture size in centimeters in the X direction.
YSIZE
Picture size in centimeters in the Y direction.
After a call to IGRNG the normalization transformation number 1 is selected. For this reason in all the HIGZ routines, the normalization transformation number 1 is assumed to be a centimeter transformation. It is not recommended to define this transformation (via ISWN, ISVP and ISELNT) outside IGRNG. In particular when PostScript files are used, the PostScript driver assumes that the setting of the normalization transformation 1 has been done via IGRNG. After a call to IGRNG some useful value to convert centimeters into normalized device coordinates, are available in the common QUEST.
RQUEST(11)
Ratio to convert cm into normalized device coordinates.
RQUEST(12)
left position of the normalization transformation 1 viewport in normalized device coordinates.
RQUEST(13)
bottom position of the normalization transformation 1 viewport in normalized device coordinates.
RQUEST(14)
width of the normalization transformation 1 viewport in normalized device coordinates.
RQUEST(15)
height of the normalization transformation 1 viewport in normalized device coordinates.
For more details, see examples on pages [more info] and [more info].