CS6620 Advanced Graphics 2 University of Utah
Prof: Peter Shirley Ray Tracing Sem: Spring 2002



Assignment 01 - Basic Ray Tracer 1

I've built a basic ray tracer that creates rays at the origin whose direction fans out around the -Z axis for each pixel in the image. Each ray is then tested for intersection against every surface in the scene (currently, only spheres are supported). If a ray hits a surface, the color of the surface is used as the color of the pixel.

one
An image of a single white sphere of radius 3 and position (0,0,-10). My first test scene to make sure the ray/sphere intersection code was working.

scene file: one.txt
rgb
Three intersecting spheres, all at the same depth. I used this scene to test the closest hit code.

scene file: rgb.txt
colorcube
A cube of spheres (colorcube). The color of each sphere is determined by its position in space. Red is along the X axis, green along Y and blue along Z.

scene file: colorcube.txt

All of the images above can be regenerated by specifying the appropriate scene file on the command line of the rayn program rayn-01.zip (175 KB). The source code is included in the zip file. Here is a description of the command line parameters for rayn.
rayn [@response] [options]

  options:
    -output     <output_file>      output image filename (string).
    -size       <width,height>     size of output image (int,int).
    -background <red,green,blue>   background color (int,int,int).
    -scene      <scene_file>       file containing scene description (string).

  @reponse:
    Specifies a file from which options are to be read,
    one option per line.  Options which are specified on
    the command line override those in the response file.

Questions/comments to nate@pobox.com.



January 2002
© Nate Robins