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:
- 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 B-splines curve.
- 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.
- 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 B-spline
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 Nj,4(ui)
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 ui ≤ i < ui+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!).