In this assignment you will implement an application to model a cubic Bezier surface by editing its 16 control points.
Your program should start with the needed 16 control points already placed in suitable initial positions. You will then have to implement a way to allow the user to modify the position of each of the control points by doing point selection and dragging with the mouse, and with a combination of key controls.
The proposed solution is as follows:
- a) re-use the polygon editing support code and modify it so that you can edit the XY location of the 16 grid vertices with the mouse;
- b) use keys q,a to move the currently selected vertex up or down along the Z axis.
You may develop a better interface to manipulate the control points, however, your solution has to either be the one suggested above or an improvement of it. The ideal solution would be only based on mouse movements with the use of “translation manipulators”.
Given any configuration of the control points, you will then evaluate the surface for several (u,v) points in order to generate a polygonal approximation of the surface in triangles. You will have to include keys to allow the user to change the resolution of the approximation, i.e., to increase or reduce the number of polygons. Use the following keys:
- w - increase the number of triangles;
- s - decrease the number of triangles.
Finally, you will also need to render the surface in four modes: wireframe, flat shading, smooth shading, and textured. For the textured version you just need to correctly map any image on the entire surface of the Bzier patch. Use the following keys:
- z - wireframe
- x - flat shading
- c - smooth shading
- v - textured version integrated with smooth shading
30% - User interface works well and allows to move all control points to any location.
30% - Surface is correctly evaluated with different resolutions.
10% - Surface is correctly displayed in wireframe and with flat shading.
15% - Surface is correctly displayed with smooth shading.
15% - Surface is correctly displayed with a texture integrated with smooth shading.