Jump to content
  • Advertisement
Sign in to follow this  
SeeMe

Quaternions - trying to understand.

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

Hello I have some understanding problem concerning quaternion.

Everything is working properly, but i have questions for which I can't find answer :

In order to have my world object rotate in a correct way, I need to invert their quaternion rotation while refreshing the object world matrix.

Basicaly, the object are rotation.

I create the object rotation with this code :
Rotation = Quaternion.RotationMatrix(Matrix.LookAtRH(Position, Position + new Vector3(_moveDirection.X, 0, _moveDirection.Y), Vector3.Up));

and refresh the object World matrix like this :
Object.World = Matrix.RotationQuaternion(Rotation) * Matrix.Translation(Position);


This is not working, it makes the object rotate in the opposite way compared to what it should !
The is the way that makes my object rotate correctly :

Object.World = Matrix.RotationQuaternion(Quaternion.invert(Rotation)) * Matrix.Translation(Position);


Why do I have to invert the object rotation ??

Share this post


Link to post
Share on other sites
Advertisement
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!