Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

How do I identity left turns with right turns

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


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

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




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

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

Thanks
Jack Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

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
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!