Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Jul 23, 2011 12:24 am 
Offline

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
 Profile  
 
PostPosted: Wed Jul 27, 2011 12:08 am 
Offline

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
 Profile  
 
PostPosted: Tue Aug 02, 2011 6:12 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group