>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User

Viewing

Graphics are drawn at the origin, and then three viewing controls are applied. First, the graphic is rotated about one or more axes. Next, it is translated (moved) to a new position. Finally, the observer's view position is given.

These viewing controls are always applied. If not specified, defaults are used. Rotation and translation may be zero, leaving the graphic at the origin, as originally drawn.

(Since OpenGL applies viewing commands in the reverse order in which they are specified, they are here specified in the order: view, translate, rotate.)

Rotation

The rotation angles are given in degrees in ROTXYZ, and are applied in the order ROTNDX.

By default ROTNDX is 0 1 2, meaning the specification order is x-axis, y-axis and z-axis (and applied by OpenGL in the order z, y, x). When setting up a graphic, it is easiest to leave ROTNDX as the default. However, the paint handlers may change the order to ensure smooth rotations when using the x y z keys to rotate the graphic.

Translation

Translation moves the graphic away from the origin, by the amount in TRNXYZ. In most cases, there is no need to move the graphic.

Viewing

The position of the observer is given in VIEWXYZ, and the up direction in VIEWUP. The observer always looks at the origin. If you set VIEWXYZ manually, ensure that VIEWUP is also given a suitable value.

Example

A good way to experiment with viewing is to use the OpenGL demo Basic/Viewing. This shows the viewbox with the positive axes. Try to guess which way the graphic will move when each key is pressed.


>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User