Tag Archives: textures

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.

Posted in BitmapData, pixel manipulation | Also tagged , , | 1 Comment