Graphics Reference
In-Depth Information
Therefore the transform is
x
y
z
a 2 K +cos α bK
c sin αacK + b sin α
abK + c sin α 2 K +cos α cK
x
y
z
=
·
a sin α
2 K +cos α
acK
b sin α cK + a sin α
where
K =1
cos α
Which is identical to the transformation derived from the first approach.
Now let's test the matrix with a simple example that can be easily verified.
If we rotate the point P (10,5,0), 360 about an axis defined by v = i + j + k ,
it should return to itself producing P (10,5,0).
Therefore
α = 360
cos α = 1
sin α =0 K =0
and
a =1 b =1 c =1
x
y
z
100
010
001
10
5
0
=
·
As the matrix is an identity matrix P = P .
7.7.1 Quaternions
As mentioned earlier, quaternions were invented by Sir William Rowan Hamil-
ton in the mid 19th century. Sir William was looking for a way to represent
complex numbers in higher dimensions, and it took 15 years of toil before he
stumbled upon the idea of using a 4D notation -hence the name 'quaternion'.
Since this discovery, mathematicians have shown that quaternions can be
used to rotate points about an arbitrary axis, and hence the orientation of
objects and the virtual camera. In order to develop the equation that performs
this transformation we will have to understand the action of quaternions in
the context of rotations.
A quaternion q is a quadruple of real numbers and is defined as
q =[ s, v ]
(7.84)
where s is a scalar and is a 3D vector. If we express the vector in terms of its
components, we have in an algebraic form
q =[ s + x i + y j + z k ]
(7.85)
where s , x , y and z are real numbers.
Search WWH ::




Custom Search