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

Object Order

When you have more than one object on the screen, there is a chance that they can overlap each other and you won’t be able to see one or the other. Sometimes you’ll actually want an object to be hidden by others, and you can create this effect by controlling the order of an object. Let’s create a program that contains two spheres that overlap and then change their order using the EntityOrder command. This will be demo05-06.bb on the CD.

First, try on your own to create two overlapping spheres, each with different colors (see Figure 5.21), and then compare it to the following code:

Figure 5.21. When two objects overlap, they’ll blend into one another unless you adjust their order.

; demo05-06.bb - Creating two spheres without ...

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