The Viewing Transformation Matrix

When we call the function gluLookAt, a 4x4 matrix, which we call the Viewing Transformation Matrix (VTM), is created. VTM is multiplied by the matrix on top of the current matrix stack and the product becomes the current matrix for that stack. The purpose of VTM is to transform the geometry making up our scene from world coordinates to viewing coordinates. As we know, the transformation must be applied to the model-view stack and, in turn, that stack is set to be the current one prior to calling gluLookAt.

Although OpenGL creates the viewing transformation matrix for us, it is still interesting to see how it is computed, which is the purpose of this tutorial. When you execute the tutorial, you see in the Technical Content Window the formulae for computing VTM. The tutorial provides only for varying the eye point by orbiting the camera about the object in our scene. The look-at-point and up-vector are fixed respectively at (0,0,0) and (0,1,0).