Interactive Computer Graphics: Assignment 7

Bezier Patch

Topics:

Create a program that draws a flat-shaded tesselation of a bicubic Bezier patch to the screen.
Compute the diffuse color of the Phong shading model for each triangle on the patch.
The initial control points for the patch are provided in a text file.
The file format will be 3 floating point numbers per line, with 16 lines.
X-Y Ordering: [0,0], [1,0], [2,0], [3,0], [0,1], [1,1], [2,1], etc.
You may hard-code the control points in your program.

Tessellate the patch into triangles and calculate a surface normal and diffuse color for each triangle.
Use at least one light source to shade the patch, which is near and connected to the camera.
Use an iterative, not recursive, evaluation technique to calculate vertices on the patch.
Initially the patch should be sampled with a 10 x 10 resolution.

You will draw the patch and the control points (as GL_POINTS) for the patch.

Also draw the X, Y and Z axes. They should be drawn at the origin of the pathch's coordinate system. X axis should be drawn as a short red line. Y axis as short green line, and Z axis as a short blue line.

INTERACTION:

The patch should be in the middle of the window when your program starts.
The user should be able to change the view of the patch, and the camera should always look at the patch.
Include a command to reset the view.

The user should have the capability to choose a control point to modify, via keyboard interaction.
Change the color and/or size of the selected control point.
The user can then change the location of the selected point via 6 keyboard buttons (increase/decrease x/y/z position).

The user should be able to increase and decrease the sampling of the patch with a keyboard interaction.

You should not use the Ed Angel example code to complete this assignment!

Link to Initial Control Points

Link to smf file of tessellated patch, so you can see what yours should look like


Grading Scheme

  1. Tessellating patch (3 points)
  2. Flat-shading (2 point)
  3. Drawing axes and control points (1 point)
  4. Changing view of patch (1 point)
  5. Selecting and moving control point (1 point)
  6. Updating patch triangles after interaction (1 point)
  7. Modifying triangle resolution (1 point)

Last modified March 11, 2017.