CSE 167 Final Project - Zhao Yong Liu

Project Description

This program renders California and parts of Nevada based on a real height data that I got off the internet. Although real and accurate, I couldn't figure out the proportions of the land distance compared to the height specified by the data. I scaled the height based on looks.

Implementation and figures

The terrain is generated using triangle strips. Data from the height map is averaged depending on the user selected resolution and the terrain is drawn strip by strip. Normals are also calculated at each vertex for lighting.

There are two textures used in the program. There is a dirt texture for the land and a water texture for the ocean. The water texture is more interesting. I applied transparency to the water so that land below sea level can be seen through the water. Additionally, the water texture is animated by shifting the variables in glTexCoord2f() to create a moving water effect. This is really cool and you'll have to run the program to see it.

This program can be slow if the resolution is set too high. To speed things up a bit, a display list is created for the terrain. The user can change the resolution as well. Below are images comparing two different resolutions in shaded and wireframe mode:

Low resolution:

Higher resolution:

Controls

W - toggle wireframe
B - Increase size of triangles
b - Decrease size of triangles
R - Increase resolution
r - Decrease resolution
j - move left
l - move right
i - move foreward
k - move backward
u - move up
n - move down
esc - quit

arrow keys rotate

Download