01Jul

BitmapData Perlin Noise

No comments

Saw this over at Adobe with the use of the perlinNoise method:

package
{
	import flash.display.Sprite;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.BitmapDataChannel;

	public class BitmapDataPerlinNoise extends Sprite
	{

		public function BitmapDataPerlinNoise()
		{
			var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0x00ffffff);

			var seed:Number = Math.floor(Math.random() * 10);
			var channels:uint = BitmapDataChannel.RED | BitmapDataChannel.BLUE | BitmapDataChannel.GREEN;
			bmd.perlinNoise(100, 80, 6, seed, false, true, channels, false, null);

			var bm:Bitmap = new Bitmap(bmd);
			addChild(bm);
		}
	}

}

Share/Save/Bookmark

Tuesday, July 1st, 2008 at 10:02 am and is filed under Actionscript 3, Bitmap Data. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply