CS 5600 - Spring 2013

Homework Assignment 5

Ray Tracing (100 points)

Handed out: March 20, 2013
Due: 11:59pm, April 25, 2013 (Thursday)

1.      You will write a program that performs ray-tracing. 

2.      You should use a large polygon for the floor with a checker board on it  (a texture: procedural or image).  Use an appropriate number of squares so that it looks like tiles.  You may color them black/white and whatever color (besides black/white) you would like. 

3.      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. 

4.      The middle of the snowman should be partially reflective as if it were a plastic or metallic surface. 

5.      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. 

6.      You should include a colored and partially metallic (brushed brass) cube on the floor near the snowman and mirrored sphere.  

7.      You should include Phong lighting with shadows. 

8.      You should read the eye-point and the lookat point from the command line as well as the recursion level for the rays.  These are to be as six floating point numbers (eyeX, eyeY, eyeZ, atX, atY, atZ).  You can assume up = (0, 1, 0).  For example: MyRayTracer 0.0 0.0 0.0 0.0 0.0 -5.0 4 – which is eye = (0,0,0) at = (0,0,-5), levels of recursion=4

9.      You may include a moveable light source but that is not required. 

10.  For rays that leave the scene, you should give them a nice color such as light blue. 

11.  For extra credit, place a refractive ‘glass’ sphere in the scene.

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

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.