is it possible to do non-linear rotation interpolation (using Slerp)?

I have a model rotating between two rotations using Quaternion.slerp, and it works just fine. THe problem is, the model is a person and the movement looks a little robotic. I was wondering if it’s possible to use Slerp in some way that the rotation isn’t linear, i.e., perhaps it is slower at the beginning and end and faster in the middle?

Thanks :slight_smile:

Slerp is the short from of “spherical linear interpolation”. That means the interpolation itself will be linear. However you can use a non linear t value to drive the slerp. If you move the t value linearly from 0 to 1 it will be a linear movement / rotation.

You can use a Hermit curve for example.

//C#
float Hermit(float t)
{
    return 3*t*t - 2*t*t*t;
}

// Where ever you use Slerp
rotation = Quaternion.Slerp(from, to, Hermit(t));

Take a look on my blog at the SmoothQuaternion - it allows a couple of modes like smooth and damp.

edit
Link replaced with archived link since the blog / domain does no longer exist.