Graphics Reference
In-Depth Information
The overall rotation R t is given by
R t
=
R γ R β R α
(2.17)
The total rotation ( R t ) depends on the order in which the rotation Euler angles were applied.
The use of Euler's angles to generate a rotation matrix also suffers from the gimbal lock
problem. For some values of the rotation angles, the degree of freedom becomes lower than
what it should be. For example, when the angle
0, the degree of freedom of the Euler's
rotation decreases from two (the expected) to one as the rotation about the x -axis becomes
equivalent to a rotation about the z -axis (
β =
becomes redundant). Nevertheless, the resulting
rotation matrix remains mathematically correct.
Another way of representing rotation matrices is through the use of unit quaternion rotation,
a representation that is not affected by the disadvantages of using Euler's rotation. The unit
quaternion rotation is equivalent to a rotation of the 3D points by angle
α
or
γ
θ
about unit vector u and
[ xyzw ] . Quaternions are a 4D extension of complex
numbers. A quaternion is a combination of a real number, w , and weighted three imaginary
numbers, namely, q
=
is represented by unit quaternion q
zk . In a parallel way to the ordinary (2D) complex
numbers, the conjugate of q is defined as q =
=
w
+
xi
+
yj
+
w
xi
yj
zk and the magnitude of the
= qq = w 2
quaternion is defined as
q
+
x 2
+
y 2
+
z 2 . The complex numbers i , j ,
and k are related by the fundamental formulae i 2
j 2
k 2
=
=
=
ijk
=−
1. The multiplication
of quaternions is not commutative: q 1 q 2 =
q 2 q 1 . From the fundamental formulae and the
non commutative property, the following complex products derive ij
=
k , ji
=−
k , jk
=
i ,
[ x 1 y 1 z 1 w 1 ]
kj
=−
i , ki
=
j and ik
=−
j . On the basis of that, the product of q 1 =
and
[ x 2 y 2 z 2 w 2 ] is shown in Equation 2.18.
q 2 =
w 1 w 2
x 1 x 2
y 1 y 2
z 1 z 2
+
( w 1 x 2 +
x 1 w 2 +
y 1 z 2
z 1 y 2 ) i
q 1 q 2 =
.
(2.18)
+
( w 1 y 2
x 1 z 2 +
y 1 w 2 +
z 1 x 2 ) j
+
( w 1 z 2 +
x 1 y 2
y 1 x 2 +
z 1 w 2 ) k
When representing the quaternions by 4
4 matrices (as in Eq. 2.19), matrix addition and
multiplication are equivalent to quaternion addition and multiplication, respectively, and the
quaternion conjugate is the matrix transposition.
×
.
wx
y
z
xw
z
y
q
=
(2.19)
yzw
x
z
yxw
θ
The rotation about unit 3D vector u by angle
is represented by the unit quaternion
[ u sin 2
cos 2 ] . The rotation of 3D point v
[ xyz ] is shown in Equation 2.20, where
the 3D points before and after the rotation are represented by the quaternions p
=
=
q
[ v
0] and
=
p =
[ v
0] , respectively
p =
qpq 1
qpq .
=
(2.20)
Search WWH ::




Custom Search