CS 551: Advanced Computer Graphics

Exercise #1

Goal: Gain familiarity with RSRT (Really Simple Ray Tracer) source.

Assigned: Thursday, January 29, 1999

Due: Tuesday, February 2, 1999

Relevant reading:

Relevant software:

Synopsis: You will download, modify, and compile the Really Simple Ray Tracer source code, and use your modified version of RSRT to produce and view some simple images. In this exercise the modification is quite minor. The "stock" version of RSRT does not output an image file format we can easily read, so you will modify the output routines of RSRT to write a different file format.

The PPM file format is extremely simple and can be read by many programs, including the UNIX viewer xv. The format looks like this:

P3 # This is a PPM file. Note that it’s text, not binary 640 480 255 183 134 59 183 134 59 183 134 59 183 134 59 59 183 134 59 183 134 59 183 134 59 183 134 […]

The first line contains the header "P3", which indicates the PPM version. The next line is a comment and can say anything after the "#" character. The next two numbers are the width and height of the image. I don’t know what the next number is, but it always seems to be "255"—probably an indication that color values range from 0-255 (i.e., 1 byte). After this header information follows the actual data: the red, green, and blue intensities of every pixel in the image, in row-major order, scaled from 0 (black) to 255 (bright).

Your assignment is to download the source to your UNIX account and examine it to understand what the ray-tracer is doing. Make the necessary changes (they are very minor, just a few lines in the right place) and compile. Then download the sample scenes on the course web page and use your modified RSRT to ray-trace the scenes and write them to .ppm files. Look at the files using the xv program to verify your changes.

Grading: When you turn in your modified files, we will test your changes and "check off" your name if everything works as it should. The exercise is not graded according to the 10-point scale used for assignments, so don’t worry about adding bells and whistles.

Turning in the assignment: Before class starts on Tuesday, February 2, you should:

Advice: