Terrain Mesh
This program displays a 3D view of terrain as specified by a height file. The terrain is colored by height and can be displayed in wire frame or filled mode. Finally, it is possible to move the camera around the terrain to see it in better detail.
To run the program, type:
Terrain_Mesh.exe textFile granularity verticalMultiplier
- The a text file that defines an area of terrain must be in the following format:
- First line of file:
Width Height BitDepth Xscale Yscale Zscale
- All other lines:
X-coord,Y-coord: ( Red, Green, Blue) #ColorHexValue(Optional)
Reading in these files can take quite a long time depending on their size, so please be patient and watch for messages on the command line.
- The granularity parameter defines how much of the data we use (granularity of 1 means every data point is used, granularity of 2 means every other data point, etc.), the granularity can also be changed after the program is running, check here for more info.
- The verticalMultiplier parameter is used to change the scale of points vertically, the default value is 1. Thus, a large value for the vertical multiplier would greatly exagerate the height of all the points.
Finally, while the textFile parameter is required, the granularity and verticalMultiplier parameters are optional. If they are not passed in, then the default values of 1 and 1 (respectively) will be used.
- Keyboard control information can be found here.
- Please note that the program crashes when you leave game mode. I have investigated why this happens, but I have not found an answer. All I can do is simply warn you about this issue.
- Check out this cool screenshot and this video from my program.
- Files:
- TerrainMesh.exe
- Source files
- Mount Rainier west slope height data
- Puget Sound height data
- Mount Rainier height data