Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filipemeneses/perlin-fp
A fluent functional 3-dimensional Perlin noise generator
https://github.com/filipemeneses/perlin-fp
Last synced: 18 days ago
JSON representation
A fluent functional 3-dimensional Perlin noise generator
- Host: GitHub
- URL: https://github.com/filipemeneses/perlin-fp
- Owner: filipemeneses
- Created: 2020-02-29T22:56:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T08:41:29.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T10:32:01.075Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 1.38 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# perlin-fp
A fluent functional 3-dimensional Perlin noise generator based on [p5.js Perlin noise implementation](https://github.com/processing/p5.js/blob/1.0.0/src/math/noise.js)
---
## Install```bash
npm i -S perlin-fp# with yarn
# yarn add perlin-fp
```## Examples
### Basic (random seed)
```js
const perlinNoise = require('perlin-fp');
const { getNoiseByCoordinate } = perlinNoise();
const [x, y, z] = [0, 0, 0];getNoiseByCoordinate(x, y, z);
// -> 0.5324108156492002getNoiseByCoordinate(x, y, z);
// -> 0.7722926216956694
```### With all options
```js
const perlinNoise = require('perlin-fp');
const { getNoiseByCoordinate } = perlinNoise()
.setSeed(1)
.setOctaves(4)
.setAmpFallOff(0.5);
const [x, y, z] = [0, 0, 0];getNoiseByCoordinate(x, y, z);
// -> 0.22167705494211987getNoiseByCoordinate(x, y, z);
// -> 0.22167705494211987```