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\$

2 Answers 2

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\$
2
  • 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, 2016 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, 2016 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .