Graphics Reference
In-Depth Information
Thus, we see that Eq. (2.26) is sensitive to the sign of the angle between the vectors.
In Section 2.12, when we discussed the vector product, we discovered that
a
×
b
=
a
b
sin
which equals the area of the parallelogram formed by the vectors a and b (Fig. 2.22). But from
Eq. (2.26) we can state that
a ·
b
=
a
b
sin
Therefore, a ·
b equals the signed area of the parallelogram formed by a and b , as shown in
Fig. 2.36.
area
=
a
b sin θ
a
b
α
θ
a
Figure 2.36.
2.12 Interpolating vectors
Interpolating between a pair of scalar quantities arises everywhere in computer graphics, especially
in the control of light intensity, colour, position, or the orientation of objects and cameras. Vectors
can also be interpolated and are regularly used in Phong shading, which is covered in Section 10.3.
However, a consequence of linearly interpolated vectors is that vector length is not preserved, which
can cause problems in the form of null vectors or the need for normalization. If vector length is
important, then spherical interpolation should be used. In this section we consider both schemes.
2.12.1 Linear interpolation
Given two scalars v 1 and v 2 , it is possible to linearly interpolate between them using
v
=
1
v 1 +
v 2
where
is a scalar such that 0
1
When <0or>1, interpolation continues, but v<v 1 and v>v 2 , respectively.
 
Search WWH ::




Custom Search