Skip to content

hamptonmoore/PerlinNoise-Deno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Perlin Noise library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published