Skip to content

A fluent functional 3-dimensional Perlin noise generator

Notifications You must be signed in to change notification settings

filipemeneses/perlin-fp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

perlin-fp

A fluent functional 3-dimensional Perlin noise generator based on p5.js Perlin noise implementation


Install

npm i -S perlin-fp

# with yarn
# yarn add perlin-fp

Examples

Basic (random seed)

const perlinNoise = require('perlin-fp');
const { getNoiseByCoordinate } = perlinNoise();
const [x, y, z] = [0, 0, 0];

getNoiseByCoordinate(x, y, z);
// -> 0.5324108156492002

getNoiseByCoordinate(x, y, z);
// -> 0.7722926216956694

With all options

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.22167705494211987

getNoiseByCoordinate(x, y, z);
// -> 0.22167705494211987

About

A fluent functional 3-dimensional Perlin noise generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published