Libnoise
This is a haxe port of libnoise, the coherent noise library. The port is almost complete, only the gradient and noise2D utilities are missing.
Examples usages in the test folder, require the format library to generate images.
JS Example
var ctx = document ; //enums are a bit weird in js, so you have to use the actual reference, instead of an int.var quality = libnoiseQualityModeMEDIUM;var noise = 01 20 05 8 42 quality; var size = 512;var img = ctx; { var color = 128 * val + 1; return color > 255 ? 255 : color < 0 ? 0 : color;} var z = 0; for var i = 0; i < size * size * 4; i += 4 var x = i / 4 % size; //Math.floor(i / width); var y = Math; //i % height;:w var val = noise; var color = ; //console.log('pixel at: ', x ,y, val, color); //r imgdatai = color; //g imgdatai + 1 = color; //b imgdatai + 2 = color; //a imgdatai + 3 = 255; ctx;
License
This port is released under the LGPL licence, see LICENSE and LICENSE.lesser for details.
About
Libnoise was originaly created by Jason Bevins. The library was later ported to Xna by Marc André Ueberall, and moved to Unity by Tim Speltz. This haxe version was mainly ported with Libnoise.unity as reference.