CPS 124/296.3
Fall 2001

Terrain

Scenery can be very relaxing and inspiring (in fact, many photo albums are made up of such pictures); so it is only natural to want to model such images.

Specifications

Create a program that displays a smoothly shaded terrain over which the user can fly interactively. The terrain will be specified as a gray-scale image interpreted as a height field in which the darkness relates to the height (so the white areas would be the highest peaks and the darkest areas would be the lowest). So the basic shape could, for example, be drawn using any 2D paint program and saved as a bitmap file. If no image file is specified, the terrain should be generated automatically using a procedural fractal algorithm over an NxM grid.

Additionally, color the terrain based on its height and light the terrain based on computing the correct normals for each vertex of the height field. The light source for shading should be positioned well above one of the corners of the height field. Set the surface properties so that both diffuse and non-diffuse shading is visible. Use fog or other coloring techniques to make far away patches of the terrain less distinct.

The user of your program should be able to control a variety of options within your scene using the keyboard. You may choose which keys control which functions, but make sure they are clearly documented in your README file.

Allow the user the following controls
move the viewpoint to allow the user to fly around naturally within the scene, as if user is actually flying
switch between a smooth shaded, flat shaded, and wire-frame view of the terrain
switch on and off a view of the terrain's bounding box
reset the viewpoint of the scene
quit the program

Extra Credit

There are many parts of the homework that are open ended. You can earn bonus points with extremely creative and efficient solutions. Make sure that you mention your assumptions, extra features, and how to run your program in your README file.

To get you started, here are some extra credit ideas

texture the terrain
combine image and fractal height generation by using one to seed the other
prevent the camera from flying through the terrain
anything that allows more efficient rendering, thus supporting larger terrains
combine like patches to reduce the overall number within terrain surface
support level of detail, i.e., approximate far away terrain patches
only render visible patches of the terrain
read and combine multiple image files to create a larger world
show how the light changes as the sun moves across the sky (from dawn to dusk)
generate fractal clouds in the background

Resources

Example code based on a NeHe tutorial to get you started

A tutorial on fractal terrains

A tutorial on camera motion

True geographical data from USGS in common image formats

Efficient Triangulation Algorithm for Terrain Modeling by Paul Bourke

All you ever needed to know about terrain generation is online here!

 

Feedback?