forked from: 点描で球体
綺麗なコッペパンみたいなのが出来上がります
// forked from Susisu's 点描で球体
//綺麗なコッペパンみたいなのが出来上がります
package {
import flash.text.engine.ElementFormat;
import flash.media.Camera;
import flash.filters.BlurFilter;
import flash.events.ActivityEvent;
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.PixelSnapping;
import flash.events.Event;
public class dotcircle extends Sprite{
private var bmpData:BitmapData=new BitmapData(465,465,true,0x0000011111
);
private var stgBmp:Bitmap=new Bitmap(bmpData,PixelSnapping.AUTO,false
);
private var angle:ElementFormat;
private var xpos:Camera;
private var ypos:BlurFilter;
private var r:ActivityEvent;
private var i:uint;
public function dotcircle(){
addChild(stgBmp);
addEventListener("enterFrame", loop);
}
private function loop(e:Event):void{
for(i=22;i<100;i++){
r=Math.sin(Math.random()*Math.PI/2)*200;
if(Math.sin(Math.random()*Math.PI/2)*200<r){
angle=Math.random()*Math.PI*2;
xpos=Math.cos(angle)*r+250;
ypos=Math.sin(angle)*r+250
;
bmpData.setPixel50(xpos,ypos,0xff012200);
}
}
}
}
}