O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

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

Types of Lights

Unlike your local Home Depot, which has thousands of different varieties of lights, Blitz3D offers you only three different light types. Take a look at the code used to create a light:

light = CreateLight()

The first part of the code, light=, is just the name that you give to your light. The next part of the code, CreateLight, actually creates the light, and, finally, the brackets, (), tell Blitz3D what type of light to create. You can specify one of three different types of lights:

  • Directional Light created by the code light = CreateLight() or light = CreateLight(1). Everything that faces the light will be equally lit (see Figure 7.17).

    Figure 7.17. Directional lighting.

  • Point Light created by the code light = CreateLight(2) ...

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