CS 551/645: Introduction to Computer Graphics

Assignment #6

Goal: Pull together previous assignments, implementing a wireframe rendering pipeline

Assigned: Wednesday, October 27, 1999

Due: Friday, November 5, 1999

Relevant reading/files/software:

Synopsis: You will implement a library (libwireframe.a) containing routines for rendering 3-D triangles in wireframe. These triangles will be given in world coordinates; no modeling transforms will be necessary. Your library must support viewing transforms (i.e., the lookat() function), clipping to the view frustum, perspective projection, and rendering the final polygons (not necessarily triangles after clipping!) in wireframe.

Specifics: You may want to reuse code from the libraries that you have written over the course of past assignments: libtransform.a, libcliptri.a, and libline.a. We are providing the header file wireframe.h, which defines function prototypes for libwireframe.a; you will have to fill in the source code for those functions. Your functions should render the transformed clipped wireframe triangles into the framebuffer implemented by the frame.c and frame.h. As in Assignment 2, we provide the file gfx.c with functions for drawing that framebuffer directly into an XForms glCanvas. We are also providing a version of the matrix library (matrix.h and matrix.c) from Assignment 5, stripped of the setmatrix() call (since you will be performing all matrix transformations yourself). We also provide the usual Makefile (last changed at 5PM on Thursday). Note:

Grading: The usual 10-point scale. You will be graded on correctness. Assuming a satisfactory degree of correctness, you can gain extra credit for speed. No demo is required. We will compile all assignments on sgi-1.unixlab, so be sure your assignment compiles cleanly on that machine before turning it in.

Turning in the assignment: Before class starts on the due date, you should do the usual: create a README (be sure to spell it that way: one word, all caps), edit the "SUBMIT =" line in the Makefile, and type "make submit". Though you may wish to create a demo to help visually debug your code, you should not turn in any demo files.

Advice: Start early. The major new challenges will be clipping in 3-D and the perspective transformation, but don’t underestimate the difficulty of putting it all together into a working system. Once you have your code working, ways you can speed it up include:

However, correctness is much more important than speed. Get it working, and only bother to try speeding it up if you have extra time.