Graphics Reference
In-Depth Information
Therefore, the final interpolant is
V
=
sin((1
t
)
θ
)
sin(
θ
)
−
V
1
+
sin(
tθ
)
sin(
θ
)
V
2
(8.34)
To see how this operates, let's consider a simple exercise of interpolating
between two unit vectors [1 0]
T
and
√
2
T
1
√
2
1
. The value of
θ
is the angle
between the two vectors: 135
◦
. (8.34) is used to interpolate the
x
-components
and the
y
-components individually:
−
t
)135
◦
)
sin(135
◦
)
(1) +
sin(
t
135
◦
)
V
x
=
sin((1
−
1
√
2
×
sin(135
◦
)
×
−
1
√
2
t
)135
◦
)
sin(135
◦
)
(0) +
sin(
t
135
◦
)
V
y
=
sin((1
−
×
sin(135
◦
)
×
Figure 8.13 shows the interpolating curves and Figure 8.14 shows the positions
of the interpolated vectors, and a trace of the interpolated vectors.
Two observations on (8.34):
•
The angle
θ
is the angle between the two vectors, which, if not known, can
be computed using the dot product.
180
◦
, because when
θ
= 180
◦
the denominator collapses to zero. To confirm this we will repeat (8.34)
for
θ
= 179
◦
. The result is shown in Figure 8.15, which reveals clearly that
the interpolant works normally over this range. One more degree, however,
and it fails!
•
Secondly, the range of
θ
is give by 0
≤
θ
≤
So far, we have only considered unit vectors. Now let's see how the inter-
polant responds to vectors of different magnitudes. As a test, we can input
the following vectors to (8.34):
V
1
=
2
0
and
V
2
=
0
1
1.8
1
0.8
0.6
0.4
0.2
0
0
13.5
27
40.5
54
67.5
81
94.5
108 121.5 135
−
0.2
−
0.4
−
0.6
−
0.8
Angle
Fig. 8.13.
Curves of the two parts of (8.34).