Any help for making this more robust and dynamic is appreciated. Enjoy:
// Josh Shanholtz's 3D Bounce 2/16/2011 written in processing 1.2.1
//
http://www.processing.org/ // Click mouse to add spheres and wear 3D anaglyph glasses for full effect.....
import processing.opengl.*;
float l;
int m;
int MAX = 1000;
float spring = 0.03;
float gravity = 0.001;
float friction = -0.09;
float q = 1;
boolean u = true;
Ball[] bBalls = new Ball[MAX];
int mouseclick;
float x;
float fc;
int r;
stroke(c2,f*.65); // ...(,f*.8) = fade in 3d "z" world
pushMatrix();
translate(x+(f*.02)*diameter/15,y,diameter);
rotateX(a/13);
rotateY(az/13);
rotateZ(a/13);
sphere(diameter); // Originally (diameter*1.3)
popMatrix();