Jump to content
  • Advertisement
Sign in to follow this  
newbie_programmer

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!