Advertisement Jump to content
Sign in to follow this  

physics novice question: how to compute inertia tensor?

This topic is 5020 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I very understand the physical description of inertia tensor, but I don't know how to compute this matrix if I use a AABB, Sphere, Cylinder or ConvexHull as the object bound volume. Who can give me some help? Tutorials, demo, source code... THX:)

Share this post

Link to post
Share on other sites
Some general solutions work on polyhedrons (sphere, box, etc., have simple formulas). (includes C source). (original paper). (Wm3PolyhedralMassProperties.cpp).

For game applications, given that most objects are tweaked for behavior, you can:

1. Take the vertices for the mesh object and assign a mass defined by the object's total mass/numVertices, converting them to particles that make up the total mass of the object.
2. Compute the inertia tensor for the newly created particles.
3. This will give an approximation with all the mass defined in particles for the object's "shell".
4. Tweak the inertia tensor creation by scaling the size of the mesh to move the mass distribution inward (e.g scale by 2/3).

Once the inertia tensor is created, you'll have a 3x3 scale matrix. To simplify run-time calculations and promote easy tweaking, you can remove any rotation from the 3x3 scale matrix using Ken Shoemake's decomp_affine() routine or similiar method. Transpose/invert the extracted rotation and apply to the inertia tensor and original object's vertices. Now you can use the diagonal of the inertia tensor and store/trivially-further-tweak as a simple 3-vector (or modify just the diagonal of a scale matrix). The inverse inertia tensor (used at runtime to scale angular momentum) is also easy and fast to compute using the simplified diagonal (3-vector) form (1/ix, 1/iy, 1/iz).

[Edited by - John Schultz on April 26, 2005 1:26:43 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!