Math 155  - Winter 2001
The ModelView program

    The ModelView program will let you experiment with using 4x4 matrices to perform transformations in 3-space.  The purpose of this program for this class is twofold:

Getting started:  Find the ModelView program in the public (P:) Projects folder.  Copy the project to your Projects folder.  Compile and run.  Try the following items:

( )
0 0 -1 0
0 1 0 0
1 0 0 0
0 0 0 1


Composing transformations.  The other buttons can be used to compose transformations, e.g., to see the effect of a translation followed by a rotation (or vice-versa.)  
    The operation of the program is little difficult to explain, but here goes:  There are 3 matrices that are being maintained, there is a matrix M (main matrix), a matrix C (current matrix) and the displayed matrix D.    The transformation that is applied to the teapot or the letter F is the matrix CM. (the matrix product).
Initially all matrices are the identity.   The D matrix is what you edit on the screen.  The buttons on the dialog have the following functions:

Important:  The transformations are composed by pre-multiplying.   This is the easy way to intuitively create and visualize the composition of transformations.  However, in OpenGL, transformations are post-multiplied, so your programs have to apply the transformations in the reverse order from how you apply them in this demonstration program.

Try it out: Smooth vs. Flat shading:  Find the place in the code where the teapot is drawn in ModelviewView.cpp.  Change GL_FLAT to GL_SMOOTH to do smooth shading.  (Make sure you change the place where the teapot is drawn, not the "F".  Then recompile and run the program again.  How does this change the appearance of the teapot?    You might want to scale the teapot by a factor of 2 or 3 to see the difference more clearly.  Can you see the individual polygons in the smooth shading mode?
    Explanation:  The teapot's surface is being approximated by a slot of small more-or-less rectangular polygons.  In the "smooth" mode,