CS4451B Fall 2002: Assignment 4

Combining Motion Capture and Physics-Based Simulation

Due: 9am, Monday November 11th


To implement an animation based on a combination of motion capture (mocap) data of someone juggling 3 balls and physics-based simulation. To experiment with mocap data, and implement a physics-based simulation that is synchronized with it.

This assignment also allows you to implement a more complex retained-mode graphics program.


The motion capture data you will use consists of 41 points on the body, captured at 120 frames per second. The motion capture data does not include the 3 balls being juggled: you will use a physics-based simulation to add the balls to the animation of the mocap data.

You should write a Java program that uses the JOGGL retained mode library. The program should consist of at least two classes: a jooglMocapGroup class that is a subclass of jooglGroup, and a test program that uses it. You will probably need other classes. An image of what your program might look like is shown here (a movie of this program running is also available).

The "jooglMocapGroup" class is a subclass of jooglGroup that takes the filename of a mocap datafile as a parameter to its constructor. The group should create a subgraph that implements the mocap juggler. The origin of the group should be the origin of the mocap coordinate system. The group should contain, in the simple version, a single small white sphere for each mocap point and three balls (one red, one green and one blue) that are juggled by the mocap "hands". The animation should last (T+3) seconds, where T is the time of the mocap animation, and be implemented by:

  • Attaching jooglDynamicTransformation properties to the white spheres that set the position of the sphere based on the time, and dynamic transformations to the RGB spheres that add appropriate forces in the Y and XZ directions when a sphere is thrown so that it arrives at the catching hand at the correct time. Choose a gravitational acceleration that makes the spheres move in a reasonable manner. The spheres should not move for the first 2 seconds and the last second.
  • There should also be a collection of jooglDynamicMaterial properties attached to each node that make all the spheres transparent for the 1st second, fades them to opaque over the second second, leaves them opaque through the animation (when they are moving), and fades from opaque to transparent over the last second.

The test program should add a jooglMocapGroup to a scene consisting of a black and light blue checkerboard floor, such that the mocap juggler appears to be on the floor. The floor should be big enough so that the juggler is always on it. The camera should be out and slightly above the mocap juggler, looking down at the center of the juggler, such that the juggler fills a reasonable amount of the window while allowing the objects to remain within view. The user should be able to rotate the scene around the Y axis by clicking and dragging the mouse left and right, to see the juggler from all sides.

A sample data file (take2) is here. A description of the contents of the file is here. In this example, ball 1 starts in the right hand, and balls 0 and 2 start in the left. Your program can assume that all data files start that way. (The video of the take2 mocap session is here; you will notice that he starts with the balls in the opposite hands in the video, but things work out fine. Why?)

Turn in

Your submission should consist of a collection of java class files as described above. The TAs will evaluate it using the test program you provide with the test2 dataset. They may also use another dataset. Your source files should be commented with the usual comments.

Your submission MUST be submitted using WebWork, as discussed in class. If you are unsure of how to submit using WebWork, talk to the TAs BEFORE THE ASSIGNMENT IS DUE.

IMPORTANT: If the TA has to edit your files to compile your code, you will lose up to 25% of the grade you could have gotten.

Due date

This program is due at 9am on Friday November 11th. This means it must be received by 8:59am EDT on Monday to not be considered late.

Additional Instructions

The class files for a working implementation of JOOGL are here. (The source is here.) This implementation adds a jooglCone geometry class, as this will be needed for the optional part of the assignment.

Suggestion: you may want to use a manual clock in your program during debugging, to make it easy to step through the frames.


There are a number of possible extra credit parts of the assignment.

  • As noted here, take your own mocap data file and mark it up using the convensions described above. It should work with the same convension as the sample file (2 balls in the left hand) so that the same program will work with it.
  • Rather than represent the mocap data using a simple collection of points, you should represent it as a "snowman". This means you should replace the correct collection of points with white(ish) spheres that represent the various "snowballs" that make up the snowman. These sphere's should be deformed to match the mocap data (ie. they will be ellipsoids that are rotated and scaled to match each part, and change dynamically as the juggling proceeds). You should have "snowballs" for at least these the head, root, each upper arm, each lower arm, each hand, the pelvis, and one big one for the legs. The head should also have 2 black eyes, an orange cone for the nose, and 5 or more black spheres for the mouth. It is up to you to figure out how to combine the available data to deform the spheres, but you may ask the TA (Ben) or Prof (Blair) for feedback on your ideas.
    NOTE: you may work on this extra credit in groups of two or three. If you do work in a group, submit the extra credit as part of one of the group member's assignment submission (ie. their program will show a snowman instead of a collection of spheres) and send mail to the TA (Ben) telling him who worked in the group on the extra credit. All group members should still submit their own assignment (ie. with the collection of spheres for the mocap data).