teaching machines

Feature 2 Post Mortem

March 16, 2013 by . Filed under cs455, postmortems, spring 2013.

For generating terrain, I decided to go with a heightmap approach, because I figured it would be more useful down the road.  I found a few great high resolution height maps and corresponding textures at http://www.crydev.net/project_db.php?action=project_profile&team_id=1873&project_id=1809 which I used for my terrain generation.  I leveraged the ruby script provided by Chris Johnson and converted it to a script that reads in a pgm and outputs an obj file.  The heightmaps I am using are 2048 x 2048, so the script takes quite some time to run.  Ruby may not be the fastest environment for executing a script like this either, but it was quick to develop and easy to get working.

Initially, the terrain produced was very jagged and blocky, so I decided to implement some terrain smoothing.  There is a nice tutorial at http://www.nfostergames.com/lessons/TerrainSmoothing.htm which covers some basic terrain smoothing.  Essentially, it works by averaging the heights of all the neighbours of each location in the grid.

Here are some side to side shots of my hightmap and generated terrain:

 

Here is a short video showing this monster terrain in action:
[youtube http://www.youtube.com/watch?v=_f3gXRH5PMA?feature=player_detailpage]