I've been experimenting with this one for fun, but it's doing something I rather it didn't. If you copy the code and observe it, you'll notice that a 3D trail of ellipses follows your mouse and changes constantly in size/color. After a while, however, the size changing stops and it's just a solid tube trailing after the mouse. If you click, you can erase and start a clean slate, but the size changing is still stopped. How can I fix it so it will continue to "jitter" size like at the beginning for a while longer?
Here it is:
Code:float speed2=1;
float gravity=0.1;
float x, y, mx, my,speed;
void setup(){
size(900,600);
background(0);
smooth();
}
void draw(){
mx = mx + (mouseX-mx)/200;
my += (mouseY-my)/200;
speed=speed+gravity;
x=x+ speed;
y=y+speed2;
if((x>height)|| (x<0)){
speed=speed*-1;
}
if((y>width)|| (y<0)){
speed2=speed2*-1;
}
stroke(0,0,0,100);
fill(x,y,255,100);
ellipse(mx+random(2),my+random(2),x/6,x/6);
if(mousePressed){
background(0);
}
}