I am currently exploring methods to apply incremental rotations to a dynamically changing orientation without using slerp.
Specifics:
In a 3D space, I have an object with quaternion Q
describing its orientation. As the object rotates, it receives updates from a server indicating the correct orientation at different time points – for example, at t1
, the orientation was Q1
and should be corrected to K1
.
Replacing Q1
with K1
directly leads to a non-smooth visual transition. Instead, I aim to gradually correct from Q1
to K1
over 10 steps without using slerp due to the dynamic nature of Q1
. This involves deriving an incremental correction termed dK
until the next server update is received.
The current method to derive dK
consists of:
delK = K1 * Q1.conjugate()
dk = delK / 10
At step 2, delK
is converted into an axis+angle representation, the angle is divided by 10, and then converted back to a quaternion.
Question 1: Is the aforementioned approach mathematically sound?
Question 2: Instances have been observed where dk
is not a minor correction and may rotate in the opposite direction. What could be causing this anomaly?
This pertains to client-side prediction implementation in JavaScript utilizing incheon.