Here is the code for those who just want a glance:
Quote:
import processing.opengl.*;
int polygons = 50;
int counter=0;
float hue = 0;
float x,y,z,vx,vy,vz;
float frames = 0;
float thisTime,lastTime;
void setup(){
size(1280,800,OPENGL);
// framerate(100);
colorMode(HSB,1);
noStroke();
x=0;
y=0;
z=0;
thisTime = 0;
lastTime = 0;
textFont(loadFont("V.vlw"),60);
textAlign(CENTER);
}
void draw(){
background(0);
if(counter++%40==0){
lastTime = thisTime;
thisTime = millis();
frames = roundTo(40*1000/(thisTime-lastTime),3);
fill(1);
println(frames + " ["+polygons+"]");
}
fill(1);
textSize(80);
text( frames ,width/2,height/2);
textSize(40);
text( polygons+" polygons",width/2,height/2+80);
translate(250,0,0);
beginShape(TRIANGLE_STRIP);
for(int i=0;i<polygons;i++){
hue += .001;
while(hue>.3)
hue=0;
fill(hue,1,1,.1);
x = noise(x,y,z) * 800;
y = noise(y,z,x) * 800;
z = noise(z,x,y) * 800;
vertex(x,y,z);
}
endShape();
}
void mousePressed(){
polygons = polygons*2;
}
float roundTo(float num, int places){
float multi = pow(10,places);
num = round(num*multi);
return num/multi;
}