Homework 5
22C:151 Introduction to Computer Graphics
Due Tuesday, October 14, 2003
15 points
This assignment involves a few small extensions of Homework 3, to
get ready for use in developing your ray tracing program in Homework 6.
In Homework 5 you will implement a recursive ray tracer. Instead
of requiring users to edit, by hand, a text file to describe the scene to
be rendered, we'd like to be able to let users create their scenes interactively
using a program like that of Homework 3. Using your Homework 3 program, users
can create and position objects and the viewpoint, enabling them to quickly set up a nice
scence. The idea here is to add functionality to Homework 3 that will enable you to
use save and then use that scene description as input for your ray tracer.
Note that your ray tracer will only be required to handle spheres and boxes (cubes scaled by
possible differents amounts along each axis). So, you only need to update/handle Homework 3 features
relevant to spheres and boxes (not cones, cylinders, etc.)
Requirements:
- add the ability to specify different material properties for each object. This is easy, though
perhaps a little tedious using GLUT. You may ignore ambient and emissive properties - we won't use
them in the ray tracer.
- add the ability to specify a transparency and a refraction coefficient for each object.
- add the ability to create, position, and specify the diffuse and specular color properties of lights
- add the ability to specify global ambient light color and global attenuation properties (see the file format below to know what kind of values are needed)
- add the ability to save a description of the current scene in a text file. The idea is that
after you create some objects and move them and the camera around, you use a menu selection or
keyboard key to trigger the creation of a text file containing the description of the current
scene. The format is described in file-format.text.
- add the use of simple OpenGL transparency to your program.
This is not especially important. You would still be able to do a successful ray tracer without
this capability, but it's a fairly simple and useful thing to learn (and will nicely demonstrate some differences
between simple OpenGL transparency and what you'll get via ray tracing transparency). Although it only requires a few
lines to do this, it can be tricky to get it working usefully. If you can't figure out how
to do it, ask Jim or Ting (but only after everything else works!).
Submitting your program
Submit your assignment according to the guidelines on the class WWW home page. For the
on-line part of the submission, respond 'hw5' to the ``Location:''
request.