Math 155B  Introduction to
Computer Graphics  Winter 2004
Project #4  Order four Bspline
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:
CatmullRom
curves and Overhauser curves; and
interpolating Bspline curves of degree 3 with (a) uniformly spaced knots
and (b) nonuniformly 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:
 Left mouse clicks place points in the window. The curve is updated
on the screen interactively with mouse clicks.
 The curve interpolates all the points, including the first and last
points.
 The c command ("c" for "curve") toggles between
(a) Catmull Rom/Overhauser and (b) interpolating Bsplines curve.
 The u command ("b" for "uniform") toggles between (a) uniform knots
and (b) chordlength parameterization. In uniform knots, u_{i}
= i (with the first and last knot repeated four times). For
nonuniform knots, the successive u_{i} are set according to the chord
length between successive control points.
 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.
 Use different colors for Catmull Rom/Overhauser curves and for Bspline
curves so we can tell them apart easily.
 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:

Start by modifying your project #2 program.

The sample program using templates and VectorR2, plus the supporting vector
classes, is available at
DemoVectorR3Templates.zip.
 A handout with formulas for N_{j,4}(u_{i})
is available in PDF format. These
are the easiest way to calculate values α,
β_{i}, γ_{i}.
 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 u_{i} ≤ i < u_{i+1}.
 You do NOT need to support repeated control points anymore.
 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!).