Page 1 of 1

Getting world coordinates of vertices of a convex hull body

Posted: Thu Jan 07, 2016 2:44 pm
by Ehsanizadi
Hi,

Does anyone know how to get coordinates of every vertices of a convexHull object?

I have a convex hull object in my scene, and I want to get the coordinates of its all vertices (x,y,z) in every time step.

Thanks
Ehsan

Re: Getting world coordinates of vertices of a convex hull b

Posted: Thu Jan 07, 2016 9:29 pm
by StabInTheDark
Take a look at the GL_ShapeDrawer class it has everything you need.

Re: Getting world coordinates of vertices of a convex hull b

Posted: Fri Jan 08, 2016 11:47 am
by amatic
Should be something like "centerOfMassTransform * point " for each point i.

point is the location of the vertex relative to the center of mass of the object, and centerOfMassTransform is a quaternion representing the translation and rotation of the object at some point in time.

Multiplying a quaternion and a point gives you a translated and rotated point.

Re: Getting world coordinates of vertices of a convex hull b

Posted: Fri Jan 08, 2016 12:48 pm
by Ehsanizadi
amatic wrote:Should be something like "centerOfMassTransform * point " for each point i.

point is the location of the vertex relative to the center of mass of the object, and centerOfMassTransform is a quaternion representing the translation and rotation of the object at some point in time.

Multiplying a quaternion and a point gives you a translated and rotated point.


Thanks.