CS 101.3

Spring 2002

Homework 5 – Rigid Body Simulation (due June 2nd 11:59pm)

 

This homework is intended to let you play with some physically based modeling techniques.  You will need to implement a rigid body simulation of an object falling and bouncing off a floor.  You will be given a simple mesh and a specified height at which to drop the mesh (and a specified time interval) to animate the motion and interaction of the mesh and the floor.

You should begin to work on this animation as soon as possible.  Start working on your simulation with a rectangular block mesh of constant density with height = 1, width = 4, depth = 3.  The floor will be an axis aligned x-z plane going through the orgin.  You will need to compute and store the state of the rigid body throughout the simulation: position, orientation, linear momentum and angular momentum.  You will need to compute the mass and inertia tensor for the rigid body.  Please see the document by David Baraff  “An Introduction to Physically Based Modeling: rigid Body Simulation I—Unconstrained Rigid Body Dynamics” (Baraff I) for information about how to store the state of your rigid body and updating those state variables.

In order to solve the ODE we will use two different methods.  Write your ODE solver as a black box, as suggested by Baraff, so that you can easily use two different methods.  Initially, use a midpoint method (see Witkin and Baraff, “Differential Equation Basics”).  Then use the Newmark method (this method will be discussed in class and references will be provided).  Both methods will need to be tested, so consider using a GUI to start your simulation and set various variables (like time step, ODE method and coefficient of restitution, etc.)

In order to deal with collisions, after each time step you will need to evaluate if the mesh has collided with the floor.  If it has, you need to approximate the time of collision (you may test for the collision time using bisection – see Baraff’s  “An Introduction to Physically Based Modeling: rigid Body Simulation II—Nonpenetration Constraints” (Baraff II)).  Since we have a very simple world model, collision detection should be very easy (i.e. just testing the values of your mesh for any vertex value of y < 0).  You will need to detect the point or points of collision.  Next you will need to compute collision response (impulse response).  Use the method discussed in Baraff II (pgs D40-D49).  You will need to compute the response for each collision point individually (thus if an entire face of the block contacts all at once, the order in which you handle the vertices will alter the simulation).  Use the method discussed in Baraff II to keep the floor “fixed” in position (pg. D49).  Use a decaying coefficient of restitution in order to change the amount of “bounce” to your object (i.e., start out with a rather bouncy response, say e = .75 and for each bounce reduce its value by .1 – you should experiment with this (Baraff II, pg. D44)).    You do not need to compute resting contact, however, as the amount of bounce changes, your object should slowly oscillate only a small amount (i.e. appear to wiggle a bit above the floor).

The assignment is worth 100 points total, with 75 points for a working simulations with the midpoint method and 25 points for a working solution with the Newemark method.

 

References:

Witkin and Baraff, Differential Equation Basics

 

David Baraff, An Introduction to Physically Based Modeling: rigid Body Simulation I—Unconstrained Rigid Body Dynamics

 

David Baraff, An Introduction to Physically Based Modeling: rigid Body Simulation II—Nonpenetration Constraints