The quaternions that represent rotated 0 degree and 360 degrees about x should be the same or not.
My quaternio representing rotated 0 is (w,x,y,z) = (1.0,0.0,0.0,0.0);
and quaternion representing rotated 360 is
(w,x,y,z) = (-1.0,0.0,0.0,0.0);
Originally posted by zeckensack: Yup, that’s right
Doesn’t quaternion mean “orientation”?
If their orientations are the same, why aren’t their quaternion?
And if I want to make a object turn 360 degrees, the 6 keyframes saving quaternions with rotation 0, 90, 180, 270, 360, 0 will success or not. I mean would there be any problem in interpolation between 360 ad 0.
Originally posted by Gavin: No that is wrong. you are rotating +/- 1 degree about no axis!
If I want to rotate an object about x axis,
I will convert the rotation to quaternion and multiply the quaternion with the current quaternion to get a new quaternion.
Originally posted by piercec: Doesn’t quaternion mean “orientation”?
If their orientations are the same, why aren’t their quaternion?
Well, that’s a bit over my head. Complex number stuff I guess. If you had two rotations, by 0° and by 720°, these would yield the same quats.
And if I want to make a object turn 360 degrees, the 6 keyframes saving quaternions with rotation 0, 90, 180, 270, 360, 0 will success or not. I mean would there be any problem in interpolation between 360 ad 0.
Huge problem with a 360° turn between keyframes. Because of the normalization constraint (ww+xx+yy+zz==1) you don’t have any axis information. IE w will be 1.0 in a 360° rotation, so you can’t represent an axis at the same time, x y z will all be zero. So you just can’t do that with a quaternion.
Of course you need an axis for an interpolated 360° turn. A simple way around this would be to split the animation, say, into two 180° turns.
If you do it in smaller steps anyway, you’re safe
[This message has been edited by zeckensack (edited 04-19-2002).]
[This message has been edited by zeckensack (edited 04-19-2002).]
Originally posted by Gavin: Yeah, fine but… what I was on about is that his x, y, z are 0. As you know this is the axis of rotation. This should be a unit vector.
Right, no axis information. There can’t be any. In a unit quat (the only type of quat useful for representing orientation stuff), the (x y z) part is not a unit vector, the hole thing is normalized. (well, in the specialty case when w==0 it is a unit vector, but most of the time it’s not)
If w==1 then (x y z)==(0 0 0). That’s a problem, I agree. But not a problem in piercec’s code, rather a problem with quats in general.
I only wanted to point out that w is not a rotational angle