• Advertisement
Sign in to follow this  

rotation around left,up vector messed up (C++,openGL)

This topic is 1800 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 am implementing rotation around the up,left vectors of an object in the following way, which for some reason works only individually.
That is, i can rotate perfectly fine around up but after that, if i try rotation around left everything gets messed up.

Same if i rotate around left vector,and then try rotating around up.


Could you tell me if the following general method is correct?


vectors up,left,forward, float arrays with x,y,z components.

For example, if i want to rotate at an angle ANG, around UP (turn left/right).


1. I get the angles of the UP vector from XZ plane and the YZ plane.

    Rotating the UP with these angles around the proper axes would align it with the Z axis.

2. I perform these rotations to all the vectors except UP.

3. I perfom the desired rotation with ANG, around Z.

4. I perform the opposite rotations in (2)  (again,all vectors but UP),so only the desired rotation "remains".


I could just use glRotate to visualize the rotations, but i want the forward,etc vectors as information to where the object is looking at.

Thanks in advance.


(this forum looks awesome smile.png)

Edited by garrus

Share this post

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

  • Advertisement