Homework 3

22C:151 Introduction to Computer Graphics

PART I due Thursday, September 25, 2008
PART II (the full program) due Thursday, October 2, 2008

35 points

PART I REQUIREMENTS: (1) do questions 1, 2, and 3 and (2) get the camera movement/viewing control part of the programming assignment working properly. You don't have to draw any objects (but you can if you want). I only require that you draw the global coordinate frame and have your viewing control commands working. I.e. I should be able to swing, elevate, and zoom the camera to look at the global coordinate frame from different places.

1. An object is to be translated 9 units in direction (0,0,1) and then rotated by 60 degrees about the (global/world) X axis. Show the 4-by-4 transformation matrix that can be used to accomplish this.

2. Assume an object is defined with a local coordinate frame that initially coincides with the global coordinate frame. The object is to be rotated -30 degrees about Y axis, and then translated (-8, 0, 0) in the direction of the object's local X axis.
  1. Show the 4-by-4 transformation matrix that can be used to accomplish this.
  2. Show a two-line OpenGL sequence that produces the matrix using a glRotate followed by a glTranslate.
  3. Show a two-line OpenGL sequence that produces the matrix using a glTranslate followed by a glRotate.
3. In terms of matrices and coordinate frames (not OpenGL code), show how the viewing matrix is formed in terms swing, elevate, and zoom.
NOTE: This problem is certainly best done before implementing the the code! The code is easy once you get the equations right.


PROGRAMMING ASSIGNMENT

Write an OpenGL program that allows interactive creation and movement of lighted shaded objects, camera movement, and both orthographic and perspective viewing projections.

Your program must: