[ODE] Moment of Inertia

Martin C. Martin martin at metahuman.org
Sat Dec 20 15:42:58 MST 2003


Brian Clarkson wrote:

> Martin
> 
> Unfortunately I'm not that Brian Clarkson. I'm just a very ordinary Brian
> Clarkson.

Ah well, the world's not as small as I thought.  :)

> One more question:
> Do I use the xyx MOIs calculated by the formula or do they need further
> conversion.

Use them straight from the formula.  For example, the web page you 
pointed to says the mass of a sphere is 4/3 * Pi * density * radius^3, 
and the moment of inertia about any axis is 2/5 * mass * radius^2. 
Here's how ODE calculates the mass & MOI of a sphere (from mass.cpp):

void dMassSetSphere (dMass *m, dReal density, dReal radius)
{
   dMassSetZero (m);

   m->mass = (REAL(4.0)/REAL(3.0)) * M_PI * radius*radius*radius * density;

   dReal II = REAL(0.4) * m->mass * radius*radius;
   m->_I(0,0) = II;
   m->_I(1,1) = II;
   m->_I(2,2) = II;
}

See?  It's exactly the same formula.

- Martin




More information about the ODE mailing list