20
/23
Care with quaternion negation
\(+q\) and \(-q\) correspond to the same rotation (\(n\to-n\), \(\theta\to 2\pi-\theta)\)
Warning \(-q\)
does not
corresponds to the rotation matrix \(-R\).
But to a
different path
when interpolated in the 4D quaternion space.
\(\Rightarrow\) path \(q_1 \to -q_2\) is shorter than \(q_1 \to q_2\) when \(q_1\cdot q_2<0\).
In practice we check for the shorter path before applying SLERP.
Algorithm
if
(
dot
(
q1
,
q2
)
<
0
)
q2
=
-
q2
q
(
t
)
=
SLERP
(
q1
,
q2
,
t
)
Cannot play video assets/shortest_path.mp4