forked from: code on 2008-12-18
// forked from nutsu's code on 2008-12-18
// write as3 code here..
package{
import frocessing.display.F5MovieClip3D;
[SWF(frameRate="60", backgroundColor="#000000")]
public class CurveTest extends F5MovieClip3D
{
private var num:int = 300;
private var a:Number = 0;
private var ss:Number = 100;
private var vsa:Number = 0;
public function CurveTest()
{
super();
colorMode( RGB, num*2 );
noFill();
perspective(PI/2);
}
public function draw():void
{
translate( fg.width/2, fg.height/2, -100 + mouseY );
rotateY(a);
//rotateX(a/3);
vsa+=(mouseX*0.01*PI - vsa)*0.05;
beginShape();
for( var i:int=0;i<num;i++)
{
stroke( i + num );
var vy:Number = ss*cos(i*1)*sin(i*1);
var vx:Number = ss*cos(i*1)*cos(i*1);
var vz:Number = ss*sin(i*1);
moveToLast();
curveVertex3d( vx, vy, vz );
}
endShape();
a += 0.01;
}
}
}