Graphics Reference
In-Depth Information
6.2.10 The Dot Product in Lighting Calculations
Lambert's law states that the intensity of illumination on a diffuse surface is
proportional to the cosine of the angle between the surface normal vector and
the light source direction. This arrangement is shown in Figure 6.8. The light
source is located at (20, 20, 40) and the illuminated point is (0, 10, 0).
In this situation we are interested in calculating cos( β ), which when mul-
tiplied by the light source intensity gives the incident light intensity on the
surface. To begin with, we are given the normal vector n to the surface. In
this case n is a unit vector, and its magnitude
n
=1:
0
1
0
n =
The direction of the light source from the surface is defined by the vector s:
20
0
20
10
40
=
s =
20
10
40
0
= 20 2 +10 2 +40 2 =45 . 826
||
s
||
|| n || · || s ||
cos( β )=0
×
20 + 1
×
10 + 0
×
40 = 10
1
×
45 . 826
×
cos( β )=10
10
45 . 826
cos( β )=
=0 . 218
Therefore the light intensity at the point (0, 10, 0) is 0.218 of the original
light intensity at (20, 20, 40). This does not take into account the attenuation
due to the inverse-square law of light propagation.
Light
source
n
s
b
Fig. 6.8. Lambert's law states that the intensity of illumination on a diffuse surface
is proportional to the cosine of the angle between the surface normal vector and the
light source direction.
 
Search WWH ::




Custom Search