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

Lights and Camera

A 3D scene usually requires some light. If you don't have any light in a 3D scene, you'll still be able to see the figures you've created, but they won't have any color, and the only reason you'll see them is because they're usually displayed against a white background. Different types of light are available in WPF 3D, but for this first program, I'll stick to the simplest, which is a class named AmbientLight:

<AmbientLight Color="White" />

The AmbientLight class inherits the Color property from the abstract Light class, and it's white by default, so if you want white light you don't even have to include the attribute:

<AmbientLight />

Early in this chapter I described the three types of WPF 3D cameras. For this first example, I ...

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