Jump to content
  • Advertisement
Sign in to follow this  

physics novice question: how to compute inertia tensor?

This topic is 4774 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
Advertisement
Some general solutions work on polyhedrons (sphere, box, etc., have simple formulas).

http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html (includes C source).
http://citeseer.ist.psu.edu/mirtich96fast.html (original paper).
http://www.geometrictools.com/Physics.html (Wm3PolyhedralMassProperties.cpp).
http://number-none.com/blow/inertia/bb_inertia.doc

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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!