# Physics Simulation Forum

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Calculating inertia from a support functionPosted: Sat Jul 23, 2011 12:24 am

Joined: Sat Jul 23, 2011 12:20 am
Posts: 1
Hello folks!

I'm hoping someone here can answer a physics question for me.

Is it possible to compute an inertia tensor for any arbitrary body, using just a GJK support function?
And on that note, is this even a good idea or should I not bother? It'd save a lot of code and special cases if it were doable.

Top

 Post subject: Re: Calculating inertia from a support functionPosted: Wed Jul 27, 2011 12:08 am

Joined: Tue Nov 06, 2007 8:52 am
Posts: 5
Using only a convex's support function, you can get a nice sampling of the surface, but using the extreme points directly would result in a biased inertia tensor that would be worse than a box-based approximation in many cases. Technically, you could create a convex hull from the surface points and compute the inertia tensor for that hull. There may be some fancy/non-expensive method of interpreting the surface points that I'm not aware of.

One alternative is to create a grid of mass points and test them for containment within the convex shape using your favorite containment algorithm (MPR or GJK are easy to adapt for this purpose). Those mass points then contribute to the inertia tensor.

Another conceptually similar approach is to raycast in a 2d grid from the +X and -X direction and get the hit times. You can compute an inertia tensor based on the hit coming from the +X direction and the hit coming from the -X direction. Quantizing the interval into mass points would be easy. Another option is to consider the row to be a rectangular prism and compute the whole inertia tensor based on a bunch of such offset box inertia tensors.

The accuracy of numerical integration methods are subject to the amount of samples you take, so they're only really worth it for the shapes that don't have straightforward inertia tensors. I use similar approaches for minkowski sums and wrapped shapes (shrink wrap over multiple convexes).

Top

 Post subject: Re: Calculating inertia from a support functionPosted: Tue Aug 02, 2011 6:12 pm

Joined: Sat Dec 30, 2006 8:19 pm
Posts: 4
I recently implemented a version which works very well for me. The support map function is used to build a triangle mesh. And the triangle mesh is then used to get the inertia.

Have a look here: http://code.google.com/p/jitterphysics/ ... s/Shape.cs

MakeHull() and CalculateMassInertia() are the functions of interest. In all my test cases the inertia was nearly the same as the analytical value. The problem is that Iam not sure about "convergence/correctness" of the Hull making function. I recently (5min ago) contacted the original author of this function to get more information. The CalculateMassInertia function is then just a simple method based on an idea descriped here: www.number-none.com/blow/inertia/bb_inertia.doc (yeah, *.doc format!)

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities