Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is good, thanks. But a much more interesting problem I haven't seen a good writeup for is how to interpolate smoothly between quaternions at different times. Quaternion slerp has jerks (C_0 but not C_1 or C_2) at the keyframes.


Ken Shoemake’s 1985 Siggraph paper “Animation Rotation with Quaternion Curves”, that brought quaternions to computer graphics, covered this. The idea is to use quaternions as control points in a spline the same way you would use 3d points in a spline. You could have a series of quaternion orientations, and connect them with C_2 continuity by using a connected series of piecewise cubic Bezier splines.

The abstract mentions it: “This paper gives one answer by presenting a new kind of spline curve, created on a sphere, suitable for smoothly in-hetweening (i.e. interpolating) sequences of arbitrary rotations.” And the final punch line is section 4.3, then you can work through the details in the earlier sections.

https://www.cs.cmu.edu/~kiranb/animation/p245-shoemake.pdf


You can use bezier splines (https://ibiblio.org/e-notes/Splines/bezier.html). These just use linear interpolation, multiple times. In the case of quaternions replace the linear interpolations with quaternion slerps and you get quadratic bezier splines over orientations.


I've used "A General Construction Scheme for Unit Quaternion Curveswith Simple High Order Derivatives" in the past, and while not perfect it was generally good enough and fairly easy to implement.

Basically it extends Hermite splines to Quaternion splines using the Lie group operations.


It's been a while for me, but iirc, there's two ways you can slerp between two quaternions, and by using the shortest path, you can avoid the jerk.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: