CS 420 Computer Graphics


Lab 12
Dr. Tong Yu, Fall 2007

Composite Transformations

  • Login and open two windows, one for editing and one for compiling and executing programs.

  • Copy the program robot.cpp from the lecture notes. Compile and execute it.

  • Rotate the shoulder and elbow by hitting 'E' and 'S'.

  • Modify the program to add additional segments to the robot arm.

  • Modify the program to add additional segments at the same position. For example, give the robot arm several "fingers" at the wrist, as shown in the figure below.
    Hint: Use glPushMatrix() and glPopMatrix() to save and restore the position and orientation of the coordinate system at the wrist. If you're going to draw fingers at the wrist, you need to save the current matrix prior to positioning each finger, and restore the current matrix after each finger is drawn.