Jump to content
  • Advertisement
Sign in to follow this  
kert

Rotation around changing arbitrary points

This topic is 3733 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

hey all, i am trying to rotate objects not just around their center but around arbitrary points which i got to work as far as i don't rotate my object before selecting another arbitrary point. this is what i do at the moment: // MyViewMatrix is: double MyViewMatrix[16]; // rotPoint is my arbitrary point: double rotPoint[3]; // translate from arbitrary point to origin translate(MyViewMatrix, -rotPoint); // rotate around X rotateX(MyViewMatrix, FURADIANT(rx)); // rotate around Y rotateY(MyViewMatrix, FURADIANT(ry)); // rotate around Z rotateZ(MyViewMatrix, FURADIANT(rz)); // retranslate back to my arbitrary point translate(MyViewMatrix, rotPoint); it works when MyViewMatrix wasn't manipulated through a rotation around another point (e.g. center) before i choose a new arbitrary point. how am i able to consider the rotations i already did? i know that roations aren't commutative so the order matters... i hope anyone can help me! :) thx in advance.

Share this post


Link to post
Share on other sites
Advertisement
i solved it.
just forgot to multiply my arbitrary point with the current view matrix... my fault.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!