PDA

View Full Version : Center Of Mass Rigid Body



glnoob_andre
02-09-2012, 05:22 AM
Does anyone know how to calculate the center of mass of a given rigid body. I need the center of mass for collision detection. I have a set of rigid bodies with the same vertices in body space but change in world space.

BionicBytes
02-09-2012, 10:09 AM
Most physics engine APIs have methods for this kind of thing. Which one are you using?

glnoob_andre
02-09-2012, 10:32 AM
Am trying to do it on my own, am not using any engine. Just a vector and matrix class with OpenGL

Alfonse Reinheart
02-09-2012, 12:21 PM
OpenGL isn't going to help you with this task. It's between you and your representation of a model.

Ludde
02-09-2012, 02:16 PM
http://www.multires.caltech.edu/teaching...rtich96fast.pdf (http://www.multires.caltech.edu/teaching/courses/cs101.3.spring02/cs101_files/resources/mirtich96fast.pdf)

BionicBytes
02-09-2012, 02:49 PM
I had a quick look through the reference paper given above. All I can say is "good luck with that".
If you can make head or tail from that lot figuring out how to make an OpenGl engine must be trivial ;-)

Ludde
02-10-2012, 02:13 AM
You could look at an implementation directly:
http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html