1.0.1 • Published 5 years ago
heightmap.js v1.0.1
Heightmap.js
Library for procedurally generating heightmaps.
Installation
Browser
<script src="heightmap.js"></script>
Node
npm i heightmap.js
Usage
The globally exported Heightmap
class contains the static create
method. This generates a heightmap represented as a square array of numbers between 0 and 1 with size 2 ^ n + 1.
The method uses the Diamond-Square Algorithm. An iterations
argument is required to set the amount of iterations of the algorithm, which corresponds to n in the size formula.
For example, Heightmap.create(2)
will create a heightmap of size 5.