Chopper 3D: Endless Terrain

as far as the eyes can see

As I said in my previous post on this Chopper 3D scene, I wanted to show you a couple of examples on how to build an endless city terrain to be used in a more first-person-shooter type of game.

Here is Option 1

View it in full Screen

Here is Option 2

View it in full Screen

Use Arrow Keys to Move

Both options are included in the same source code.

The 2D Grid

As I did with the game scene, I created a 2D version of the grid first. For this example I decided that a 8×6 grid worked best. But when I moved it to 3D, it turned out that a 10×6 grid worked best.

Here is a zoomed out version of the grid. The white rectangle represents the screen.

Use Arrow Keys to Move

Where to Go From Here

- You can build a Terrain logic using a fixed Grid. So you abandon the endless terrain but you can build quite a substantial city by making your grid larger than the actual grid of buildings. You just have to create a large array grid and populate it with buildings as they appear in the scene. You can store information about the types of buildings created so that once the player gets back to a spot he will see the same building there.

- Of course this second array grid does not need to be finite. It can grow as the city grows.

- For collision you would still use the actual building grid of 10×6 or 8×8 buildings.

Download Source Code

Leave a Comment