78



import processing.opengl.*;

int NUM = 5000;
float[]x = new float[NUM];
float[]y = new float[NUM];
float[]z = new float[NUM];
color[]col = new color[NUM];

void setup(){
size(400,400,OPENGL);
colorMode(HSB,360,100,100,100);
frameRate(30);
noFill();
stroke(200,100,100,20);
strokeWeight(1);
smooth();
for(int i =0; i < NUM; i ++){
x[i] = random(width);
y[i] = random(height);
z[i] = random(-5000,0);
col[i] = color(random(200,240),random(50,100),random(100));
}
}

void draw(){
background(0);
for(int i =0; i < NUM; i ++){
stroke(color(col[i]));
line(x[i],y[i],z[i],x[i],y[i],z[i]+100);
z[i]+= 40;
if(z[i]>100){
z[i] -= 5000;
}
}
}

void mousePressed(){
save("78.jpg");
}

コメント