diamondSquare-go

module
v0.0.0-...-c0c5739 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: MIT

README

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 confugurable parameters and output to a fyne GUI window.

pkg/heightmap

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

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL