computing the inertia tensor for...

Started by
4 comments, last by GameDev.net 18 years, 9 months ago
I need to know how to compute the inertia tensor (3D) for an ellipsoid, tetrahedron, pyramid, and cone. source code would be appreciated.
Advertisement
looking at the formula for a spheres inertia, I assume this will work for an ellipsoid...
Matrix inertia();inertia._11 = 0.4f * mass * radius.y * radius.z;inertia._22 = 0.4f * mass * radius.x * radius.z;inertia._33 = 0.4f * mass * radius.x * radius.y;

...is this correct?
This(scroll down), this, this. I think that's all the shapes you need, if not google for "moment inertia <shape>". Place the values of those formulas on the diagonal of the inertia tensor.

If you need other shapes, you can calculate the moment of inertia yourself, there's a good description how to do it for arbitrary shapes in "Game Physics" by Eberly.
thanks ...now I only need the formula for the moment of inertia of a square pyramid.
pyramid: Iz = 0.1 * m * a²
cone: Ix = 0.3 * m * r²
Iz = 0.15 * m * (r² + 0.25 * h²)
moment of inertia for general rotational bodies:

Ix = 0.5 * d * PI * INTEGRAL(r^4 dx)

where d = density and
r = the funtion that defines the shape when you cut it along its rotation axis

This topic is closed to new replies.

Advertisement