13.016 Introduction to Geometric Modeling and Computation


Building the Pipeline

Because all of the transformation matrices are mutliplied on the right:

  C' = CM

and the multiplication of a vertex coordinate with the transformation matrices also occurs on the right:

  v' = Cv

the matrix that is farthest to the right is applied to the vertex first.

We can represent the viewing pipeline as follows:

  v' = PMv

where P is the projection matrix, and M is the modelview matrix. Since the modelview matrix can be though of logically as separate viewing and modeling transformations:

  v' = PVMv

where V is the viewing matrix and M is the modeling matrix.

Note that first we apply the modeling transformation to orient the geometric model, then we apply the viewing transformation to define the eye coordinate system, and finally we perform the projection from 3D to 2D.

The 2D picture plane forms the world coordinate window, which can be mapped to the screen viewport.

Since the order of the transformations is significant, we want to invoke the OpenGL functions is the proper order, i.e. in the reverse order in which they will be applied.

    glViewport(...);               /* screen viewport */

    glMatrixMode(GL_PROJECTION);   /* specify the projection matrix */
    glLoadIdentity();              /* initialize to identity */
    gluPerspective(...);           /* or glOrtho(...) */

    glMatrixMode(GL_MODELVIEW);    /* specify the modelview matrix */
    glLoadIdentity();              /* initialize to identity */
    gluLookAt(...);                /* specify viewing transformation */

    glTranslate(...);              /* modeling transformations, */
    glScale(...);                  /* as necessary */
    glRotate(...);
    ...


Back to projections...
Back to the overview...