Graphics Reference
In-Depth Information
Unpack (
x
,y
,z
)
6
(
x
,y
,z
)
p
=[0+
x
i
+
y
j
+
z
k
]
We can verify the action of the above transform with a simple example. Con-
sider the point
P
(0, 1, 1) in Figure 7.26 which is to be rotated 90
◦
about the
y
-axis. We can see that the rotated point
P
has the coordinates (1, 1, 0),
which we will confirm algebraically. The point
P
is represented by a quater-
nion
P
, and is rotated by evaluating the quaternion
P
:
Y
P
(0, 1, 1)
P
′
(1, 1,0)
Z
X
Fig. 7.26.
The point
P
(0
,
1
,
1) is rotated to
P
(1
,
1
,
0) using a quaternion coincident
with the
y
-axis.
P
=
qPq
−
1
which will store the rotated coordinates. The axis of rotation is [
j
], therefore
the unit quaternion
q
is given by
q
= [cos(90
◦
/
2)
,
sin(90
◦
/
2)[0
,
1
,
0]]
= [cos(45
◦
)
,
[0
,
sin(45
◦
)
,
0]]
The inverse quaternion
q
−
1
is given by
q
−
1
=
[cos(90
◦
/
2)
,
sin(90
◦
/
2)[0
,
1
,
0]]
|
−
2
q
|
2
but as
q
is a unit quaternion, the denominator
|
q
|
equals unity and can be
ignored. Therefore
q
−
1
= [cos(45
◦
)
,
[0
,
sin(45
◦
)0]]
−
Let's evaluate
qPq
−
1
in two stages: (
qP
)
q
−
1
.
1
qP
= [cos(45
◦
)
,
[0
,
sin(45
◦
)
,
0] ]
·
[0
,
[0
,
1
,
1]]
sin(45
◦
)
,
[sin(45
◦
)
,
cos(45
◦
)
,
cos(45
◦
)]]
=[
−