xxxxxxxxxx
let a=0
function setup() {
createCanvas(w=1024,h=768);
colorMode(HSB);
background(255);
smooth()
}
function draw() {
translate(w/2, h/2);
background(0,10);
noStroke();
fill(255);
ellipse(0,0,5,5);
for(i=0; i<4*360; i++){
push()
rotate(i);
fill((frameCount+a*10000)%360, 80, 100);
atomo(i/10);
pop();
}
}
function atomo(r) {
ellipse(350*cos(a/r),50*sin(a/r), 5,5);
a=a+0.00005
}
let lapse = 0; // mouse timer
function mousePressed(){
// prevents mouse press from registering twice
if (millis() - lapse > 400){
save("img_" + month() + '-' + day() + '_' + hour() + '-' + minute() + '-' + second() + ".jpg");
lapse = millis();
}
}