forked from: PerlinNoiseテスト on 2010-2-1
/**
* Copyright bradsedito ( http://wonderfl.net/user/bradsedito )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/kLAy
*/
// forked from komatsu's PerlinNoiseテスト on 2010-2-1
package {
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;
import flash.events.TimerEvent;
import flash.utils.Timer;
[SWF(backgroundColor="#000000", frameRate=130)]
public class PerlinNoiseTest extends Sprite {
private const STW:uint = stage.stageWidth;
private const STH:uint = stage.stageHeight;
private var bmd:BitmapData;
private var bm:Bitmap;
private var rndSeed:Number = 0;
private var noiseSeed:Number = 0;
private var channels:uint = BitmapDataChannel.RED | BitmapDataChannel.BLUE | BitmapDataChannel.GREEN;
public function PerlinNoiseTest() {
bmd= new BitmapData(STW, STH, false, 0x00CCCCCC);
bm = new Bitmap(bmd);
addChild(bm);
var drawTimer:Timer = new Timer(100);
drawTimer.addEventListener(TimerEvent.TIMER , setNoise);
drawTimer.start();
}
private function setNoise(evtObj:TimerEvent):void{
rndSeed += 1;
//noiseSeed += 1
bmd.perlinNoise(40,200, 1, 6, false, false, channels, true, null);
}
}
}