quaternions: what is w for
Nope, you use all 4. In general a quaternion is an extension of complex numbers, you have 1 real component and 3 imaginary components. When used for rotations I think the closest way of visualizing it is the imaginary components make up a 3d vector that is a representation of the axis of rotation and the real component represents the angle rotated around the axis.
Someone who knows more about quaternion rotations should be able to tell you more about how to convert from axis-angle rotations to quaternion rotations, it might give you a better idea of how they work.
Someone who knows more about quaternion rotations should be able to tell you more about how to convert from axis-angle rotations to quaternion rotations, it might give you a better idea of how they work.
w is something like the cos of half of the angle, while x, y, z represents the axis, times the sin of half of the angle.
Quaternion& Quaternion::FromRotation(const Vector& NormalisedAxis, float fAngle){ float a = fAngle * 0.5f; float si = sin(a); float co = cos(a); x = NormalisedAxis.x * si; y = NormalisedAxis.y * si; z = NormalisedAxis.z * si; w = co; return *this;}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement