Re: Geometrical Quaternions



On 31 août, 06:16, "Jacky" <j...@xxxxxxxxxx> wrote:
Hello,
I am a programmer and had no experience in university math before.
I have been working on a Direct3D Project, hence there is a need to learn a
little bit of it...
Let's say I had two keyframes with querternions as
a) 1.0f, 1.0f, 1.0f, 1.0f (Just trial :)
b) 2.0f, 2.0f, 2.0f, 2.0f (Just trial :)
when I interpolate between these 2 quats, I got an uncontrollable animation.
What values should I set in order to look animating properly....
Do those values look strange that make the animation go crazy???

I also had these lines,
float Aspect = (float)d3dpp.BackBufferWidth /
(float)d3dpp.BackBufferHeight;
D3DXMATRIX matProjection;
D3DXMatrixPerspectiveFovLH(&matProjection, D3DX_PI/4.0f, Aspect, 1.0f,
10000.0f);
pD3DDevice->SetTransform(D3DTS_PROJECTION, &matProjection);

Thanks
Jack

A quaternion can represent a rotation (and therefore also an
orientation) in 3d, but only if it's a unit quaternion, ie for
q=(w,x,y,z) you must have w^2 + x^2 + y^2 + z^2 = 1. Clearly in your
examples, a) is unit, but not b). You should make it a unit quat by
dividing it by it's norm.

.