Computer Graphics
Summer 2007
G22.2270-001

Tuesdays, 6pm - 8:20pm
WWH 101



Assigment 5
DUE: Monday 7/4/06 midnight (11:59pm)


In this homework I am asking that you implement a curve drawing interface for both Bezier and cubic B-Spline curves.

The user should be able to click on a set of points on the screen and choose either the Bezier or B-Spline option to draw the curve, using the entered points as control points in the same order that they were entered. Display the control poly-line as well as the curve. (You can toggle the appearance of this using a key press)

We have covered the basics of both types of curves in the most recent lecture.

You can use the OpenGL evaluators for Bezier curves, make sure that you use subdivision in order to draw the cubic b-splines. Feel free to implement b-splines using gluNurbs (in addition to subdivision - just have an extra mode) for extra credit.

Make sure to support more than four control points. (About  15 should be a good number)

Your program should have an option to complete the curve into a closed curve when say, the key 'C' is pressed. Remember, you can do this by cycling around the control points, i.e. use the first few points user clicked on as the last few ctrl points of the last polynomial. You may find the closed curve version easier to deal with so feel free to start with this.

Note that with b-splines nr of control points should not matter.  For Bezier curves, you will need to consider nr of control points to be able to add an extra section to your curve. (every 4 will define a new curve section). I will go over this and closed bezier curves in class.


Other than the requirements, feel free to add options/functionality/visual enhancements of your own. I will give extra points for these additions. -- make sure to list them in your readme file.