forked from: PerlinWaves
perlinNoise勉強中
package {
import flash.geom.Point;
import flash.display.BitmapData;
import flash.events.Event;
import flash.display.Sprite;
public class Waves extends Sprite {
public function Waves() {
var bmd:BitmapData = new BitmapData(100, 100)
var val:Number = 0
addEventListener( Event.ENTER_FRAME, function(e:Event):void {
val++
bmd.perlinNoise(50,50,2,64,true,true,2|1,false,[new Point(val,0)])
graphics.clear()
graphics.lineStyle(1, 0xff)
for (var h:int = 0; h < bmd.height ; h++) {
graphics.moveTo(-10,250)
for (var w:int = 0; w < bmd.width; w++) {
var value:Number = bmd.getPixel( w, h ) / 30000
graphics.lineTo( w * 5, value)
}
}
})
}
}
}