OpenGL terrain demo

November 27, 2007 · Filed Under Game Development 

A while back I created a simple terrain demo that featured a little ship hovering over the ground that could be controlled by the keyboard and mouse.

OpenGL terrain demo

Controls:
Mouse - rotates the camera
W - moves you forward into the direction the camera is facing
S - moves you backward from the direction your camera is facing
ESC - exits the demo

The terrain was created by editing a black and white image in a paint program and then blurred a few times to smooth out the brush strokes. The colors of the pixels represented the height of the terrain where the brightest pixels represented the hills and peaks, and the dark pixels represented the valleys.

Height map

I then textured the terrain with a rock-like image I had lying around.

Terrain texture

The GUI was coded using plain vanilla Win-32 API calls. It lets you choose the screen resolution and bit depth.

Display Settings for Terrain4 OpenGL demo

You can download the demo here: Terrain4.zip

Comments

Leave a Reply