0.0.1 • Published 12 years ago

js.perlin v0.0.1

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

JS.Perlin

Installation

npm install js.perlin

Usage

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.

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 Perlin = require( 'js.perlin' ).Perlin;

var map = new Perlin( );

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

To do

I need to :

  • Understand why implements Perlin.random as Math.random( ) * 2 - 1 just doesn't work.

  • Implement real Perlin noises (standard & simplex).

If you can help me on one of these two issues, please feel free to post an issue and / or make pull requests !

Authors

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

0.0.1

12 years ago