1
\$\begingroup\$

I'm using the following code to change the rotation of an object:

Quaternion rot = getRotation();
setRotation(make_quaternion_axis_angle(rot.v,rotationSpeed*dt)*rot)

This code works as expected until a certain angle where it suddenly stops.

Why does it stop?

\$\endgroup\$
1
\$\begingroup\$

I realized why this happens. When the quaternion is made, the axis is multiplied by sinus of the half angle. When the rotation gets to 360 that value will be zero so the axis information will be lost.

\$\endgroup\$
0
\$\begingroup\$

Well given 360-degree angles. Then a 360-degree rotation makes a full turn and as such is equivalent to 0-degrees or simply no rotation.

\$\endgroup\$
  • 1
    \$\begingroup\$ Yes, but shouldn't it keep rotating still? The next time it will be for example 370 degrees, or 10 degrees. \$\endgroup\$ – SiXoS Jan 23 '16 at 11:30
  • \$\begingroup\$ @SiXoS If are rotating by 10 degrees each time, then yes. If you are rotating by 360 degrees each time, then no. I guess I simply misunderstood your question, it is pretty short. I though your were changing the amount you rotated by. \$\endgroup\$ – Christer Jan 23 '16 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.