Computer Engineering 519 (Graphics) Project 6 Page



For this project, we needed to implement a program to draw Bezier surfaces. The program needed to be able to draw both wireframes and shaded/lit surfaces. The program also needed to allow the user to modify the surface by changing the control points. Finally, the program needed to allow the user to rotate the view.

For the view maniupulation, I used the same method for project 4. To rotate the scene in along the X axis, hold the left mouse button down while move the mouse up and down. To rotate the scene along the Y axis, hold down button one and move the mouse left and right. To translate the scene up and down, hold down the middle button and move the mouse up and down. Likewise, to translate in the left and right directions, hold the middle button and move the mouse left/right. To zoom in/out on the scene, hold the right mouse button down and move the mouse left and right.

My method of picking points for the previous two projects didn't seem as efficient or useful as the method I choose for this project. To move the active control point along the Y axis, use the up and down arrows under the 'Row' label. To move the active contrl point along the X axis, use the left and right buttons under the 'Control Point' label. The coordinates of the active point are shown in the three text boxes above the 'Increment' label.

Once a control point is selected, it can be manipulated in two different ways. For finer control, the X, Y, and Z arrows can be used. The sliding 'Increment' bar changes the value X/Y/Z are increased or decreased by for each arrow click. The second way is to press the 'Points' button below 'View'. Now, holding down the left mouse button causes the X coordinate to change. Holding down the middle mouse button causes the Y coordinate to change. Holding down the right mouse button causes the Z coordinate to change. Click 'View' to go back to the scene manipulation mode.

The wireframe/shaded buttons do as the name implies. Clicking shaded causes the model to be drawn using polygons instead of line segments. If the number of control points is high and the number of intermediate points is high, this can take several seconds easily. However, the shading function creates a display list so once it has been created, manipulating the scene is still very responsive.

The label that says "Ready..." will be blank when computations are going on. As soon as "Ready..." returns, it is safe to manipulate any part of the scene or surface.

The 'Intermediate Points' slider controls the number of points drawn between the contrl points. More points makes a much nicer looking surface, but slows down surface manipulation functions and require lots of memory. 50 is the maximum number of intermediate points. Any more become somewhat pointless and cause calculations to take forever.

The reset button resets many of the controls (and the view) to their initial values. I decided against reseting the control net. That can be done with the 'Number of Control Points' option. Generally, it was more important to re-locate the scene than reset the control point net.

The 'Show Contrl Points' toggle controls whether or not the control point net will be shown.

The 'Show Surface' toggle controls whether or not the actual Bezier surface will be shown

The 'Show Normals' toggle is meant to show the normals from each vertex in the surface. Unfortunately, the normals are a little strange. This option also takes a long time to calculate the normals and display them.

The 'Number of Control Points' selector allows the user to set how many control points make each dimension of the control net. The minimum is 5 and the maximum is 12. Each time the number is changed, the net is reset to the flat initial grid. A large number of control points and a large number of intermediate points will slow down surface recalulations tremendously. (it takes over a minute on my R4400/250 Indigo2 when there are 10 control points and 50 intermediate points to shade the image)

I enjoyed this project quite a bit. I tried to utilize B-splines too, but had no luck.

The code is here.

Screenshots follow.

Figure 1: A simple curve. 7 control points, 7 intermediate points

Figure 2: Same curve, 25 intermediate points

Figure 3: Same curve, 40 intermediate points

Figure 4: Same curve, shaded

Figure 5: Same curve, shaded, back to 25 intermediate points

Figure 6: New curve, 40 intermediate points

Figure 7: Same curve, showing just the control points

Figure 8: Same curve, rotated

Figure 9: Same curve, shaded

Figure 10: Front view of the curve

Figure 11: Back view of the curve