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

Positioning a Terrain

To actually see the terrain, you have two options. Either you can reposition your camera or you can change the location of your terrain. The following sections will cover both methods.

Repositioning the Camera

We need to change the position of the camera. The terrain begins at position 1 on the y axis, and in this case, our terrain extends to the position 512,1,59. Since the default camera is at position 0,0,0, we need to bring it up to 0,1,0 so that we can see the terrain. Add the following lines to the camera code to position it so that we can see the terrain:

; Create camera
camera=CreateCamera()
PositionEntity camera,0,1,0

If you run the program right now, you’ll see the beginning of the terrain we created. Not much ...

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