CS174b Computer Graphics Programming Assignment 3

Due:  Thursday, February 24 11:59 P.M.

Overview

In this assignment you will implement a graphical debugging environment for the following heirarchical radiosity assigment.

Although this assignment may seem to have little to do with radiosity, there is considerable graphics programming involved in the design of such a system.  Additionally, tools for graphical debugging will be extremely important when you create any large-scale graphics project.
 


File Format

Your program will read in a scene file similar to the povray format.  The only primitives requiring parsing will be "quadrilaterals".  To allow you to reuse your parsing code from previous assignments your program will read in a povray file with camera parameters, lights, and triangles.  You should then reflect the second triangle vertex across the line between the first and third vertex to get quadrilateral.  This also removes the need to check if the quadrilaterals are planar.

The emission (E) of the patch will be specified by the 'diffuse' term, and the reflectivity (rho) of the patch will be specified by the 'reflection' term.


Viewpoint Manipulation

After parsing the scene file, your program should use the camera specification to display the world using OpenGL (or OpenInventor).  Everything should be Gouraud shaded, with a color that matches the color in the scene file. Patches with positive emissions should have light sources placed on them to properly iilluminate the scene.

The view of the scene should be interactive. The user should be able to move around this world and look at different parts of the scene.  An intuitive interface would be a 6-DOF control that allows you to rotate around or move along any of three orthogonal axes (similar to the arcball).


Quadtrees

In addition to parsing the patches, you will need to implement quadtrees to divide your patches into elements.  You should therefore design a quadtree data structure and implement two level quadtrees for each patch (in future projects, of course, you will want more than two levels).

The patches should also respond to 'pick' events.  That is, when you click the mouse, your program will determine which patch the user is picking and that patch will respond to the event.  In this assignment the patches should respond by highlighting themselves and their children.  If the user subsequently picks one of these highlighted elements, it should highlight its children.  This will allow the user to step through the quadtree structure.

Additionally, when a patch is selected (by means of a pick event), links from that patch to all other patches should be drawn.  This need only be done for patches (the original quadrilaterals in the scene).  The user should be able to pick these links, and the links should respond by displaying a number near the link's location (this will be useful for determining the interaction between patches in the next assignment).


What you should hand in

Your program should have the following syntax:

    rad +Ifilename

Additioanlly, you should include a README file describing the interface of your program.


Grading

The sections will have the following points:

30%    Parsing and Viewpoint Manipulation
40%    Picking Patches and Links
30%    Quadtrees


Late Policy

The homeworks are due at the time specified at the top of the assignment.  You should place your program in your directory with the appropriate source and data files as well as a README file describing the program and any assignment specific comments.  Additionally, the README should contain the time and date that you finished the program. Use the submitHomework script to notify the TA when your work is completed (run ~cs174/submitHomework 3 from the directory containing the homework files).

A late penalty of 10 points will be applied for every day that your program is late (your program is considered one day late if it is turned in within 24 hours after the deadline, two days for 24 to 48 hours, etc.).  For example, if you turn in the assignment 2 days late and would have gotten an 84, you will receive a 64.  If you wish to continue working on the assignment after handing it in, you should work on a copy of the program since we will be using the timestamps on the files for grading purposes.  You may later submit a updated version for grading, but you will get the grade for your last turned in version (even if it is lower than a previous version).