forked from: F5GraphicsSample6
/**
* Copyright albatrus_jp ( http://wonderfl.net/user/albatrus_jp )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/iVzK
*/
// forked from nutsu's F5GraphicsSample6
// forked from nutsu's F5GraphicsSample5
// forked from nutsu's F5GraphicsSample3
// forked from nutsu's F5GraphicsSample2
package {
import flash.display.Sprite;
import frocessing.core.F5Graphics2D;
[SWF(width=465,height=465,backgroundColor=0)]
public class F5GraphicsSample6 extends Sprite {
private var fg:F5Graphics2D;
public function F5GraphicsSample6() {
fg = new F5Graphics2D( graphics );
fg.strokeCap("none");
//線の先端形状
fg.colorMode( "hsv", 465, 1, 465 ); //HSVモード
for ( var i:int = 0 ; i < 400; i++ ) {
var cx:Number = Math.random()*465;
var cy:Number = Math.random()*465;
if ( Math.random() > 0.5 ) {
fg.noStroke();
fg.fill( cx, 1, cy, 0.25 );
}else {
fg.noFill();
fg.strokeWeight( Math.random()*3 );
fg.stroke( cx, 1, cy );
}
//位置と大きさを指定して描画、キャンパスの変形
fg.pushMatrix();//変形を保存
fg.translate( cx, cy );
fg.rotate(Math.random()* 2* Math.PI);
fg.scale( Math.random()*20 );
drawFig(); // 下記の関数を呼び出している
fg.popMatrix(); //直前に保存した変形状態へ復帰
}
}
private function drawFig():void {
fg.circle( 0, 0, 0.5);
//circleは円をあらわす関数。
fg.arc(0,0,1.0,2.0,0.1,2* Math.PI - 0.1);
//arcは円弧を表現する関数。
}
}
}