Computer Graphics
Z Sweedyk


Project 2: Ray Tracing

Due Dates:

This assignment is worth 100 points. See the course web page for the intermediate and final project due dates. You get two late days for this assignment. These days (and any left over from project 1) will be used extend intermediate or final deadlines as needed. Failure to meet any (possibly extended) deadline incurs a cost of 5 points per day until the work is completed. You are strongly urged to work early and often!

Overview

In this assignment you will implement a basic raytracer. The program reads the description of a 3D scene from a ray file and produces a rendered image of that scene. The program works in interactive and batch mode.

We provide skeleton code and a host of support classes to help you get started. We also provide a solution executable to help you test and debug your code.

A gallery of images created by previous semesters of this class is maintained here for motivation.

What You Have to Do

Following is a road map for the project. Download the skeleton code (here) and the sample executable.
  • (25 pts.) Ray Casting : The first step is to construct a simple ray-casting system (25 points). Your program will casts rays into the scene and find the closest intersecting object (triangle or sphere).




  • (10pts.) Transformations: In this step you'll introduce transformations. Modify Group::intersect() to take into account its local transformation. Use the transform information to convert the ray into local coordinates, find the closest intersection, and use the transform information to convert the intersection back into the parent node's coordinates. Be careful when converting the normal! Also, be sure to re-compute the distance to the intersection point in the parent node's coordinates. (Test file: 3.xfm.ray)

  • (25 pts.) Color: The next step is to compute the color at the intersection point.



  • (5 pts.) Texture mapping: Add texture mapping. Modify Triangle::intersect() and Sphere::intersect() to calculate texture coordinates at the point of intersection. Modify RayFile::getColor() to use the texture color as the diffuse factor in the color calculation. Add getTexture(u,v) to the material class. Use bilinear interpolation for the texture samples. (Test files: 8.spot.ray, texture file)


  • (25 pts.) Recursive Ray Casting: Next you'll extend your system to recursively cast rays (25 points).




  • Extensions: Following are list of possible extensions to your ray tracer.

    What to Submit

    You should submit:

    Make sure the source code compiles and runs on the LAC PC's. If it doesn't, we will not be able to grade your submission and it will not garner any points!

    Remember our standing late policy and collaboration policy.

    Notes

    Links


    Last Update: 9/5/05