Sign in to follow this  

Rotation around changing arbitrary points

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