VincentCharpentier / js.perlin

Javascript perlin's noise implementation - Demo on the arcanis/voxplode repository

Home Page:http://arcanis.github.com/voxplode/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS.Perlin

Disclaimer

If you want to use this library in a WebGL context, please consider using this one instead.

Installation

Warning : This is a web-only package : it should not be used in a Node environment.

npm install wo-perlin

Usage

  • new PERLIN.Generator( [ table ] )

Returns a new generator instance. If table is set, then it will be used as random lookup table otherwise a random table will be generated.

  • [instance].octaves
  • [instance].frequency
  • [instance].persistence

Generator configurations variables.

  • [instance].generate( start, size, callback )

This function will call callback() for each pixel in the N-dimensional range between start and start+size, with two parameters : the coordinates of the current pixel, and the related Perlin value.

var generator = new PERLIN.Generator( );

generator.generate( [ 0, 0 ], [ 2, 2 ], function ( point, value ) {
    console.log( point, value );
} );

Authors

Implementation by Maël Nison, from Jeremy Cochoy's paper.

About

Javascript perlin's noise implementation - Demo on the arcanis/voxplode repository

http://arcanis.github.com/voxplode/


Languages

Language:JavaScript 94.8%Language:GLSL 5.2%