CSE 457: Intro to Computer Graphics
Project 4: Animate
Date Assigned: Monday, November 24, 1997
Date Due: Wednesday, Dec 10, 1997
Project Objectives
This project is designed to introduce you to splines and how they are used for
animation. There are two parts to this assignment; please get your splines
checked off by a TA before moving onto the artifact.
Animator Interface
The user interface for the animator program will allow the user to vary
any parameter within the scene. All scene nodes are displayed in a text tree in
one window. A node that is selected from this window will have its field
values varied over time according to lines displayed in the curve window. The
curve window shows a line that can be adjusted by clicking and dragging its
control points. The x-axis represents time and the y-axis is the parameter
value, so each control point corresponds to a position at an instance in time.
Two views of the scene being animated are below the curve window. You can view
the scene at any frame by moving the current frame marker in the curve
window. You can change your geometrical viewpoint by clicking inside the scene
window or preview your animation using the play, pause, rewind and fast
forward buttons below the scene views.
Required Extensions
Currently, the system is incomplete. You will need to implement some
routines for the curve window portion of the interface. So far, linear
interpolation is the only type of 'curve' implemented. Linear interpolation is
how VRML animates. A line segment is drawn between adjacent control points, and
the parameter value is evaluated along that line for every time between the two
control points. You will improve upon this system by ading the capability for
a parameter to be evaluated along a curve, thus giving smoother movement to
your characters.
There is a Curve class defined in Curve.h which you will find useful.
Your code belongs in EvaluateCurve.C. You will need to write one routine
that that takes as inputs
- The number of control points (for Bezier curves you can assume
the number is a multiple of four)
- An array of 2-dimensional control points
- A "curveType" : either "Bezier", "Bspline", "CatmullRom" or
"C2interpolating"
- A flag "wrap" indicating weather or not the animation is cyclic
(i.e., weather the control points should wrap around).
- A time t* at which to evaluate the curve
The function should output the curve value y* at time t*.
To do this, the function needs to search for the curve segment i
such that t[i] <= t* <= t[i+1]. It then needs to find the value of u such
that t[u] = t* and then output y[u]. You could do this second part using
binary search on the interval 0 <= u <= 1.
C2-interpolating splines have an extra two degrees of freedom that are
unspecified by the control points. Probably the simplest way to handle
this is by drawing what was referred to in class as "natural"
C2-interpolating splines, that is, let the derivatives at the two
endpoints be equal to zero. There are other valid ways to handle this,
see the bells and whistels section.
Time needs to be
monotonically increasing. It doesn't make sense to have something moving
backwards in time, or you can think of it that every point in time needs to
correspond to exactly one parameter value. Note that for interpolating
curves (type "CatmullRom" or "C2interpolating"), the condition that the
t values of the control points does not necessarily ensure that the
curve itself will also monotonically increase in t. You should
recognize this case and remind the user to move the control points.
Get this much ok'd by a TA before continuing.
Animation Artifact
You will eventually use the curve editor to produce an animated
artifact for this project. Each person must turn in their own artifact. We may
give extra credit to those that are exceptionally clever or aesthetically
pleasing. Try to use the ideas discussed in lecture, such as: anticipation,
follow-through, squash and stretch, and secondary motion.
Note: You need to remove all PROTO's, scripts, events, routes, textures,
timers
and interpolaters from your VRML file before feeding it to the animator.
If you need to, you can add them back in once the spline animator has worked
its magic.
Bells and Whistles
Enhance the requred spline options
Some suggestions:
- Implement higher degree polynomial splines (ones that
are C3 or C4 continuous)
- Implement C2-interpolating splines allowing the user
to specify the derivatives at the two endpoints
- Let the user control the tension of the Catmull-Rom
spline
- Add the ability to display cubic Bezier curves so
that the two "inner" control points appear as "handles" on the
interpolated "outer" points. (This would appear more intuitive to the
user)
- Add options to the user interface to enforce C0 or C1
coninuity between adjacent Bezier curve segments automatically. (It
should also be possible to override this feature in cases where you don't
want this type of continuity.)
- Add the ability to add a new control point to any
curve type without changing the curve at all.
- Re-evaluate just the portion of the curve that
changes whne a given control point is manipulated, rather than the whole
thing
- Use a faster curve evaluation function than binary
search
If
you find something you don't like about the interface, or something you
think you could do better, change it! Any really good changes will be
incorporated into Animator2.0.
And Finally...
When you are finished with this assignment, type "make clean" to clean up
unnecessary disk space.