noise.js
a javascript simple noise generator based on code from from scratchapixel.com, via Michael Bromley
Installation
npm install yy-noise
API Reference
creates simple 1D noise this.generator
Kind: global class
new SimpleNoise(options, [maxVertices], [amplitude], [scale])
Param | Type | Default |
---|---|---|
options | object |
|
[maxVertices] | number |
256 |
[amplitude] | number |
1 |
[scale] | number |
1 |
Example
const noise = maxVertices: 512 noise: 05 scale: 025; // changes amplitude of noise function noiseamplitude = amplitude; // sets scale of noise function noisescale = scale; // returns the value based on n (usually incremented along an axis) for let x = 0; x < 100; x++ noise;
number
simpleNoise.get(x) ⇒ gets a value
Kind: instance method of SimpleNoise
Param | Type |
---|---|
x | number |
number
simpleNoise.lerp(a, b, t) ⇒ Linear interpolation function.
Kind: instance method of SimpleNoise
Param | Type | Description |
---|---|---|
a | number |
The lower integer value |
b | number |
The upper integer value |
t | number |
The value between the two |
Copyright (c) 2016 YOPEY YOPEY LLC - MIT License - Documented by jsdoc-to-markdown