No description or website provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
src
test
.gitignore
.travis.yml
LICENSE
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

perlin-noise-generator

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

Description

Heightmaps generator on PHP using perlin-noise algorithm.

See also Diamond-Square algorithm with the similar API.

Requirements

This package is only supported on PHP 5.3 and above.

Installing

Composer

See more getcomposer.org.

Execute command

composer require a1essandro/perlin-noise ~1.0

Usage

$generator = new MapGenerator\PerlinNoiseGenerator();
$generator->setSize(100); //heightmap size: 100x100
$generator->setPersistence(0.8); //map roughness
$generator->setMapSeed('value'); //optional
$map = $generator->generate();

or

$generator = new MapGenerator\PerlinNoiseGenerator();
$map = $generator->generate([
    PerlinNoiseGenerator::SIZE => 100,
    PerlinNoiseGenerator::PERSISTENCE => 0.8,
    PerlinNoiseGenerator::MAP_SEED => 'value'
]);

mixed:

$generator = new MapGenerator\PerlinNoiseGenerator();
$generator->setSize(100);
$map = $generator->generate([
    PerlinNoiseGenerator::PERSISTENCE => 0.8
]);