< Zurück | Inhalt | Weiter >

NOTE

A SpotLight is an approximation of a typical directional light source, such as a flashlight, car headlight, or desk lamp. The width of the conical beam for the Spotlight can be varied, along with the position and attenuation of the light.

Figures 10.2 through 10.9 illustrate the effects of applying the different types of light to a simple scene. The relevant parameters for the lights are shown in tables 10.1 through 10.3.

Table 10.1 Spotlight


SpotLight parameter

Value

Direction

1, –1, 1

Concentration

10

Spread angle

2

Position

–8, –8, –4


Attenuation

Constant 0.1

Linear 0.05

Quadratic 0.0


Table 10.2 DirectionalLight


DirectionalLight parameter

Value

Direction

–1, 2, 0


Table 10.3 PointLight


PointLight parameter

Value

Position

–2, 9, –1


Attenuation:

Constant 0.1

Linear 0.01

Quadratic 0.0

image image


Figure 10.2 SpotLight Figure 10.3 SpotLight and DirectionalLight


image image


Figure 10.4 SpotLight, DirectionalLight, and

PointLight

Figure 10.5 SpotLight, DirectionalLight, PointLight,

and AmbientLight. Note that the Bounds of the

AmbientLight

have been set such that only the central large sphere (and the cone depicting the DirectionalLight are influenced

image image


Figure 10.6 DirectionalLight and PointLight Figure 10.7 AmbientLight


image image

Figure 10.8 PointLight and AmbientLight Figure 10.9 DirectionalLight, PointLight, and

AmbientLight

Figures 10.10 through 10.12 illustrate the effect of varying the SpreadAngle for a single SpotLight.


Figures 10.13 through 10.15 illustrate varying the attenuation parameters of a SpotLight. As the linear and quadratic components of the attenuation are increased, the boundary between lit and unlit surfaces becomes increasingly blurred because the light attenuates more rapidly with distance.

image image


Figure 10.10 SpotLight. SpreadAngle is 0.2 radians Figure 10.11 SpotLight. SpreadAngle is 0.5 radians


image image

0.05,

Figure 10.12 SpotLight. SpreadAngle is 2 radians Figure 10.13 SpotLight. Attenuation: Constant is

Linear is 0.0, Quadratic is 0.0

image image


Figure 10.14 SpotLight. Attenuation: Constant is 0.05,

Linear is 0.01, Quadratic is 0.0

Figure 10.15 SpotLight. Attenuation: Constant is 0.05,

Linear is 0.01, Quadratic is 0.01