OpenGL Lab: Combinations of Transformations

CS 320

Mar 2, 2001

In this lab, you'll use combinations of OpenGL transformations to move a small house around a 2-D world. Please don't damage the house --- it's my home.

  1. Create a new OpenGL project, grab transform.c from the class homepage, and add it to the project.

  2. Compile and run the program. Notice the three elements of the program: coordinate axes in white, point at (4, 3) showing the center of the house in green, and the house itself in red. The axes and point are rendered using the background display and the house is rendered using the house display list.

    Consider the center point fixed --- no need to move it around.

  3. main() registers display() as the display callback. You can find display() at the end of the source file. Within display, you'll see the juncture at which you add your transformation calls.

  4. Modify display() to effect each of the following transformations on the house, one at a time:
    1. Rotate the house CCW about its center.

    2. Rotate the house CW about the apex of its roof.

    3. Scale the house by about its center.

    4. Position the house so that its center point is 6 units from the origin at an angle of and the house itself is upright.

    5. Position the house so that its center point is 6 units from the origin at an angle of and the house itself is tilted at an angle of CCW.

    6. Without using translation, move the house into the second quadrant (I hear the grass is greener there.).



Thomas P. Kelliher
Fri Mar 2 09:51:12 EST 2001
Tom Kelliher