DUE Wednesday April 18 at Midnight
In this assignment, you will add some objects created from Bezier and B-spline patches to your scene. Note that the reason for adding these to your current system is to preserve the ability to light and view the objects, but the only new objective of this assignment is the modeling of objects with curved surfaces.
You will extend your system to allow objects modeled with with curved surfaces, using OpenGL evaluators for Bezier patches.
First model the classic and ubiquitous Utah teapot. The data for the teapot is here and here, or in Appendix A of the text. The teapot will be modeled with Bezier patches using OpenGL evaluators for rendering. The code for this is in the text in Chapter 11 and also here. You can feel free to check your work by using the glu teapot function to create a second teapot for comparison if you like. Your teapot should be able to be lit with all the lighting modes you previously implemented for polygonal objects, using whatever lighting controls you have already created. You should also arrange to texture map the teapot, using at least one texture of your choice. Finally, you should be able to turn on or off interactively a line drawing of the control polygon of the patch array so that you can see where the control points are.
Next model the teapot with uniform periodic B-splines (the kind that don't interpolate any control points). You can do this by converting from the Bezier control points to B-spline control points patch by patch. In the renderer, use the reverse conversion from B-spline control points to Bezier control points to render the teapot from the B-spline control point mesh you read in. Again, be able to interactively control a display of the control points, but this time display the B-spline control points. Note that other than these conversions, the rendering code is the same for both cases, so your renderer should be able to read in either B-spline or Bezier control points, display the object, and allow the display of both Bezier and B-spline control meshes for any object defined either way under iteractive control. You should provide a way to read and write files of the control points of either type, so that your system will display objects defined by either Bezier patches or uniform periodic B-spline patches and will allow conversions from one type to the other. You not required to provide a general facility for specifying textures to or other material properties to be used on these objects in your input files.
Finally, use the capabilities described above to design another object of similar or greater complexity as the teapot. Make sure that some of the patch-to-patch boundaries are smooth while others show derivative discontinuities. Use your imagination to come up with target objects, Wine glasses, interesting bottles, space-age buildings, etc. are all common choices. Dress up whatever you make with an interesting set of surface properties and textures.
For extra credit, try one or more of these: