Vizard 8 » Reference » Basic Concepts » The Transformation Matrix
8.0

The transformation matrix

The transformation matrix of an object is a 4x4 matrix that embodies the object's position, scale and orientation data.  Vizard uses transformation matrices internally for all its operations.

 

Model transformations refer to the mapping from object- to world-coordinates. To do this, Vizard allows you to specify a sequence of transformations. There are three different kinds of transformations that you can apply: translation, rotation, and scale. In Vizard, each layer (an object or collection of objects) has its own independent sequence of transformations. Initially, all sequences are set to the identity transformation, meaning that the mapping from object- to world-space is one-to-one.

 

The order in which transformations are applied is critical, and almost always very different results will occur if applied in the wrong order. In Vizard, which follows the OpenGL convention, transformations are applied to objects in the REVERSE order in which they are specified. This means the last transformation you do to a layer should be the first one you want applied when thinking in terms of the mapping from object- to world-space.

 

As an example, say you have a model of a person facing north (nose pointed along the +Z axis) and centered about the origin. Now you want to move this object due north and rotate so that the person is looking west. Conceptually, you should first rotate the model 90 degrees to the left, and then translate it away from the eye point along the +Z axis. The opposite order of transformations leads to a different result. For instance, if you first pushed the model out along the +Z axis, the rotation would have the effect of "revolving" the model around the world origin (0,0,0); the result would be a person due east of the eye point instead of due north.