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

Using Shapes with Terrains

What’s better than chocolate mixing with peanut butter? How about terrains mixing with shapes? Maybe that’s not quite as good, but combining a terrain with a shape is how many 3D games create their environments. Typically, the terrain will make up the ground, and the shapes will make up the sky and other objects within the game. In the following example, we’ll create a sky using a shape and apply it to a standard. Start by opening the file called demo09-06.bb or entering the following code. Save the file with a new name into a new folder and make sure that the files called greenery.jpg and sky2.jpg are copied to that folder.

;demo09-06.bb – Shapes and Terrain ; ––––––––––––––––, Graphics3D 640,480 SetBuffer BackBuffer() ...

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