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

Creating the World

The world for our game is going to be made up of three different elements. The water in the lakes will be a plane on which we will apply the texture we created earlier. For the hills, we will use a heightmap on which we will apply another texture. The sky won’t actually be an object—instead, we’ll change the color of the camera, which will make everything that is black appear the color that we specify.

To do this, we’ll use the CameraClsColor command. Let’s start by applying that command in bold:

; Create camera
camera=CreateCamera()
CameraClsColor camera, 0,125,255

If you run the program now, you’ll notice that everything on the screen is the light blue color that we specified in the CameraClsColor command. Now we are going ...

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