Jump to content
  • Advertisement
Sign in to follow this  

How do I identity left turns with right turns

Recommended Posts

const D3DXQUATERNION& q = l_transform->getRotation();

FLOAT angle;
D3DXQuaternionToAxisAngle(&q, &axis, &angle);

Every time this function is called, the angle is positive...

I am wrong, sorry, I got some problems of the truck always turning right (the cab of the truck)

Jack Edited by lucky6969b

Share this post

Link to post
Share on other sites

Make the angle negative? If you're trying to figure out the direction the truck is turning by using QuaternionToAxisAngle, that's not really a good idea. What you can do is limit the angle to 180 degrees or PI radians, and subtract 360 or 2*PI from it if it comes up higher.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!