Computer Graphics II -- Image Synthesis

4003 571/4005 769
Winter 2002

Assignment #1


So You Want to Write a Ray Tracer!

In this first assignment, you will write a simple ray tracer.  In fact, the rey tracer should be suffiently complex to reproduce the following classic ray traced scene (originally created by Turner Whitted in his 1984 paper that introduced Ray Tracing to the Computer Graphics community):

Whitted Ray Tracing Example

Useful Information

The sets of slides on ray tracing and the ray tracing assignment may be helpful to you.

Ground Rules

The scene to be rendered, as well as the rendering parameters, will be read from a simple text file (see Input format below).  The scene will consists of 2 types of objects:
  1. Spheres -- which will be specified by it's center and radius.  Spheres may be transparent, and will have a corresponding index of refraction.
  2. Rectangular chekerboard floor --  which will be specified by the endpoints of the floor.  In addition the size of the checks will be given.   The normal to the floor will always be in the positive y direction.  The floor will not be transparent.
The scene will consist of a single point light source, and ambient lighting.  Illumination should be calculated using the Phong Illumination model (Phong parameters for each object in the scene will be specified in the input file).

Input File Format

All info about the scene, and all rendering parameters will be specified in a single text file with the following simple format:

Line 1: Camera Parameters (position (xyz), lookat (xyz), up (xyz), focal length, image frame size
Line 2: Light Parameters (position, rgb, ambient rgb)
Line 3: Image Resolution and maxdepth
Line 4: Background Color (rgb)

The remaining lines will describe objects in the scene.   Each object description will consists of two lines per object.  The type of data on each of the lines will depend upon the type of object.  The first character on the first line for an object will specify the type of object being described.

Spheres

1st Line: S center(x,y,z) radius, index of refraction
2nd Line: ambient color (rgb), diffuse color (rgb), specular color (rgb), ka, kd, ks, ke, kr, kt

Floor

1st Line:   F vertex1(xyz) vertex2(xyz) vertex3(xyz) vertex4(xyz), cheksize
2nd Line: 1st color: abient (rgb), diffuse (rgb), specular (rgb), 2nd color ambient (rgb), diffuse (rgb), specular (rgb), ka, kd, ks, kr

Note that floors will not be transparent, this kt will be equal to 0.

A sample input file is available here .  This file describes the image presented above.  Click here to see the results of running POVRay on this scene description.

Grading: Bells and Whistles 

The assignment will be worth 20 points
  • 5 points – for something that compiles
  • 10 points – for something that runs incorrectly
  • 15 points – for something that runs correctly
  • 20 points – something that runs + extras
  • For this assignment, the major "bell and whistle" will be the implementation of transparency (i.e. spawning the transmission as well as the reflection rays)

    Due Dates:


    If you plan on doing only 1 rendering assignment (#1 or #2) Feb 4
    If you plan on doing both rendering assignments (#1 and #2) Feb 11

    Late deliverables will be penalized 25% for each week late.  There is an exception to this rule: if you forsee any problems with meeting deliverable deadlines, and see the instructor well in advance (at least one week) of the deadline that might be missed we can attempt to work out alternate arrangements.


    last updated 1/29/03