Point Light

A point light is a single light source that emits in all directions like a lightbulb. You set the position, color, and attenuation, which is the amount of a decrease in light over distance. The range is the maximum distance that the light will illuminate your 3D objects.

D3DLIGHT9 light;
light.Type = D3DLIGHT_POINT;
light.Diffuse.r = 1.0f;
light.Diffuse.g = 1.0f;
light.Diffuse.b = 1.0f;
light.Position = position;
light.Attenuation0 = 0.1f;
light.Range = range;

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset