a1essandro / diamond-and-square
Algorithm for generating heightmaps
Installs: 195
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/a1essandro/diamond-and-square
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.7.*
- satooshi/php-coveralls: ~1.0
README
Algorithm for generating heightmaps on PHP.
See also Perlin-Noise algorithm with the similar API.
Algorithm
Steps
See more about diamond-square algorithm on wiki
Requirements
This package is only supported on PHP 5.3 and up.
Installing
Installing via Composer
See more getcomposer.org.
Execute command
composer require a1essandro/diamond-and-square ~2.0
Usage example
Standart
$gen = new DiamondAndSquare(); $gen->setSize(7); //real size equal 2 ^ 7 + 1, i.e. 129 $gen->setPersistence(1.7); $gen->setMapSeed("1hCaHs5hZ"); $map = $gen->generate();