Fourth Programming Assignment: 3-D Surfaces

Due Date: Wednesday, April 22


Last modified: "April 20, 1998 19:01:27 by matt"

Alter the surface rendering code, /usr/tools/cse.pub/matt/GraphicsCourse/Woo_OpenGL/bezsurf.c, on pp. 448-449 of Woo's book, to provide an interactive user-interface to alter the x value of any of the 16 control points. The altered program should display the surface and the 16 points simultaneously. It should be possible to use the mouse to select any of the 16 points, and then (possibly by clicking on a different mouse button) move that point along the x axis incrementally.

The idea is for the program to act as a teaching tool, so that users will be able to learn the effect of the placement of the control points on the shape of the resulting bezier surface.

Hints: you may want to use the same selection mechanism as in your modelling project to select the points. You'll also need to come up with some way to display the control points that might be occluded by the bezier surface. Transparency? "Control rods"? Drawing the control last? Be imaginative.

The initial coordinates of the control points should be read in from a file, "points". The format of that file is row-major order, the coordinates of one point on each line.

x0 y0 z0   The coordinates of the 4 points of the first row
x1 y1 z1   comprise the first four lines of the file....
x2 y2 z2
x3 y3 z3
x4 y4 z4  The coords of the points of the next row start here....