CS 551 / CS 651: Computer Animation

Fall 2003

Professor Brogan

 

Assignment 1: Rigid Body Simulation

 

Due: 5:00 Monday, Sept 29th

 

Introduction

 

You will write a program that animates the movements a rigid body undergoes as a result of a point force.  The important parts of this assignment are to write the equations of motion and numerical integrator.  Specific details are included below to indicate what resources (specifically, preexisting code) can be used for this assignment.

 

Updates

 

Sep. 24th - See the class web site for suggestions about how to incrementally tackle this assignment

Sep. 24th - Links to a simple box object (1 and 2) and a sphere.

Sep. 24th - The following email was sent to the class with suggested edits to MOI code

 

Details

 

1) Load a geometric model from a file (10 points): For this assignment, you must load 3ds models because they are commonly available from the web and because file loaders already exist.  Click here (or visit the online description of the assignment) for specific information about file loaders.

 

2) Compute the center of mass and moment of inertia (10 points): The model you load defines a volume.  Using the algorithm published by Lien and Kajiya in 1984, compute the COM and MOI (about the COM) of the model.  We provide code for this operation here.  Note that this algorithm requires closed models, ones that are manifolds.  Beware that many 3ds models are not manifolds.

 

3) Display the model in an OpenGL window (5 points)

 

4) Create a user interface for acquiring force from user (15 points): The point force applied to your model will be selected by the user.  Your interface must permit a force to be applied to any part of your model (including edges, faces, and vertices) and at any incidence angle.  Options include a simple vector-based description of a force vector and a ray-polygon intersection routine to determine where the force is applied to the model.  Alternatively, a user may use the mouse to select a location where the point force will be applied by clicking on the projected image of the model. 

 

5) Implement Euler and  Runge-Kutta integration methods (10 points): Your code must permit selection of which routine to use (either through the GUI or through command-line arguments) and what timestep to use.   You may use integration source code you find in textbooks or online.

 

6) Implement rigid-body simulation dynamics (points acquired through following demos): Use the algorithms described in Chris Hecker’s Game Developer Magazine articles

 

7) Apply a point force (20 points): Compute how a point force results in linear and angular accelerations.  Use the integrator from step (5) to compute velocities and changes in position / orientation for your model.  Use the simulator to simulate the continuous passage of time and permit continued application of point forces.  I recommend adding a viscosity term to reduce velocities over time so your model ceases to move and permits debugging.

 

8) Hang the model in the air (15 points): Weld a mass-less spring to a specific vertex of the model.  Weld the second end of the spring to a point in space.  Create a force, called gravity, in the amount of -9.8 m/s2 that is applied to the model at each time step.  Additionally apply the spring’s forces to the model at each time step.  The spring can be modeled as a line and the force it exerts should be in the direction of the line connecting the two endpoints and the magnitude should be linearly proportional to the displacement of the spring from its rest length (k*d).

 

9) Drop the model to the ground (15 points): This is where we will be checking the accurate simulation of collisions.  Using gravity as a force that pulls the model downward, simulate what happens when the model collides with an infinitely heavy plane, the ground.  Note that the collision simulation algorithms described in the Hecker articles do not correctly simulate how a model should be animated when it collides with another object in many places at once.  We will only test your code using simple collisions between a single face/edge/vertex and the ground.

 

Those taking CS 651 (the graduate version): the following must also be implemented:

 

10) Prepare a written analysis of the limitations of the system you have built with respect to being a true general purpose rigid body simulator. Things you might consider are: simultaneous collisions between three or more objects, other physical interactions between bodies, modeling more complicated mechanical systems like a multi-link pendulum.  In your analysis, identify weaknesses in the system you implemented and provide a short paragraph that references papers or techniques that are known to address the shortcoming.

 

Turnin and Grading

 

You work is due Sept. 29th at 5:00.  There will be a special directory created that you will use as a repository for your completed code.  Make sure you do not touch your code after the deadline because we will use the “last-touched” date on your source code to determine when it was turned in.

 

The TA will arrange grading sessions when each student will be granted a block of time to conduct a demo of the full functionality of his or her system.  The TA reserves the right to test specific scenarios of his design.  The TA will load your code from the special directory where you turned it in.  He will have a PC outfitted with Windows Visual Studio.net and Linux to run you code.  Please make sure your code is able to execute on such a machine.  If you desire to bring in a laptop on which your demo runs, please feel free.

 

The bulk of the credit for this assignment will be allocated to the implementation of the physical simulation algorithms.  You should make sure you acquire as much partial credit as possible by creating test scenarios for all working components of your code when you demo for the TA. 

 

Late policy: You have five late days to use during the semester.  Each late day you use will provide you with a 24 hour extension. 

 

Outside Resources

 

You may not use any physical simulation source code that you find in any books, the web, etc.  I stress that I want you to write your own code.  You can use books and the web to learn about physical simulation in general.  You may also use books and the web to acquire graphics interface libraries, numerical integration code, file loader and MOI libraries.