Animated Robot Arm

Project 4: Animator

Assigned: Friday May 12, 2000
Due: Friday May 26, 2000
Artifact: Friday June 2,2000

Help Session #1: Monday May 15, 3:30 in Sieg 228

Help Session #2: Tuesday May 16, 2:30 in Sieg 228

Project TA: Adam Kirk


  1. NT Skeleton
  2. NT Sample
  3. Help Session Document
  4. Animation Length Fix

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. The first is to complete a keyframe animation system which is based on the project 2 modeler code. This system lets you assign a time-varying curve to the variables of your model that were controlled with sliders. The system currently only supports piecewise linear curves; your job is to extend it with several types of splines. Additionally, you should create a particle system to integrate with your animation.

The second part, due shortly after the implementation is due, is to use your system to produce an animation based on the character you developed in project 2.

Using models with animator

The skeleton code contains all the files that are needed for you to get started, minus all the spline implementation. The sample solution has all the required curve types implemented (as well as a few more), so you can see how they behave. The help session document is here

A new user interface has been created to assist in positioning the camera. To use this, make sure that there are no calls to load a new matrix (i.e. glLoadIdentity, glLoadMatrix, etc) before your model is drawn. The camera positioning occurs before the model is drawn, so any of these operations will destroy that positioning.

To use viewpoint positioning, select the edit view button on the curve editor. Then drag the model around until you have positioned it as desired. Next, move the time slider (using shift - middle click) to the desired time, and click set viewpoint. This sets the camera position at the value of the slider to be what you see. To manipulate the model using the viewpoint editor:

-Left click and drag to rotate about the axis
-Middle click and drag to translate
-Right click and drag vertically to zoom
-Shift - left click to rotate only about the y axis
-Shift - middle click to rotate only about the x axis
-Shift - right click to rotate only about the z axis
There is a new control type called a curve control. This works just like the scale controls, but does not create sliders. Use this type if you want to animate a variable but don't want to clutter up the control panel with a slider for it. The arguments are the same as for scale, omitting the res argument.

Animator interface

When you first load a model, animator will open up in curve editor mode. The x axis represents time; 20 seconds by default but this can be changed via the animation time parameter box below curve editor. Every slider or curve control now appears in the animation variables pop-up menu. You can display the pop-up menu by right-clicking the curve editor. You can turn the display of individual curves on and off using this menu. You can display as many curves as you want on the curve editor. To select a curve, you should click the curve with your middle mouse button. When a curve is selected, its control points are drawn with circles and can be edited. Create a new control point by clicking on the background with your left mouse button. Control points can be moved around by dragging them with the mouse. They also can be deleted by pressing the control key while left-clicking them.

By default, a curve will always have two control points. This means when a curve is displayed for the first time, it will always be a piecewise-linear curve, regardless of what curve type is selected in Curve-type menu.

Holding the shift key down while dragging the mouse with the middle mouse button in the curve editor will drag the time line, a red vertical line, around. This can be used to see how your model behaves in a particular time period. In adddition, you can zoom in and out on your curve to get a finer curve. You can do this by pressing the shift key and selecting a region on which you want to zoom in. The Undo Zoom button is provided to undo the zoom. The curve settings menu changes how the control points are interpreted. Use this menu to change the type of spline used for a particular curve. The skeleton code has only the type linear; your job is to implement Bezier curves, B-splines, and Catmull-Rom splines. Other curve types may be added for extra credit.

Each curve type must support a wrapping flag, indicating whether the curve should continuously wrap around from the end of the animation back to the beginning. For wrapping around Bézier curve, please click here.

Animations can be saved and reloaded. If you change the model, when you load an animation the system will match curves to saved values in the file based on the name of the control.

Adding curve types

For each curve type, you must write a new class derived from CurveEvaluator. Inside the class, you should implement evaluateCurve function. This function takes the following parameters: control_points--a collection of control points that you specify in the curve editor, evaluated_curve_points--a collection of evaluated curve points that you return from the function calculated using the curve type's formulas, animation_time (the maximum time that a curve is defined), wrap_control_points--a boolean flag specifying whether the curve should be wrapped, and bezier_curve_points - a collection of bezier points that you return from the function. To add a new curve type, you add a line in the CurveEditor constructor in the same fashion as the addition of the curve evaluator already present (the piecewise linear curve evaluator). For Bezier curves (and the splines based on them), it is sufficient to sample the curve at fixed intervals of time. The recursive subdivision algorithm presented in class may be implemented for an extra bell.

You do not have to sort the control points or the evaluated curve points. This has been done for you. Note that for interpolating curves (Catmull-Rom), the fact that the control points are given to you sorted by x does not ensure that the curve itself will also monotonically increase in x. You should recognize and handle this case appropriately.

Particle System Simulation

You should implement a particle system simulation within the animator.   The initial location, velocity and force of the particles should depend on the certain geometric properties of the character (which, in turn, depend on the animation variable curves).  For example, we can define the detailed animation of the character and then add an effect of sparks flying off the heal as the character's foot hits the ground.  Similarly, as the train moves, the chimney could release particulate smoke.  The location and the timing of the sparks depend on the position of the heel.  We can calculate the position of the heel (or the top of a chimney) during the animation by multiplying the heel's local position in the object space by the matrix accumulated during the traversal of the model hierarchy.   Each particle is specified by its mass, start and end time, position, velocity and the accumulated forces.  The forces acting on the particle should include at least the initial creation force (acting on the particle at the start time) and gravity.  You should not worry about providing the user interface for the particle system.

With the click of a button, the entire animation is simulated once, at which point the simulation is "baked" and can be played back in a regular fashion.  In order to enable playback, you should record the trajectory of each particle during the simulation.  You can subsequently change the motion curves of the character, and then re-simulate the particle system. Look at these SIGGRAPH course notes on particle systems for details.

Animation Artifact

You will eventually use the curve editor and the particle system simulator to produce an animated artifact for this project. Each group should 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 the John Lasseter article that will be distributed in class. These include anticipation, follow-through, squash and stretch, and secondary motion. 

Requirements

Bells and Whistles

[whistle] Enhance the required spline options. Some of these will require alterations to the user interface. Some suggestions:


[bell] Use a recursive subdivision algorithm to produce Bézier curves, rather than just sampling them at some arbitrary interval. You must be able to toggle this feature on and off as well as provide a control (e.g., a slider) for the flatness parameter. The number of points generated for each curve is displayed at the bottom right, so you can see how well your adaptive algorithm is working.


[bell] Extend the particle system to handle springs. For example, a pony tail can be simulated with a simple spring system where one spring endpoint is attached to the character's head, while the others are floating in space.  In the case of springs, the force acting on the particle is calculated at every step, and it depends on the distance between the two endpoints.


[bell] Allow for particles to bounce off the ground floor surface by detecting collisions and computing the collision response.


[bell] Implement a "general" subdivision curve, so the user can specify an arbitrary averaging mask.


[bell][bell] Implement natural C2-interpolating splines.  For extra credit, allow the user to specify the derivatives at the two endpoints


[bell+whistle] 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 Animator 2.0.