Perlin

Perlin

An implimentation of Perlin Noise by Ken Perlin.

Members

Fields & Properties
Methods

Constructor

new Perlin(seed)

Parameters
Name Type Description
seed number

Seed Value for PRNG.

Classes

Perlin

Members

shaderChunk

GLSL Shader Chunk for 2D Perlin Noise. Can be used with three-CustomShaderMaterial. See: three-CustomShaderMaterial

Methods

(static) map(x, in_min, in_max, out_min, out_max) → {number}

Maps a number from one range to another.

Parameters
Name Type Description
x number

Input Number

in_min number

Current range minimum

in_max number

Current range maximum

out_min number

New range minimum

out_max number

New range maximum

Returns

Input Mapped to range [out_min, out_max]

Type
number

get2(input) → {number}

Samples 2D Perlin Nosie at given coordinates.

Parameters
Name Type Description
input THREE.Vector2 | THREE.Vector3

Coordincates to sample at

Returns

Value of Perlin Noise at that coordinate.

Type
number

get3(3) → {number}

Samples 3D Perlin Nosie at given coordinates.

Parameters
Name Type Description
3 THREE.Vector

input Coordincates to sample at

Returns

Value of Perlin Noise at that coordinate.

Type
number