Heightmaps generator on PHP using perlin-noise algorithm.
See also Diamond-Square algorithm with the similar API.
This package is only supported on PHP 5.3 and above.
See more getcomposer.org.
Execute command
composer require a1essandro/perlin-noise ~1.0
$generator = new MapGenerator\PerlinNoiseGenerator();
$generator->setSize(100); //heightmap size: 100x100
$generator->setPersistence(0.8); //map roughness
$generator->setMapSeed('value'); //optional
$map = $generator->generate();
$generator = new MapGenerator\PerlinNoiseGenerator();
$map = $generator->generate([
PerlinNoiseGenerator::SIZE => 100,
PerlinNoiseGenerator::PERSISTENCE => 0.8,
PerlinNoiseGenerator::MAP_SEED => 'value'
]);
$generator = new MapGenerator\PerlinNoiseGenerator();
$generator->setSize(100);
$map = $generator->generate([
PerlinNoiseGenerator::PERSISTENCE => 0.8
]);