Game Development Reference
In-Depth Information
Now, expanding the matrix multiplication makes it explicit that these
functions serve as blending weights:
2
4 H 0 (t)
3
5
2
4 | | | |
3
Interpreting the Hermite
basis functions as
blending weights
H 1 (t)
H 2 (t)
H 3 (t)
5
p (t) =
p 0 v 0 v 1 p 1
|
|
|
|
= H 0 (t) p 0 + H 1 (t) v 0 + H 2 (t) v 1 + H 3 (t) p 1 .
Figure 13.9 shows a graph of the Hermite basis functions.
Figure 13.9
The Hermite basis functions
Now let's make a few observations. First, notice that H 0 (t)+H 3 (t) = 1,
so those who object to the idea of adding “points” together can breath
a sigh of relief, as we can interpret the situation as a proper barycentric
combination of the points.
The curve H 3 (t) deserves special attention. It is also is known as the
smoothstep function and is truly a gem that every game programmer should
know. This function is found in many places, including the Renderman
shading language and HLSL. To remove the rigid, robotic feeling from any
linear interpolation (especially camera transitions), simply compute the
normalized interpolation fraction t as usual (in the range 0 ≤ t ≤ 1), and
then replace t with 3t 2 − 2t 3 . Voila! Everything will suddenly feel more
polished. The reason for this is that the smoothstep function eliminates
the sudden jump in velocity at the endpoints: H
3 (0) = H
3 (1) = 0.
Search WWH ::




Custom Search