This sketch is created with an older version of Processing,
and doesn't work on browsers anymore.
xxxxxxxxxx
int mom=0;
int mom1=0;
void setup()
{
size (600, 600, P3D);
frameRate(1);
}
void draw()
{
int f=int(random(0,256));
int fc=int(random(0,256));
int fb=int(random(0,256));
//f++;
background(f,fc,fb);
lights();
int x=1;
int g=int(random(0, 2));
while (x<101)
{
if (g==1)
{
pushMatrix();
int p= int(random(0, 600));
int d= int(random(0, 600));
int z= int(random(-600, 0));
int q= int(random(5, 50));
int c= int(random(0, 256));
int o=int(random(0, 256));
int l= int(random(0, 256));
float w=random(-1, 1);
noStroke();
fill(c, o, l);
translate(p, d, z);
sphere(q);
x++;
popMatrix();
}
if (g==0)
{
pushMatrix();
int p= int(random(0, 600));
int d= int(random(0, 600));
int z= int(random(-200, 0));
int q= int(random(5, 50));
int c= int(random(0, 256));
int o=int(random(0, 256));
int l= int(random(0, 256));
float w=random(-1, 1);
strokeWeight(2);
stroke(0,0,0);
fill(c, o, l);
translate(p, d, z);
rotateX(w);
rotateY(w);
rotateZ(w);
w++;
box(q);
x++;
popMatrix();
}
}
}