Computer Graphics Final Project

Joseph Cooper
Fall 2008

For this project, I constructed an interactive physics simulation. Using the ODE physics engine to do the bulk of the simulation, I added the following features:

This video, demonstrating the various features, is submitted as the artifact:

I attempted to add a narration, but couldn't do it without sounding like an idiot. Fortunately, I think you can figure out most of what is happening by yourself.

In the first scene, the blue objects are connected by 1D hinge joints, the yellow objects are connected by 2D universal joints, and the red objects are connected by 3D ball-and-socket joints.

I use two markers on a motion captured glove to create a ray that I intersect with the simulated objects. I turn the grabbing on and off by covering or revealing a third marker. While an object is "grabbed", it can violate constraints that wouldn't normally be allowed. Once released, the simulation tries to return to a valid state. That's why after the box is released while embedded in the ground, it launches into the air.

Creating complex objects out of multiple simple objects is actually rather tricky. It involves transforming and summing the inertia tensors of the independent pieces to form a new body and then removing the old bodies from the simulation.

I reference the following libraries:

Credits

I referred to several examples provided with ODE and loosely based my use of the selection buffer on Nehe Lesson 32. My quaternion-based camera is also inspired by the Nehe Quaternion Camera lesson. Pieces of the motion capture code were taken from examples provided by Phasespace.

Source

Here are the source files I created. I started out being very careful to use good coding practices and maintain loose coupling between objects. However, as time drew short, most of the variables became public and the objects became tightly interwoven. Poor code notwithstanding, the end effect is still cool.