forked from: Drawing Flower with Frocessing
forked from Drawing Flower with Frocessing (diff: 1)
ActionScript3 source code
/**
* Copyright vlad.el.rojo ( http://wonderfl.net/user/vlad.el.rojo )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/kUxN
*/
// forked from utabi's Drawing Flower with Frocessing
package {
import flash.geom.Point;
import frocessing.display.*;
[SWF(width="465", height="465", frameRate="60")]
public class Flower extends F5MovieClip2DBmp{
private var stage_width:Number = 465;
private var stage_height:Number = 465;
private var t:Number = 55;
private var division:int = 10;
private var innerRadius:int = 40;
private var outerRadius:int = 185;
public function Flower() {
super();
}
public function setup():void {
size( stage_width, stage_height );
background( 0 );
//noFill();
stroke( 255, .5 );
}
public function draw():void {
//if ( isMousePressed )
background(0,1);
translate( stage_width/2 , stage_height / 2 );
beginShape();
for(var i:int =-1; i < division ; i++){
var radianTop:Number = (360/division)*(i+0.5+t) * Math.PI / 180;
var radianBottom:Number = (360/division)*(i+1+t) * Math.PI / 180;
var topPoint:Point = new Point(
Math.cos(radianTop)*outerRadius,
Math.sin(radianTop)*outerRadius
);
var bottomPoint:Point = new Point(
Math.cos(radianBottom)*innerRadius,
Math.sin(radianBottom)*innerRadius
);
curveVertex( topPoint.x, topPoint.y );
curveVertex( bottomPoint.x, bottomPoint.y );
}
curveVertex(
Math.cos((360/division)*(.5+t) * Math.PI / 180)*outerRadius,
Math.sin((360/division)*(.5+t) * Math.PI / 180)*outerRadius
);
endShape();
//t += 0.05;
if(division > 1000){
division = 1;
} else {
division ++;
}
}
}
}
