Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 garrus   Members   -  Reputation: 113

Like
0Likes
Like

Posted 17 February 2013 - 01:12 PM

Hello.

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, 17 February 2013 - 01:14 PM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS