Skip to content
A Perlin Noise library
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
LICENSE
README.md
mod.ts
test.ts

README.md

Perlin Noise Deno

A simple to use perlin noise module for typescript.

Usage

PerlinNoise Class

The class that handles PerlinNoise generation.

const perlin = new PerlinNoise(permuation?: numbers[])

permutiation (numbers[]) is an optional parameter to set the permutations used by the system

.noise

perlin.noise(x: number, y: number, z: number, min?: number, max?: number)

x (number) X cordinate

y (number) X cordinate

z (number) X cordinate

min (number) not required, default 0. Minium value generated.

max (number) not required, default 1. Maxium value generated

Will return a perlin noise random value between min and max

Example

import {PerlinNoise} from 'https://deno.land/x/perlinnoise/mod.ts';

const perlin = new PerlinNoise();

console.log(perlin.noise(0.1, 0.1, 0.1));

Credits

This is a port of Kas Thomas' javascript function which is a port of Ken Perlin's Java code. Kas Thomas' code can be found at https://asserttrue.blogspot.com/2011/12/perlin-noise-in-javascript_31.html Ken Perlin's code can be found at http://cs.nyu.edu/%7Eperlin/noise/ So really most of the work was done by them, I simply ported Kas' version to typescript by adding a few types to the functions

You can’t perform that action at this time.