backflip.jpg (39279 bytes)

Computer Graphics, Fall 2001

Adam Finkelstein

Thanks to Chuck Rose for ideas, code, and data!


Assignment 4: Keyframe Animation

Due: 6 December 2001, at 11:59PM

Overview

Overview

In this assignment you will animate motions for an articulated figure. You will be given an articulated 3D model and sets of keyframes specifying the orientations of articulated joints at specific time steps.  Your job is to interpolate the keyframes smoothly over a time interval and display the articulated figure in an OpenGL window so that it performs animated actions (e.g., walks, dances, etc.) in real-time.

What You Have to Do

The assignment is worth 20 points. The following is a list of features that you may implement. The number in parentheses corresponds to how many points it is worth.  Options in bold are mandatory. You should implement two programs: a keyframe editor and a keyframe animator.

Keyframe Editor:

The keyframe editor is a program that allows a user to edit keyframe parameter values interactively while displaying a smooth curve interpolating the data.  should read in a .key file specifying a sequence of values for each of several named parameters at a sequence of uniformly spaced time steps and open an OpenGL display window.  You should allow the user to select any of the parameters from a pull-down menu and draw a curve through the keyframe values for that parameter.  The user should be allowed to drag the keyframe values up and down while updating the curve in real-time.  Finally, you should allow the user to save the new keyframe values to a new .key file.  An overview of the .key file syntax can be found here.  A parser can be found here.
Keyframe Animator:
The keyframe animator is a program that animates motions of an articulated figure according to a specified set of keyframes. The input to the program will be a .ray file specifying an articulated figure as a hierarchy of limbs connected by parameterized joints, specified by a new .ray file command, called #joint_begin ... #joint_end, which is similar to #group_begin ... #group end.  The resulting scene graph is a hierarchy of rigid-body links connected by parameterized joints, each of which represents a single-parameter transformation (e.g., rotation) to be applied to its subtree.  A .key file can be included (via the #key_file command) to specify the value of each parameterized joint at specified time steps.  Your job is to write a real-time OpenGL program that animates and draws the articulated object described by the .ray file according to the keyframes specified in the .key file.  An overview of the new .ray file syntax can be found here.
By implementing all the required features, you get 16 points. There are several ways to get more points: It is possible to get more than 20 points. However, after 20 points, each point is divided by 2, and after 22 points, each point is divided by 4.

Getting Started

You should use the following skeleton code 4.tar.gz 4.zip, as a starting point for your assignment.
It is very similar to the code used in assignments #2. A new overview of the code can be found here.
In addition to the code for reading and drawing .ray and .key files, we also provide you with the following code for least squares fitting of data (to be used for fitting BSpline control points): By compiling the provided code, you will get a .ray file viewer suitable for use in the "keyframe animator" portion of the assignment.
You can use this code, or any other OpenGL program, as a starting point for the "keyframe editor."

What to Submit

You should submit one archive (zip or tar file) containing: The writeup should be a HTML document called assignment4.html which may include other documents or pictures. It should be brief, describing what you have implemented, and how you created your models.

Make sure the code compiles in the Friend workstations under Visual C++ or under linux. If it doesn't, your grade will suffer.

If submit doesn't work email your assignment.  Always remember the late policy and the collaboration policy.
 

Notes

I recieved a number of questions about the .key file editor and how it should be incorporated into the project. There are really two ways and either will do: While I believe that the second method is much cooler, I would advise you to stick with the first. There are executables in the test directory of the skeleton code called key_editor.exe, animation_viewer.exe (separate editor and viewer) and animator_editor.exe. (combined into one application) You can run them by typing:
animator_editor -src <.ray file>

animator_viewer -src <.ray file>

key_editor -src <.key file>

The executables implement linear and gaussian interpolation, which should not be too helpful for you, but at least you can get a sense of what the .key file editor should look like in action. (Note that you will get a black screen until you select some parameter.)
Further note that example animation files (ray files) are in the act directory. The current test programs use relative pathing from the directory that they are run from. (This means that included ray files (ie body parts) in the main animation ray file are pathed from the executable location and not relative to the animation ray file's location which is what one would expect)