Skip to content

Go language implementation of diamond square algorithm for heightmap generation

License

Notifications You must be signed in to change notification settings

Delta-de-Dirac/diamondSquare-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diamondSquare-go

Go language implementation of diamond square algorithm for heightmap generation.

The implementations follows the procedure described in the Wikipedia article for the algorithm.

diamondSquare-cli

diamondSquare-cli located in /cmd/diamondSquare-cli.go is an application to generate heightmaps from CLI interface.

usage:

$ go run cmd/diamondSquare-cli/main.go <size> <h> <output filename>

Parameter <size> must must be positive integer (2^n)+1 where n natural. Example: 3, 9, 17, 33...

Paremeter <h> is used to define the factor by which the scale of random part of each node is mutiplied each iteration, as described in the Wikipedia article. The value must be between 0 and 1 represented in float. Values closer to 0 generate rougher heightmaps while values closer to 1 generate smoother heightmaps.

Parameter <output filename> must end in either ".png", ".jpg", ".jpeg" or ".gif".

diamondSquare-gui

diamondSquare-gui located in /cmd/diamondSquare-gui.go is an application to run the implementation of the diamondSquare algorithm with configurable parameters and output to a raylib GUI window.

demo

pkg/heightmap

The package heightmap can be used to generate new and interact with heightmaps.

About

Go language implementation of diamond square algorithm for heightmap generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages