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). This type of light starts strong at a specific point and fades out the farther away you get from the light (see Figure 7.18).

    Figure 7.18. Point lighting.

  • Spot Light created by the code light = CreateLight(3). Think of spot light as holding a flashlight on an object (see Figure 7.19).

    Figure 7.19. Spot lighting.

Note: Now You Try

Create a program with a cone or sphere. Try each variety of light to see how the light affects the object.


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

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