perlinNoiseのお勉強
package
{
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.MouseEvent;
public class Noise extends Sprite
{
private var bmpData:BitmapData;
public function Noise()
{
bmpData = new BitmapData(465, 465, false);
addChild(new Bitmap(bmpData));
createNoize(null);
stage.addEventListener(MouseEvent.CLICK , createNoize);
}
private function createNoize(e:MouseEvent):void
{
bmpData.perlinNoise(465 >> 1, 465 >> 1, 4, Math.random() * 0xFFFF, false, true, 3);
}
}
}