[ODE] Possible solution to unstable rotating bodies problem

Tyler Streeter tylerstreeter at gmail.com
Thu Apr 21 22:15:03 MST 2005

> > Excellent Tyler.  As you know, concern has been expressed on this list as to
> > what performance penalty, if any, just such a scheme may exact.  Are you set
> > up to do some performance comparisons with/without this mechanism?
> >
> > --
> > Gary R. Van Sickle
> I will run some tests and report back within the next few days.
> Tyler

I ran some tests tonight on an OPAL app, and the results look pretty
good.  I set up arrays of long boxes (2x2x10 units, 0.5 density) and
gave them a high initial torque (vector = <10000, 0, 0>, applied for
0.5 seconds) with no linear or angular damping.  Here's a screenshot
to give you an idea:


Everything else was held constant.  I directed the camera away from
all objects when taking measurements to make sure the framerates
weren't affected by graphics (a better way would be to run a
simulation with no graphics at all, but this should be equivalent). 
Here are the resulting framerates (labeled 'no spin fix' and 'spin
fix', representing OPAL without the aforementioned stability fix and
with the fix, respectively):

64 spinning objects
no spin fix: 555.1 fps
spin fix: 554.5 fps

256 spinning objects
no spin fix: 206.1 fps
spin fix: 202.4 fps

1024 spinning objects
no spin fix: 23.9 fps
spin fix: 22.5 fps

The simulation with the stability fix runs just barely slower than the
simulation without the fix.  Note that under normal conditions there
won't be that many objects freely spinning in midair, so it won't be
much of an issue.  Also, OPAL caches a boolean for each object that
says whether its inertia tensor is non-symmetric, so spheres, perfect
cubes, etc. don't even run this algorithm.

To demonstrate the increased stability, I posted a win32 OPAL executable here:


When running this executable, use the arrow keys to move the camera,
and click and drag w/ the left mouse button to move objects.  There is
a lot of energy in the system, so if you barely drag an object and it
hits another one, it can start a chain reaction and sending things
flying; however, notice that they never become unstable.  The
spring-based picking system sometimes adds too much energy to objects
(because of imperfect spring and damping constants), so objects might
become unstable while being dragged, but this is unrelated to the
stability fix.


More information about the ODE mailing list