CSE 457: Introduction to Computer Graphics
Project 4 Help Session
This help session is designed to assist you in completing project 4,
Animate. It covers the following topics:
- Startup
- The Curve Window and the Animator Interface
- The Starting Point Code
- Addition Notes
Startup
The project files can be copied from /cse/courses/cse457/projects/animator.
The program is then run by typing animator and the name of your VRML file. Curve files can be loaded
into or saved out of animator. Don't forget to save early and often.
The Curve Window and the Animator Interface
Animator
The model's entire hierarchy is drawn in the left window. Interpolators for scaling,
rotation, and translation are implicitly added for each node in your model's hierarchy.
I would suggest naming all your transform nodes, or
else the program will assign a name, and it's not pretty.
- a left mouse click on any of the interpolators will select that
interpolator for manipulation in the curve window. If you click on
the interpolator name, "X" will be selected. If you click anywhere
beside the interpolator areas, nothing will happen.
- all your models will have a hierarchy bigger than what can fit in the
window, so you can pan around in the hierarchy window using the right
mouse button. Simply click and drag the mouse around.
The curve window contains the curves for the interpolator parameters of
the interpolator currently selected in the hierarchy window. The curve
available for manipulation is purple, while the other 2 or 3 curves are
drawn in white. Each curve is initialized to have a single control point
at frame 0, with wrapping enabled. This makes the parameters static
through the entire animation.
- the left mouse button allows creation and movement of control points,
and allows movement of the current frame marker as well. If you click
near an already existing control point and drag, you can change the
position of the control point. If you click where a control point
does not exist and drag, you create a control point and get the same
effect as above. If you click on the current frame marker (the yellow
line) and drag, this will allow you to view the animation at any frame
you desire.
- the right mouse clicking on an already existing control point will
delete the control point. Clicking anywhere else does nothing.
The two view windows allow you to view your animation from two different
angles simultaneously. The unlabeled (!) buttons directly below the view
windows allow you to view the model from different angles in any of six
predetermined views, or one of your own choosing. The first button is a
"freeform viewing" button; if selected, you may change the view of the
model by using the mouse buttons (see below). The other predetermined
views, starting at the second button on, are: front, right, top, back,
left, and bottom. Clicking any of these buttons will change to said
viewpoint and report the result in the text window at the bottom of the
program window.
- in freeform viewing, the left mouse button allows click-and-drag
changing of the viewing angle. There is not a strict rhyme or reason
as to how dragging changes the viewing angle.
- in freeform viewing, the right mouse button allows click-and-drag
changing of the camera's zoom factor.
The buttons at the bottom of the Animator window allow playback of the
animation. They are all pretty self-explanatory, and report their result
in the text window at the bottom of the program window. The normal rate of
playback tries to emulate the playback of 30 frames per second that one
would ideally witness when viewing the animation with a VRML viewer. To
do this, the program drops frames until it progresses through 30 frames
every second, though the actual frame rate may be (much) less. The
fast-forward and rewind buttons try to emulate 60 frames per second, so
they will drop at least twice as many frames.
The buttons, sliders, and checkboxes on the left of the window provide
curve attribute options and animation saving/loading options.
- "Save VRML..." saves your new animation as a VRML file with the
interpolators set to perform the animation.
- "Save Curves..." allows saving of all the curves in the hierarchy to a
.crv file. It is best to give the curves the same name as you model.
- "Load Curves..." loads curves from a .crv file and applies them to
your hierarchy. This is by no means bulletproof, so it is up to the
user to load in the proper curves for the proper model. Also, if your
animation is longer than the frame rate currently selected, set it to
this higher frame rame before you load the curves. Otherwise, curve
information after the selected number of frames will not be loaded.
- "Curve Type" allows you to change the type of the curve currently
being manipulated in the curves window. It will only change this
curve.
- "Number of frames" changes the total number of frames of the
animation. If you increase the number of frames, no biggy, but if you
lessen the number of frames, it removes control points from all curves
in the hierarchy whose frame number exceeds the new limit. Please
note that this includes curves not currently being displayed in the
curve window.
- "Curve tension" changes the tension of the curve for Catmull-Rom
splines. It changes the "tension" value for the curve currently being
manipulated in the curve window regardless of its type, but results
will only be seen if the curve is of type Catmull-Rom.
- "Wrap curve" sets the "wrap" flag of the curve currently being
manipulated in the curve window to "true" if checked, and "false" if
not checked.
- "Wireframe" generates a wireframe view of the model in the view
windows if checked. In its current implementation, however, it does
not provide a speedup in rendering, so the animation will run at about
the same frame rate as with normal rendering.
The Starting Point Code
All of the required code for completing the animator project belongs in EvaluateCurve.C.
First you will want to fill in the function Evaluate Curve. As a function evaluateCurve takes
5 parameters.
- controlPts - the array of control points representing the curve at all times.
- numCPs - the number of control points in this array.
- curveType - the type of curve you will want to evaluate.
- wrapFlag - This variable signifies weither the curve should be wrapped or not.
- frameNumber - the frame number for which we want to evaluate the curve.
Right now EvaluateCurve only handles Linear Curve types. To get improved animation and extend the capabilites of
our animation software we want to implement Bezier, B-spline, Catmull-Rom, and C2
interpolating splines.
Additional Notes
- You will have to add the ability for the curve to be wrapped. This will allow the animation to
continue smoothly without any discontinuties as animator loops from the maximum frame back to the
minimum frame. When adding phantom points, you will want to think about adding some phantom points
beyond the point at the maximum frame, so that you can take into account the characteristics at the
begining of the curve. You will need to add these phantom points both before your first point and
after your last point, to make the curve continuous.
- Don't forget about adding the adjustible tension feature to work with Catmull-Rom splines.
- Any nice features added, might be added to later versions of Animator.
- Have fun working on your animations.
Send questions, comments, feedback to
cse457staff@cs.washington.edu