Game Development Reference
In-Depth Information
x
2
y
2
z
2
q
1
q
2
=
w
1
x
1
y
1
z
1
w
2
Quaternion product
2
4
w
1
w
2
3
− x
1
x
2
− y
1
y
2
− z
1
z
2
0
1
5
w
1
x
2
+ x
1
w
2
+ y
1
z
2
− z
1
y
2
=
@
A
w
1
y
2
+ y
1
w
2
+ z
1
x
2
− x
1
z
2
w
1
z
2
+ z
1
w
2
+ x
1
y
2
− y
1
x
2
=
w
1
v
1
w
2
v
2
=
w
1
w
2
−
v
1
v
2
w
1
v
2
+ w
2
v
1
+
v
1
×
v
2
.
The quaternion product is also known as the Hamilton product; you'll
understand why after reading about the history of quaternions in
Sec-
Let's quickly mention three properties of quaternion multiplication, all
of which can be easily shown by using the definition given above. First,
quaternion multiplication is associative, but not commutative:
Quaternion
multiplication is
associative, but not
commutative
(
ab
)
c
=
a
(
bc
),
ab
=
ba
.
Second, the magnitude of a quaternion product is equal to the product
of the magnitudes (see Exercise 9):
Magnitude of quaternion
product
q
1
q
2
=
q
1
q
2
.
This is very significant because it guarantees us that when we multiply two
unit quaternions, the result is a unit quaternion.
Finally, the inverse of a quaternion product is equal to the product of
the inverses taken in reverse order:
−1
=
b
−1
a
−1
,
(
ab
)
Inverse of quaternion
product
−1
=
q
n
−1
q
n−1
−1
q
2
−1
q
1
−1
.
(
q
1
q
2
q
n−1
q
n
)
Now that we know some basic properties of quaternion multiplication,
let's talk about why the operation is actually useful. Let us “extend” a
standard 3D point (x,y,z) into quaternion space by defining the quater-
nion
p
= [0,(x,y,z)]. In general,
p
is not a valid rotation quaternion,
since it can have any magnitude. Let
q
be a rotation quaternion in the
form we have been discussing, [cosθ/2,
n
sinθ/2], where
n
is a unit vector
axis of rotation, and θ is the rotation angle. It is surprising to realize that
we can rotate the 3D point
p
about
n
by performing the rather odd-looking
Search WWH ::
Custom Search