Math 155B - Introduction to Computer Graphics - Winter 2004

Project #4 - Order four B-spline interpolating splines

Overview:  For this assignment you will update your project #2 program that accepts points via the mouse, and draws a spline curve which interpolates them.  Your program will now generate four kinds of curves: Catmull-Rom curves and Overhauser curves; and  interpolating B-spline curves of degree 3 with (a) uniformly spaced knots and (b) non-uniformly spaced knots.

You will be able to toggle between  all four kinds of curves and compare how nice they are.

Due date: Tuesday, February 24, midnight.

Your program should support the following:

  1. Left mouse clicks place points in the window.  The curve is updated on the screen interactively with mouse clicks.
  2. The curve interpolates all the points, including the first and last points.  
  3. The c command ("c" for "curve") toggles between (a) Catmull Rom/Overhauser and (b) interpolating B-splines curve.
  4. The u command ("b" for "uniform") toggles between (a) uniform knots and (b) chord-length parameterization.  In uniform knots, ui = i  (with the first and last knot repeated four times).  For non-uniform knots, the successive ui are set according to the chord length between successive control points.
  5. The f command removes the first point on the curve.  The l command removes the last point on the curve ("f" for "first" and "l" for "last").  If more than 64 points are placed, then the first point is removed.
  6. Use different colors for Catmull Rom/Overhauser curves and for B-spline curves so we can tell them apart easily.
  7. Use of VectorR2 or VectorR3 classes is optional.  The use of templates is optional.

A sample executable showing the desired behavior is available as CatmullBsplineDraw.exe.   If that program gives you runtime errors with an incompatible glut32 dll, try CatmullBsplineDraw2.exe.  (You might improve on my program by not using black curves!)

Helpful hints:

  1. Start by modifying your project #2 program.

  2. The sample program using templates and VectorR2, plus the supporting vector classes, is available at

  3. A handout with formulas for Nj,4(ui) is available in PDF format.  These are the easiest way to calculate values α, βi, γi.
  4. Use the de Boor algorithm to calculate points on the curve.  You will need to first locate the interval where the point lies, that is, to calculate q(u), you first must determine  the value i such that  ui ≤ i < ui+1.
  5. You do NOT need to support repeated control points anymore.
  6. If you have problems with dropped pixels in thick lines, this is an OpenGL implementation bug, and is not your fault.

Grading:  Grading is individual as usual.  Please do not modify your files after the due date.  Place you projects in your ieng9 home directory in a folder named "Project4" (exactly this name please!).