Advertisement

How do I identity left turns with right turns

Started by October 09, 2017 12:52 AM
1 comment, last by Promit 7 years, 3 months ago

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

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.

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement