CS 5600 - Spring 2009

Homework Assignment 6

OpenGL Lighting (100 points)

Handed out: March 30, 2009
Due midnight, April 7, 2009

You will write an OpenGL program which renders the scene from the last assignment with spheres rather than cubes and with lighting.

1. You will write a program that lights the scene from the last assignment.

2. Use spheres (gluSphere or glutSphere) http://www.opengl.org/sdk/docs/man/xhtml/gluSphere.xml instead of cubes with a smaller sphere on top of the larger sphere.

3. Each cube should be a different color and material.  You must have the following bottom spheres: Brass, Pewter, Polished Silver, Red Plastic and the following top spheres: Black Plastic, Black Rubber, Green Plastic, and Gold.  Other spheres may be of materials of your choice. See:  http://www.eng.utah.edu/~cs5600/assignments/lab6/material-properties.htm

4. Your scene should be depth-buffered with a ground plane as in the last assignment.

5. The camera should rotate around the look-at point and have the gaze-direction be about 45 degrees from the look-at point.  It needs to rotate in the circle. Go see the TA if you lost points on this during the last assignment, you must get this to work for this assignment.

6. The + and – keys control the block rotation while the ‘f’ and ‘s’ keys should make the camera rotate faster ‘f’ or slower ‘s’.

7. The ‘c’ key should toggle between the light following the camera and the light being fixed in the scene.

8. You must turn in documentation in the form of a webpage as in the other assignments.

Output

The program should draw its output to an OpenGL window of size 512x512 as in the example program. You should use a perspective projection in this assignment as in the last assignment (90 degree frustum)

Submission

use the handin routine in the CADE Lab. You can with zip or tar your solution. You should comment your code appropriately and hand in a web-page that will serve as complete documentation. Please include a paragraph of difficulties and a paragraph of what you learned in this assignment.

The handin name for this lab is "lab6".

Windows users should use the Zip utility and handin a single zipped file. Unix users should use the tar program to do the same. We will recompile the programs to grade them. Make sure your workspace/program will compile for us. That is, be careful about your user-specific pathname variables! If you do this on a home machine, please allow sufficient time for porting to the CADE machines. We will grade based on compiling and running on the CADE machines.

Due to a bug in the handin program, do not include spaces in the names of the files that you submit, otherwise we will not receive them. For instance, "no spaces.txt" is not a valid filename and would not be received, while "no_spaces.txt" is valid. Please keep this in mind while handing in your assignment.