Graphics Reference
In-Depth Information
Any interpolated quaternion can be found by the application of (8.35). But
first, we need to find the value of
θ
using (8.37):
cos(
θ
)=0
.
7071 + 0 + 0 + 0
θ
=45
◦
Now when
t
=0
.
5, the interpolated quaternion is given by
sin(
45
2
)
sin(
45
2
)
q
=
sin(45
◦
)
[0
.
7071
,
[0
,
0
,
0
.
7071]]
q
=0
.
541196[1
,
[0
,
0
,
0]]+0
.
541196[0
.
7071
,
[0
,
0
,
0
.
7071]]
sin(45
◦
)
[1
,
[0
,
0
,
0]] +
q
=[0
.
541196
,
[0
,
0
,
0]] + [0
.
382683
,
[0
,
0
,
0
.
382683]]
q
=[0
.
923879
,
[0
,
0
,
0
.
382683]]
Although it is not obvious, this interpolated quaternion is a unit quaternion,
because the square root of the sum of the squares is 1. It should rotate a point
about the
z
-axis, halfway between 0
◦
and 90
◦
, i.e. 45
◦
. We can test that this
works with a simple example.
Take a point (1, 0, 0) and subject it to the standard quaternion operation:
P
=
qPq
−
1
To keep the arithmetic work to a minimum, we substitute
a
=0
.
923879 and
b
=0
.
382683. Therefore
q
=[
a,
[0
,
0
,b
]] and
q
−
1
=[
a,
[0
,
0
,
−
b
]]
P
=[
a,
[0
,
0
,b
]]
×
[0
,
[1
,
0
,
0]]
×
[
a,
[0
,
0
,
−
b
]]
P
=[0
,
[
a, b,
0]]
×
[
a,
[0
,
0
,
−
b
]]
P
=[0
,
[
a
2
b
2
,
2
ab,
0]]
P
=[0
,
[0
.
7071
,
0
.
7071
,
0]]
−
Therefore, (1, 0, 0) is rotated to (0.7071, 0.7071, 0), which is correct!
8.5 Summary
This chapter has covered some very interesting, yet simple ideas about chang-
ing one number into another. In the following chapter we will develop these
ideas and see how we design algebraic solutions to curves and surfaces.