Skip to content

Java implementation of the Diamond Square algorithm which is used in terrain generation.

Notifications You must be signed in to change notification settings

hushoca/DiamondSquare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Diamond Square Algorithm

Powered By Java

Diamond Square is mainly used for terrain generation. I am sure there is another use out there that I don't know. This implementation was written in Java but it can easily be converted to other languages...

Simple explanation of Diamond Square Algorithm can be found on wiki page: https://en.wikipedia.org/wiki/Diamond-square_algorithm

For more detailed explanation with an example, visit my blog: http://hhoca.com/2017/06/13/procedural-terrain-generation-diamond-square-algorithm/

This implementation is fully open-sourced feel free to use and change however you want. I have created this for a game project I was working on. It is suitable for 3D games as well as tile based 2D games.

Features

  • Calculates a height map with chunks (double)
  • Can scale a height map between 0 and X for easier implementation.

Example Application

The example application demostrates this script in action with Swing library.

Example Screenshot

About

Java implementation of the Diamond Square algorithm which is used in terrain generation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages