Graphics Reference
In-Depth Information
Example 2
1
2
Now let's rotate the same point about the axis
i
+
j :
cos 90 +
j 0
2 j cos 90
j
sin 90
2
sin 90
2
qv
¯
q
=
i
+
+
i
+
i
+
0
j 0
2 j 0
j
1
2
1
2
qv
q
¯
=
+
i
+
+
i
+
i
+
2 k 0
j
1
2
3
1
2
qv
¯
q
=
i
+
1
2 i
1
2 j
3
2 i
3
2 j
qv
¯
q
=−
+
qv
q
¯
=−
2 i
j
which is also correct, as seen from Fig. 7.7, which, for clarity, only shows the x- and y-axes.
Y
(1,2,0)
(- i + j )
v
X
(-2,-1,0)
Figure 7.7.
7.10 Representing a quaternion as a matrix
Matrices play an important role in computer graphics, especially in representing transforms to
manipulate objects and the virtual camera. Yaw, roll, and pitch matrices exist that rotate points
about the three Cartesian axes and can be combined to create a single matrix, but, as mentioned
above, can give rise to gimbal lock. Let us now derive a single matrix that will rotate a point an
arbitrary axis without the problems of gimbal lock.
We begin by defining a quaternion q and its conjugate
q:
¯
q
=
s
+
q
=
s
+
x i
+
y j
+
z k
¯
q
=
s
q
=
s
x i
y j
z k
 
Search WWH ::




Custom Search