Rotation around changing arbitrary points

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

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 on other sites
i solved it.
just forgot to multiply my arbitrary point with the current view matrix... my fault.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• Forum Statistics

• Total Topics
634134
• Total Posts
3015751
×