07.01.2013 Views

3D graphics eBook - Course Materials Repository

3D graphics eBook - Course Materials Repository

3D graphics eBook - Course Materials Repository

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Quaternions and spatial rotation 131<br />

Describing rotations with quaternions<br />

Let (w,x,y,z) be the coordinates of a rotation by around the axis as previously described. Define the quaternion<br />

where is a unit vector. Let also be an ordinary vector in 3 dimensional space, considered as a quaternion with a<br />

real coordinate equal to zero. Then it can be shown (see next section) that the quaternion product<br />

yields the vector upon rotation of the original vector by an angle around the axis . The rotation is<br />

clockwise if our line of sight points in the direction pointed by . This operation is known as conjugation by q.<br />

It follows that quaternion multiplication is composition of rotations, for if p and q are quaternions representing<br />

rotations, then rotation (conjugation) by pq is<br />

which is the same as rotating (conjugating) by q and then by p.<br />

,<br />

The quaternion inverse of a rotation is the opposite rotation, since . The square of a quaternion<br />

rotation is a rotation by twice the angle around the same axis. More generally q n is a rotation by n times the angle<br />

around the same axis as q. This can be extended to arbitrary real n, allowing for smooth interpolation between spatial<br />

orientations; see Slerp.<br />

Proof of the quaternion rotation identity<br />

Let be a unit vector (the rotation axis) and let . Our goal is to show that<br />

yields the vector rotated by an angle around the axis . Expanding out, we have<br />

where and are the components of perpendicular and parallel to respectively. This is the formula of a<br />

rotation by around the axis.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!