Procedural Terrain – Diamond Square Algorithm (Java)

Hello everyone,

I created an implementation of the Diamond Square Algorithm which is a method for developing procedurally generated terrain that can be used for video games or computer graphics. In this implementation of the algorithm I used java to generate a procedural square terrain with a variable amount of subdivisions. I then exported the vertex information of the terrain as a .obj file which can be used in almost any 3D editor.

Here is a link to the main code for the implementation.

If that does not work here are images of the main functions:

Part 1  Part 2   Part 3  Part 4  Part 5  Part 6  Part 7

Here are some example procedural terrains I generated from the code.

– Ben Johnson

Print Friendly, PDF & Email

Leave a Reply