Fractal Terrain GenerationAnthony Annuzzi


Technologies Used and Steps Taken:

DiamondSquare Fractal Generation Method In order to generate the heightmap for the terrain, I used the diamondsquare method which is illustrated below. First, the corners are set, then the center point is randomly generated and added to the average of the corner values. Now, for step c, there is a diamond which has a randomly generated center point. The midpoint value is then calculated by averging the corner values and adding the random number that was generated. This will now create squares again so that the algorithm can be repeated. The image below illustrates how this algorithm works.
Generating Triangles Using the heightmap generated using the diamond square method, the next step is to generate the vertices that will be used. These have a varying x,z position and get the y values from the heightmap. Once that is done, the vertices must be indexed so that OpenGL will know which vertices will be connected. This was done by using GL_TRIANGLE_STRIPS and connecting adjacent vertices. Once that step was completed, I then calculated normals for each of the triangles by getting the vertices of each triangle and taking the cross product. This was done so that Phong lighting could be applied. Finished Product Unfortunately due to time constraints, the project was not fully implemented as expected. The original goal was to create a realistic looking landscape. Although that goal was not accomplished, many of the elements were created as I had hoped. I was able to implement the heightmap generation and creation of the triangles. However, it did not look as realistic as I had hoped. Also, the texture mapping did not work as well as I had hoped. Below is an image of the finished product.
