next up previous contents index
Next: Display Lists Up: GraphicDevice Previous: Primitive Graphic Routines

Global Settings and Matrix Handling

void update (void)
All data will be put on the screen including buffered data. Therefore the screen will display the actual picture.

void clear (void)
The whole screen will display the actual background color (see dev->attribute() below how to set the background color).

int attribute (int mode, int type, void *data)
Query, get or set an attribute. In query mode the data item will be ignored. The data item might be casted to the appropriate type. For a detailed description see 9.2.2.6.

void transform (int mode, int type, MATRIX44 matrix)
mode is one of G_MODE_GET, G_MODE_SET, G_MODE_PRE, G_MODE_POST, type is one of G_MATRIX_PROJECT, G_MATRIX_VIEW, G_MATRIX_MODEL, G_MATRIX_PVM, G_MATRIX_IVM (the special value G_MATRIX_NONE is not used here).

Handling of transformation matrices. The transformation from model to screen coordinates is performed in several steps. The MODEL matrix changes the model coordinates to world coordinates, the VIEW matrix continues the transformation to normalized coordinates and the PROJECT matrix to standard coordinates. In the standard system the visible region is the cube tex2html_wrap45974 . Finally a machine dependent transformation into screen coordinates will be performed.

The matrices will be multiplied to the left of the vectors, i.e. the precedence is (PROJECT * VIEW * MODEL) * vector. The MODEL matrix's duty is the generation of a scene containing primitive objects, the VIEW matrix concludes the viewer's position and orientation and the PROJECT matrix creates a suitable perspective.

The mode G_MODE_GET is useful to read the desired matrix specified by the type. The mode G_MODE_SET affects the data of the specified matrix. The modes G_MODE_PRE and G_MODE_POST are intended to multiply a new matrix from left (post) or right (pre) to an existing matrix. The matrices PVM and IVM can only be read. Here PVM is equal to (PROJECT * VIEW * MODEL) and IVM is equal to the inverse of (VIEW * MODEL) but only the upper 3 x 3 entries are taken into account. The transponent of IVM transforms the normal vectors.


next up previous contents index
Next: Display Lists Up: GraphicDevice Previous: Primitive Graphic Routines

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.