I would like to apply critically damped spring smoothing method to smooth movement on the unit sphere to a desired orientation. I have two quaternions, one that represent current orientation and one that represents the target orientation. Somehow I'm convinced that there is a way to smooth the "quaternion" movement using critically damped spring. Is there?
Asked
Active
Viewed 793 times
1 Answers
1
I would approach this by using spherical linear interpolation and dampening $t$ during each iteration as it changes from 0 (the starting orientation) to 1 (the target orientation). Using the total angular distance and desired angular velocity you can get the $t$ velocity.
In terms of pseudo code, it would look something like this I think
// startQ
// endQ
angDist = startQ.angularDistance(endQ)
tVel = desiredAngVel / angDist
t = 0
while(t < 1) {
// Args- target t, current t, &t velocity
// Returns new t
// The function internally will also need a timestep and damping factor
t = criticallyDampedSpring(1, t, &tVel)
Quaternion currentQ = startQ.slerp(t, endQ)
}
Linville
- 113
-
The issue here is that both source and dest quaternion should be known. – Heisenbug Feb 20 '18 at 11:20