Jump to content
  • Advertisement
Sign in to follow this  

Rotate around object's local axes

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

I'm writing a C++ class that will manage an objects position and rotation in 3D space but I'm having trouble with rotations. Instead of rotating around itself as I want it's rotating around the world axes... I hope any of that makes sense..

This is what I have so far. m_Up and m_Forward are 2 vectors describing which way is which.
void RotateAbs(float degree, float x, float y, float z)
Matrix44f Rotation;
RotateMatrix44(Rotation, DegToRad(degree), x, y, z);

m_Up[0] = Rotation[1];
m_Up[1] = Rotation[5];
m_Up[2] = Rotation[9];

m_Forward[0] = Rotation[2];
m_Forward[1] = Rotation[6];
m_Forward[2] = Rotation[10];

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!