O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SpotLight and PointLight

As you've seen, AmbientLight mimics a light source similar to the diffusion of photons in our atmosphere, while DirectionalLight mimics a light source from a far distance, such as the sun. On any particular plane, DirectionalLight strikes all areas of that plane at a uniform angle:

DirectionalLightRays.xaml

Figure 4-12. DirectionalLightRays.xaml

The PointLight and SpotLight classes bring the light source closer to home. A PointLight mimics a light bulb that emits light in all directions. A PointLight object has a particular position in 3D space so that the rays of light strike a planar surface at a variety of angles:

Figure 4-13. PointLightRays.xaml ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required