forked from: forked from: forked from: FrocessingSample
see http://gihyo.jp/design/feature/01/frocessing/0001
// forked from nplusone's forked from: forked from: FrocessingSample
// forked from nutsu's forked from: FrocessingSample
// forked from nutsu's FrocessingSample
// see http://gihyo.jp/design/feature/01/frocessing/0001
package {
import frocessing.display.*;
import flash.filters.BlurFilter;
import flash.geom.Point;
import flash.display.StageQuality;
[SWF(width="450", height="450", frameRate="60")];
public class FrocessingSample extends F5MovieClip2DBmp {
private var stage_width:Number = 465;
private var stage_height:Number = 465;
private var n:int = 5;
private var t:Number = 0;
private var c:Number = 2.2;
private var d:Number = 0;
private var xx:Number;
private var yy:Number;
public function FrocessingSample() {
super();
stage.quality = StageQuality.HIGH;
}
public function setup():void {
size( stage_width, stage_height );
background( 255,255,255 );
noFill();
colorMode( HSV, 2, 1, 1 );
}
public function draw():void {
if ( isMousePressed ) {
background( 255,255,255 );
}
translate( 0, stage_height/2 );
stroke( c, 0.5, 0.9, 0.3 );
beginShape();
curveVertex( -100, 0 );
for (var i:int=0; i<=n; i++) {
xx = i * stage_width / n - noise(10);
if(i<3){
yy = noise( (i+3) * 0.5, t ) * 200;
}
else{
yy = noise( i * 0.5, t ) * 300 - 200;
}
curveVertex( xx, yy );
}
curveVertex( stage_width+100, 0 );
endShape();
t+=0.009;
c+=0.001;
d++;
if (d % 10 == 0) bitmapData.applyFilter(bitmapData, bitmapData.rect, new Point(), new BlurFilter(0.5, 0.5, 3));
}
}
}