Interactive Computer Graphics: Assignment 7

Bezier Patch

Topics:

Create a program (based on HW6?) that draws a flat-shaded tesselation of a bicubic Bezier patch to the screen.
The tessellation should consist of N x M samples in the u and v directions.
Compute the Phong shading model for each triangle on the patch with the modified Gouraud shading code provided in the lecture slides.
The control points for the patch are provided in a text file.
The file format has 3 floating point numbers per line, with 16 lines (one for each control point).
i-j ordering of the control points Pi,j is: P0,0, P1,0, P2,0, P3,0, P0,1, P1,1, P2,1, etc.
You should hard-code the control points in your program.

Tessellate the patch into triangles, calculate the average normal for each vertex and display flat-shaded triangles with Gouraud shading.
If a normal vector is pointing away from eye point, the normal should be flipped. This ensures that both sides of the patch are shaded.
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, i.e. num_u = num_v = 10.
num_u and num_v should not go less than 2.

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

Also draw the X, Y and Z axes (as gl.LINES). They should be drawn at the origin of the patch'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, similar to HW5.
Include a command to reset the view.
The user should be able to switch between parallel and perspective projection.

The user should be able to increase and decrease the (u,v) sampling (each parameter independently) of the patch with a keyboard interaction.
Increment/Decrement the sampling (num_u or num_v) by 1 unit.
The patch should update with each keyboard input.

In your README file tell me in which file and at which lines I can find the code that calculates a point on the patch, given a (u,v) pair.
Describe where you store your control points. They will be edited to test your patch evaluation code.

Include directions on how to use your interface on your web page.

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

Your program should look something like this video.


Grading Scheme

  1. Evaluating and tessellating patch (5 points)
  2. Phong-model-based flat-shading (1 point)
  3. Drawing axes and control points (0.5 point)
  4. Changing view of patch (0.5 point)
  5. Updating patch triangles after interaction (1 point)
  6. Modifying triangle resolution correctly (2 points)

Last modified March 4, 2024.