How to get the centroid of a convex polyhedron?
-
- Posts: 8
- Joined: Wed Sep 05, 2012 7:03 pm
How to get the centroid of a convex polyhedron?
The Class btConvexHullComputer can generate faces of a given set of vertices of a convex-hull in 3D. Is there any implementation in Bullet 2.81 to compute the centroid (center of mass) of the corresponding convex polyhedron (i.e., the convexhull shape computed by btConvexHullComputer)?
Last edited by Rasoul on Tue Oct 01, 2013 3:54 pm, edited 2 times in total.
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: How to get centroid of a convex polyhedron?
Just add all vertices and divide by the number.
-
- Posts: 8
- Joined: Wed Sep 05, 2012 7:03 pm
Re: How to get centroid of a convex polyhedron?
That's the average of vertices, I'm looking for the center of mass of the convex polyhedron assuming that the mass distribution is uniform.Dirk Gregorius wrote:Just add all vertices and divide by the number.
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: How to get the centroid of a convex polyhedron?
Right, sorry! There are a bunch of publications on this and I bet Bullet has an implementation of the either Mirtich's or Eberly's method. Look where it computes the inertia tensor since this also computes the mass center. If not you need to implement this yourself here are some references:
Mirtich: http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html
Eberly: http://www.geometrictools.com/Documenta ... erties.pdf
Personally I use this method:
Kallay: http://www.tandfonline.com/doi/abs/10.1 ... kr1ZoakqGc
HTH,
-Dirk
Mirtich: http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html
Eberly: http://www.geometrictools.com/Documenta ... erties.pdf
Personally I use this method:
Kallay: http://www.tandfonline.com/doi/abs/10.1 ... kr1ZoakqGc
HTH,
-Dirk
-
- Posts: 8
- Joined: Wed Sep 05, 2012 7:03 pm
Re: How to get the centroid of a convex polyhedron?
Thanks for the references, in the worst case I have to implement one of the known algorithms by myself.Dirk Gregorius wrote: Mirtich: http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html
Eberly: http://www.geometrictools.com/Documenta ... erties.pdf
Kallay: http://www.tandfonline.com/doi/abs/10.1 ... kr1ZoakqGc