perlin noise xor
/**
* Copyright codeonwort ( http://wonderfl.net/user/codeonwort )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ymjg
*/
package {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
var bd:BitmapData = new BitmapData(465, 465, false)
bd.perlinNoise(465/2, 465/2, 3, Math.random() * 123, true, true)
var bd2:BitmapData = new BitmapData(465, 465, false)
bd2.perlinNoise(465/2, 465/2, 3, Math.random() * 123, true, true)
var c:uint
for(var i:int=0; i<bd.width; i++){
for(var j:int=0; j<bd.height; j++){
c = bd.getPixel(i, j) ^ bd2.getPixel(i, j)
bd.setPixel(i, j, c)
}
}
addChild(new Bitmap(bd))
}
}
}