Page 139 - Computer Graphics Handout
P. 139
Thus, we get the expected result but with fewer operations. If we consider a sequence of rotations about the coordinate axes that
in matrix form yields the matrix R = Rx(θx)Ry(θy)Rz(θz), we instead can use the product of the corresponding quaternions
to form rxryrz . Returning to the rotation about an arbitrary axis, in Section 3.10.4, we derived a matrix of the form
Because of the translations at the beginning and end, we cannot use quaternions for the entire
operation. We can, however, recognize that the elements of p_ = rpr−1 can be used to find
the elements of the homogeneous coordinate rotation matrix embedded in M. Thus, if again
This matrix can be made to look more familiar if we use the trigonometric identities
Thus, we can use quaternion products to form r and then form the rotation part of M by matching terms between R and r. We then
use our normal transformation operations to add in the effect of the two translations.
Alternately, we can use the vec4 type to create quaternions either in the application (Exercise 3.26) or in the shaders (Exercise 3.30).
In either case, we can carry out the rotation directly without converting back to a rotation matrix. In addition to the efficiency of
using quaternions instead of rotation matrices, quaternions can be interpolated to obtain smooth sequences of rotations for
animation.
3.15 Curve Generation and Interpolation
Curve generation is a fundamental topic in computer graphics, as curves are widely used to represent object boundaries, motion
paths, and smooth shapes. Interpolation techniques allow smooth transitions between control points and enable accurate modeling
139

