CS 5600 - Spring 2008

Homework Assignment 8

Ray Tracing (100 points)

Handed out: April 4, 2008
Due: 11:30am, April 18, 2008

You will write a program that performs ray-tracing.  You should use a large polygon for the floor (like in the last two assignments) with a checker board on it. Use an appropriate number of squares.  You may color them white and whatever color (besides white) you would like.  On this floor, you should place a snowman comprised of three spheres of different colors.  You may chose colors as you wish but please make them different.  The middle of the snowman should be partially reflective as if it were a plastic or metallic surface.  You should place a mirror sphere near the snowman so that you can see the snowman reflected in the sphere and the sphere reflected in the snowman.  This reflective sphere should be floating over the floor.  You should include a cube on the floor near the snowman and mirrored sphere.   You should include Phong lighting with shadows.  You should read the eye-point and the lookat point from the  command line.  These are to be as six floating point numbers (eyeX, eyeY, eyeZ, atX, atY, atZ).  You may include a moveable light source but that is not required.  For extra credit, place a refractive sphere in the scene.  For rays that leave the scene, you should give them a nice color such as light blue.  Please allow keyboard input to control the level of rays where one-reflection  is level one, two-reflections is level two, three reflections is level 3.  That is '1' is level one, '2' is level two, '3' is level three.

For extra credit, you may include refraction.

The program should draw its output to a  window of size 512x512.  You can use the example program to set the color of pixels.

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 "lab8".

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.