Slerp question.

Hi, I understand that Slerp accelerates and decelerates at the beginning and end. I’m just wondering what rate that happens. Is it based on some fraction of the curve between two points?

No, it does not. It linearly interpolates beween two points along the surface of a sphere.

Here is a good article on lerping in general.

Not sure what that URL is (non-English page), but I think you intended to paste https://chicounity3d.wordpress.com/2014/05/23/how-to-lerp-like-a-pro/

1 Like

Indeed, something funky happened there.

Quaternion.Slerp does a spherical interpolation from the “Start” angle to “End” angle. so the rotation is smooth and consistent regardless where the start and end angles are.

Quaternion.Lerp basically creates a focal point that interpolates from the Quaternion’s “start” forward to its “end” forward. then it constrains the Quaternion to look at that focal point as it interpolates. this rotation can be whip-lashy for large angles because the focal point will pass closer by the point of rotation.

if you were to graph the rotation speeds between the two over time, Slerp would be a flat line since its constant. Lerp would look like two quarter-pipes set back-to-back. slow at the start and end but speed peaks in the middle, with the curve getting more exaggerated for larger angles

1 Like