Note: you must work on this assignment on your own.
See assignments overview page for general information.
The ray tracer programming assignment is divided into seven checkpoints:
This is checkpoint #3: "Basic shading".
Using your program from checkpoint #2 (without extras), the task for this assignment is to add Phong Illumination to your ray tracer. On intersection, rather than return the color of the object you hit, you must calculate the color at the intersection point using the Phong Illumination model. All the relevant Phong equations can be found in the CG2 lecture notes for Checkpoint 3 (on myCourses).
Recall that the Phong model:
You will need to add the following things to your program:
You'll need to work with the following vectors:
http://astronomy.swin.edu.au/~pbourke/geometry/reflected/
for how this is calculated
To apply the Phong model, if there is an intersection,
To submit your solution, do the following before midnight on April 4, 2012:
As it is extremely important to continue to make progress as the course progresses, late deliverables will be penalized 10% for each day late. There is an exception to this rule: if you anticipate any problems with meeting deliverable deadlines, see me well in advance (ideally, at least one week) of the deadline that might be missed, and we can attempt to work out alternate arrangements.
Recall that you must do five "extras" and add support for triangular meshes in order to achieve the full 100 points for the programming assignments. "Extras" are worth two points each. This assignment has two possible "extras":
If you choose to do an extra, put multiple images on your web site:
As before, modular design will greatly simplify future modifications to your code.