1.0.1 • Published 5 years ago

heightmap.js v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Heightmap.js

npm Build Status Coverage Status

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.

1.0.1

5 years ago

1.0.0

5 years ago