perlinNoise()

Actionscript:
  1. var canvas:BitmapData = new BitmapData(400,400,false, 0x000000);
  2. addChild(new Bitmap(canvas));
  3.  
  4. addEventListener(Event.ENTER_FRAME, onLoop);
  5. function onLoop(evt:Event):void {
  6.   canvas.perlinNoise(200,200, 2, 1, true, false,0, true,
  7.                               [new Point(mouseX, mouseY),
  8.                               new Point(-mouseX, -mouseY)]);
  9.                                                                                    
  10. }

There area few snippets on the way that involve perlin noise. Starting here with something simple. This creates 2 octave perlin noise and moves each octave based on the mouse location.

Perlin noise was invented by Ken Perlin.

This entry was posted in BitmapData, pixel manipulation and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Trackback

  1. [...] perlinNoise() [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*