3 ms·
Slerp is no binary operator, but suppose we only look at the two quaternions, then it is "commutative". You can swap both quaternions, but you must use (1-t) fo
by xaedes 4y ago
Slerp is no binary operator, but suppose we only look at the two quaternions, then it is "commutative". You can swap both quaternions, but you must use (1-t) for the interpolation factor instead of just t.
Wikipedia[1] lists some equivalent formulas for quaternion slerp:
slerp(q0, q1, t) = (q0 * q1^(-1))^(1-t) * q1
slerp(q0, q1, t) = (q1 * q0^(-1))^t * q0
There you can see that quaternion products are used, yes, but the operation is also commutative, when using (1-t) instead of t.
When the order in online average computation is different, the t naturally adapts to the correct value, depending on the weights.
These arguments about commutativity and order are really just the same as for regular linear interpolation (LERP) and online average computation.
[1] https://en.wikipedia.org/wiki/Slerp#Quaternion_Slerp https://en.wikipedia.org/wiki/Slerp#Quaternion_Slerp
- chombier 4y agoYes, SLERP is commutative along one-parameter subgroups by definition. The problem arises as soon as more than two quaternions are to be averaged using the above procedure. Again, using 3 quaternions and uniform weights with the above algorithm gives slerp(slerp(a, b, 1/2), c, 1/3) but medians in a spherical triangle don't cross at 2:1 ratio in general.
- xaedes 4y agoHm yes. I also played with a few a examples. I have to admit, the order seems to only be really irrelevant when averaging rotations around one axis to avoid triangles. Thanks for pointing out. For averaging rotations that are similar the differences are tiny, but still. What a bummer.