forked from: FrocessingSample
see http://gihyo.jp/design/feature/01/frocessing/0001
PS3っぽくしてみたかったけど、難しい・・・
@matsu4512さんに協力していただきました、ありがとうございます
/**
* Copyright aomoriringo ( http://wonderfl.net/user/aomoriringo )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/f3v2
*/
// forked from nutsu's FrocessingSample
//see http://gihyo.jp/design/feature/01/frocessing/0001
/*
PS3っぽくしてみたかったけど、難しい・・・
@matsu4512さんに協力していただきました、ありがとうございます
*/
package {
import flash.filters.ColorMatrixFilter;
import flash.geom.Point;
import frocessing.display.*;
[SWF(width="465", height="465", frameRate="60", backgroundColor="0x000000")]
public class frocessingSample extends F5MovieClip2DBmp{
private var stage_width:Number = 465;
private var stage_height:Number = 465;
private var n:int = 2;
private var t:Number = 0;
private var c:uint = 0;
private var pt:Point = new Point();
private var mtx:ColorMatrixFilter = new ColorMatrixFilter([0.98, 0, 0, 0, 1,
0, 0.98, 0, 0, 1,
0, 0, 0.98, 0, 1,
0, 0, 0, 0.98, 1])
public function frocessingSample() {
super();
}
public function setup():void {
size( stage_width, stage_height );
background(0 ,1);
colorMode("hsv", 255, 1, 1);
noFill();
}
public function draw():void {
translate( 0, stage_height / 2 );
stroke(c, 1, 1);
myDrawSpline(-30, 1.4, 0.25);
myDrawSpline( 0, 1.0, 0.6);
myDrawSpline( 30, 1.2, 0.4);
t+=0.0015;
c++;
this.bitmapData.applyFilter(this.bitmapData, this.bitmapData.rect, pt , mtx );
}
public function myDrawSpline(m:int, k:Number, p:Number):void{
beginShape();
curveVertex( -100, m );
for ( var i:int=0; i <= n; i++ ){
var xx:Number = i * stage_width / n;
var yy:Number = noise( i * p, t*k ) * 300 - 150;
curveVertex( xx, yy+m );
}
curveVertex( stage_width+100, m );
endShape();
}
}
}