Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Programming Assignment
Part 1: (20%)
Theory questions:
(1) (6%) By using the curve interpolation method, we use a cubic parametric polynomial () to fit four control points P0, P1, P2, and P3. This cubic polynomial curve passes through the four control points P0, P1, P2 and P3 when parameter u=0, 1/3, 2/3, 1 respectively. Find a matrix M which satisfies the condition f(u) = UMP
(where U= , P=, f(u) is a vector which has three components (x(u), y(u), z(u)); Each control point is a vector representing x, y, z coordinate as ).
(2) (6%) The uniform B-spline curves can be used to approximate the curve segments which are determined by a number of control points. Given six control points as shown below, use the B-spline curves to approximate the six control points in the following case: the degree of the B-spline polynomial is 2.
Indicate how many curve segments there are in this case;
Sketch the B-Spline curves on the following graph and label the curve segments.
(3) (8%) If the control point P5 is repeated as shown below. P5 will be used more than once in the evaluation for one curve segment. If we use the uniform cubic B-spline curves to fit the control points: p0, p1, p2, p3, p4, p5, p5, p5.
(a) (2%) Indicate the range of the knot values (i.e., 0, … ,m).
(b) (3%) Plot the blending functions within the knot value range (0, … ,m).
(c) (3%) Sketch the uniform cubic B-spline curves to fit the control points: p0, p1, p2, p3, p4, p5, p5, p5. Label all the curve segments explicitly.
Part 2: Programming Part (80%)
Description:
Surface rendering is achieved by applying natural lighting effects to the visible surfaces.
In this assignment, you are to implement the visible surface detection algorithm (i.e., back-surface removal) to display a Bezier surface patch. The illumination models, including the ambient light, diffuse reflection and specular reflection, are used for the surface shading. Two shading methods (flat shading and Gouraud shading) are applied. Surface details can also be added to the patch by using the texture mapping method. Through this assignment, you will practice the basic methods in surface rendering and display (back-face removal, shading and texture mapping), and simulate the lighting effect by using OpenGL.
Part A: Bezier surface deformation
Create a 3D surface patch using cubic Bezier surface representation:
In order to represent a Bezier surface patch, 16 control points are defined. Modifying any control point will change the shape of the surface. In this assignment, four control points are allowed to change through the menu click. The coordinate values of the control points can be modified in X, Y, and Z axes separately. This implementation will give you an intuitive view of how the control points affect the shape of Bezier surface patch.
In order to display the surface efficiently, you are required to implement the back-face removal algorithm such that only the visible surfaces are displayed.
(Extra Points (Optional): In the setting of perspective projection, select any of 16 control points to change the shape of Bezier surface. The control points can be determined by mouse click and gluUnproject(…)).
Part B: Surface Shading Generation
Define a point light source, generate the shading effects including ambient reflection,
diffuse reflection and specular reflection (phone model) on the Bezier surface patch.
You are to set a light source, surface material parameters and viewing position by using OpenGL. The illumination effects are adjustable (i.e., diffuse reflection, shininess and the lighting position) through the surface material definition. Both the flat shading mode and the smooth shading mode are applied.