# OK, then simple question about Quats

How can I create simpe animation, knife movement for example.
Firstly, I translate it to needed position, rotate it with 3quats, then I calculate how the end position should look like 1 trans +3 quats. Finally, I calculate difference final trans/quat-start trans/quat and every frame call trans/quat+diff*t
Is that right?

animating along a path… or just simple linear or…?

Preferably non-linear, it’s called Cubic interploration, yes?

why 3 quats? you should only need one. If you have a start orientation matrix and an end orientation matrix, convert them to quats, then you can interpolate from one to another, linearly or non linearly.

btw, some quaternion interpolation code

bool Vector::Interpolate(const Vector& V0, const Vector& V1, float Fraction)
{
float OneMinusFraction = 1.0f - Fraction;
x = OneMinusFraction * V0.x + Fraction * V1.x;
y = OneMinusFraction * V0.y + Fraction * V1.y;
z = OneMinusFraction * V0.z + Fraction * V1.z;
}

bool Quaternion::Interpolate(const Quaternion &Quat1,const Quaternion &Quat2,float Fraction)
{
//--------------------------------------------------------------------------------
// There are two quaternions for each orientation, this will cause problems if we don’t
// eliminate one (i.e. zero crossover problem), so see if quaternions are on opposite sides of a
// 4 dimensional hypersphere (the degenerate case) and if so, flip one to the otherside (same
// orientation but now no zero crossover problem)
//--------------------------------------------------------------------------------
Quaternion NormQuat2 = Quat2; //Used to get rid of degenerate case

if ((Quat1.DotProduct(NormQuat2)) < 0.0f)
NormQuat2 *= -1.0f; //See comment above

//--------------------------------------------------------------------------------
// The degenerate case has been removed, can now interpolate normally
//--------------------------------------------------------------------------------
V.Interpolate(Quat1.V, NormQuat2.V, Fraction);

R = Quat1.R * Fraction;
R += NormQuat2.R * (1.0f - Fraction);

return Normalise();
}