GDDM-GKS V1R1 Programming Guide and Reference
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


Normalization and workstation transformations

GDDM-GKS V1R1 Programming Guide and Reference
SC33-0334-00



The normalization and workstation transformations together represent a scaling of world coordinates to device coordinates. Each transformation consists of a window and a viewport.

With the transformations set in the following way, the example program uses the entire screen as an output surface. This setting causes the aspect ratio of the display to be different from the aspect ratio of the picture as created in WC space. That is, a square will be output as a rectangle.


          SET WINDOW (1, 0.0, 100.0, 0.0, 100.0)
          INQUIRE DISPLAY SPACE SIZE (worktype,
               error, dcunits, xdevice, ydevice, xraster,
               yraster)
     Find the larger of the two dimensions
          scale = xdevice
          If xdevice < ydevice
               then scale = ydevice
     Calculate the aspect ratio
          xndc = xdevice / scale
          yndc = ydevice / scale
          SET VIEWPORT (1, 0.0, xndc, 0.0, yndc)
          SET WORKSTATION WINDOW (wkid, 0.0, xndc,
               0.0, yndc)
          SELECT NORMALIZATION TRANSFORMATION (1)

The range for the world window is set from 0.0 to 100.0 along each axis. Then the maximum display surface size is inquired, and the largest dimension in device coordinates is determined. The NDC viewport is scaled to have the same aspect ratio as the device surface. The workstation window is set equal to the world viewport (both in NDC). The workstation window is then mapped to the entire display surface. Finally the normalization transformation just defined is selected.

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012