quaternions: what is w for

Started by
1 comment, last by Axiverse 20 years ago
in a 3d area do you use w? or is it for 4d, and if so do i leave w at 0?
Advertisement
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.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
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;}

Everything is better with Metal.

This topic is closed to new replies.

Advertisement