# Center of Gravity

This topic is 4848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

HI Everyone, I have been having problems with my rotation of skinned character meshes in my game. The problem is tht when i rotate the character it rotates with respect to some axis tht is not the center of gravity. hence there is a lot of translation as well as rotation. I found from a book a formula to find the center of gravity using the position of each vertice multiplying with the units mass adding all these up and dividing with the total mass. but the problem is tht i donot knw how to access the vertices. Also how to rotate the character with respect to this new axis. Now i just give the character some rotation in y-axis. I hope I have made the problem clear. Please help me out. I am really stuck.

##### Share on other sites
Unless you have a specific need to rotate around the center of gravity, I would just pick an appropriate point relative to the model and rotate around that.

To rotate a model around a point, you translate the point to the origin, rotate the model, and then translate the point back. (In OpenGL, you translate the origin to the point, then rotate the coordinate system, then reverse the translation.)

##### Share on other sites
http://www.cs.berkeley.edu/~jfc/mirtich/papers/volInt.ps

##### Share on other sites
Quote:
 http://www.cs.berkeley.edu/~jfc/mirtich/papers/volInt.ps
I could be wrong, but I doubt the OP needs a generic mass properties algorithm such as Mirtich's. As John suggested, it sounds more like a simple geometry or order of operations problem.

@the OP: For more specific help, you might tell us what API you're using, and post the bit of code that sets up the transformation for your object.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 11
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633721
• Total Posts
3013532
×