xxxxxxxxxx
float rmax;
float radiusNoise = random(10);
float colorNoise = random(10);
boolean fill_ = true;
float pX,pY,X,Y;
void setup(){
size(851,361);
rmax = 30;
noStroke();
colorMode(HSB);
background(0,0,255);
X = random(width);
Y = random(height);
pX = width/2;
pY = height/2;
}
void draw(){
float dx = (X - pX)/100.0;
float dy = (Y - pY)/100.0;
float r = rmax/(30*dist(dx,dy,0,0) + 1);
if(dx!= 0 && dy != 0){
ellipse(X,Y,r,r);
float rin = 0;
for(int i = 0 ; i < 100 ; i ++ ){
if(fill_)
fill(noise(colorNoise)*300,255,255);
else
fill(0,0,255);
colorNoise+=0.001;
rin = noise(radiusNoise)*r;
ellipse(X+dx*i,Y+dy*i,rin,rin);
radiusNoise+=0.1;
}
}
X = mouseX; //pX + random(-r,r);
Y = mouseY;//pY + random(-r,r);
pX = pmouseX + random(-50,50);
pY = pmouseY+ random(-50,50);
r = dist(pX,pY,X,Y);
}
void mouseReleased(){
if(mouseButton==RIGHT)
fill_ = !fill_;
}