Unusual behavior for Quat.slerp

I’m seeing that the ‘alpha’ value for Quat.slerp seems to be interpreted incorrectly.

I’m not doing anything tricky in my Update function:

        this.time += dt;
        var a = (this.time / this.duration);
        rot.slerp(this.initialRotation,this.finalRotation,a);
        this.cameraEntity.setRotation(rot);

However, the full rotation is achieved when my alpha input (‘a’) is only at 0.2. I am having to scale my input by 1/5 in order to make it work correctly over the intended duration.

        var a = (this.time / this.duration) / 5;

It means that either your initial or final rotation values are not correct. You want to double check that those are correct, e.g. create some scaled box, that looks like a stick and rotate it first to initial rotation, then to final - make sure those values are correct, before lerping.

Well, those quats were coming directly from a pair of reference cameras. So, I’m pretty sure the input rotations were correct. However, I’ve only worked with one programmer who claimed to be able to work out quaternion math (and it wasn’t me), so I can’t be 100% sure.

And, once I did the 1/5 scale, everything worked right. It’s odd. Again, I don’t know the underlying quaternion math, so that’s why I came to the forums.

Would it be possible to create a project that reproduces the issue?