The goal of this lab is to demonstrate how the Web Driver's light function affects the attenuation (fall-off of intensity over distance) of a WTLight object.
The attenuation of a light is described
by the inverse
quadratic equation pictured
here. In code, you have the freedom to specify the three factors that go into the
equation, Constant, Linear, and Quadratic.
The intensity of
the light decreases over distance (D) using the equation below.
The method WTLight::setRange() allows you to specify at what distance in world units the light intensity will be forced to zero.
In the scene above, you have control over the color of the light and the function constants. Tweak these parameters to your heart's content and then press Refresh to view the light function plots. You also have control of the plot's range and the color of the plot.
The plots shown are broken down into the red, green, and blue components of the light. They show how the intensity of each of these components varies with distance from the light. Drag the flashing bar to see how the values of these components change with distance. (shown at the bottom of the scene in world units). The background of the scene is a representaion of the light's actual color. You may need to adjust the plot range or plot color if you are having a hard time seeing the fall-off.
To get comfortable with the effects that the different values will create, try these steps:
|
WTLight::setConstantAttenuation, WTLight::setLinearAttenuation, WTLight::setQuadraticAttenuation, WTLight::getConstantAttenuation, WTLight::getLinearAttenuation, WTLight::getQuadraticAttenuation, WTLight::setRange, WTLight::getRange