Spring 1995
You will receive a special pair of red/blue anaglyphic glasses for viewing this stereo display. Briefly, for the chromatic anaglyphic stereo technique, we generate two perspective images, each in a different color: one for the left eye and one for the right eye. When viewed through corresponding colored filters the left eye sees only the left image and the right eye only the right image. The eye-brain system then combines both two-dimensional images into a single three-dimensional image with the correct colors. The general phenomenon of stereo is known as a binocular cue, because you need to use both eyes to perceive depth from stereo.
Copy Some Files
Some basic graphics utilities and the animation tool's main program are provided for you. So, before you begin programming, you will need to copy seven files from the directory /usr3/faculty/sclaroff/program3 on the CGL cluster. These are:
Like the previous assignments, you are expected to complete the program by providing the missing subroutines using the code templates.
Run the Example Camera Tool
In the same directory, you will also find an example of a fully functioning animation program: camera_example . You may run this to see how your program should work. To run the program, type
camera_example filename.asc,
where you specify an ASCII polygon file as input. There are two polygon files provided: box.asc and vw.asc . These are OSU (Ohio State U) format files, which define 3-D polygons in terms of a list of vertices and a connectivity table.
The user interface to the camera tool is through a seperate user interface window. This window has sliders, dials, and buttons. The sliders control parameters for: distance between the eyes (for stereo viewing), the distance of the projection reference point (PRP) to the view plane, and the z clipping planes. There is a special slider for controlling the brightness of the stereo display's red channel. Beside each slider there is a small button that you can push to reset it's value to the default values.
There are also four main buttons on this menu:
Write a routine that constructs the 4x4 homogeneous transform for rotation about a center point. The rotations should be applied in order: x rotation first, y rotation second, and z rotation third. Note that a 4x4 matrix multiplication has been provided if you wish to use it for the assignment.
Test Cases
There are no test cases provided in this assignment. You should instead make sure that you final program can correctly clip, transform, and perspective display the polygons.
Grading
Demo
As in the previous assignment, part of your grade for this programming assignment will be based on your giving a 4 minute demo in the CGL cluster. You will be expected to talk about how your animation tool works, and we will test it on a few examples. Demos will be scheduled for Friday, Apr. 7, from 1:00 to 5:00. You will be asked to sign up for a slot by next Wednesday.
Write-up
You will also be graded on a very brief write-up that is to be turned in at the beginning of class on Friday, Apr. 7. Basically, this write-up should include a paragraph describing what design choices you made in writing your subroutines, and hard copy of all your code. The code should be commented so that it is easily understood.
Extra Credit
For extra credit, create your camera trajectory, and ``fly by'' for the object of your choice. There is a menu button and call back routine template flyCB provided. During the fly-by, the camera motion should be smooth and remain pointed at the center of the polygonal object.
Academic Policy
You may discuss the programming projects with your classmates; however, you must write and debug your own code. Academic dishonesty will be reported to the academic conduct committee.
Furthermore, copying or translating code from another source is not allowed. Copying anything without acknowledging the source is usually considered to be plagurism.
Start programming early. Late assignments will not be graded.
Utilities provided
The file draw.c contains utilities for opening and managing windows:
There are clipping frame management routines:
There are also routines for drawing:
The file menu.c contains routines that manage the user interface widgets. You don't need to look at these unless you want to.
The file polygons.c contains utilities for creating and managing polygonal objects:
Finally, camera.c also contains some routines that are called whenever the user moves something on the user interface menu. These routines are called ``call back'' routines, because the user interface calls back to them when an interaction event occurs. These routines are:
You will notice that there are some global variables declared in {\em camera.c}. These are needed to support the user interface's call-back routine structure.
Stan Sclaroff
Created: March 22, 1995