BU
CAS
CS 480
Introduction to Computer Graphics
Spring 1997
Programming Assignment 4:
Shaded Display and Animation of a Swept Solid
Due before class on Tuesday April 7
The purpose of the assignment is to introduce you to
1) spline based interpolation, 2) swept solids, and 3) basic 3-D shaded
display in OpenGL.
The Program You Write
Write a program that allows the user to create and modify a 3D closed,
periodic, piecewise cubic B-spline. Use this spline as the path that a 3D
cylindrical worm follows as it moves around the screen. Model the worm as
a swept solid that bends to conform to the B-spline path.
-
To make things easier, you can start the program with an initial spline
(for instance, a closed B-spline with 6 control points as shown on page 340
in the text).
- Allow the user to add, move, and delete the B-spline's control
points. The user should be able to select a control point by clicking the
mouse on/near it. Once selected, allow the user to drag the control
point.
- Allow the user to change the view displayed in the window. It should
be possible to show the top, front, and side view. The user should be able
to move spline points from any view.
- Write your own code to interpolate points along the B-spline based on
the math provided in the text.
- Provide a menu item that allows the user to start and stop the worm
moving along the spline path.
- The worm should be displayed as a 3D shaded swept solid. It is
sufficient to model it with a circular cross-section and planar end caps,
though you are welcome to build a more interesting model.
- Whichever model you choose for the worm, the worm should bend to
follow the spline curve as it moves along the animation path. This means
that the worm's center line should bend to coincide with the spline.
-
Be sure to use double buffering.
Hints
Look at the example shaded rendering programs in the Red book.
On-line versions of these and other example programs are available on
the CGL cluster:
/usr/local/glut/progs/redbook
/usr/local/glut/progs/examples
Demos and Grading
Your project must run on the SGI, therefore you will need
to use one of the SGI workstations in the CGL cluster (unless you have
access to an OpenGL elsewhere).
Your program's source files are to be electronically submitted by using the submit program on cgl. The code you submit
should conform with the program assignment
guidelines.
Part of your grade for this programming assignment will be based on
your giving a short demo (2-3 minutes) in the CGL cluster. You will
be expected to talk about how your program works, and we will see
how well your program performs on some test examples. Demos will be
scheduled from 2-5 on the assignment due date.
Extra Credit
Apply a texture to your worm. Allow the user to toggle whether a
texture map is used or not.
Test Cases
You are responsible for testing your own code.
Page Created: Mar 23, 1998
Last Modified: Mar 23, 1998
Maintained by: Stan Sclaroff