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 ...

Get 3D Programming for Windows® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.