fractalkitty looking for math? fractalkitty.com

early works

glare

#trig#3d#interactive#animation#accumulates#sky#light

a=20;
r=1;
n=1;
function setup(){
  createCanvas(windowWidth,windowHeight,WEBGL);
  fill(255,255,255,100);
  ambientLight(255);
  angleMode(DEGREES);
  background(0);
  noStroke();
}
function draw(){
  t=abs(400*sin(frameCount/10));
  fill(255*sin(t/2),255*cos(t),255*sin(t/10),20/(n+1));
  
  for(let i=0;i<n;i++){
    x=r*t*cos(a*t+30*i);
    y=r*t*sin(a*t+30*i);
    z=t;
    push()
      translate(x,y,z);
      sphere(20,12,12);
    pop()
    push()
      translate(-x,-y,z);
      sphere(20,12,12);
    pop()
  }
  
}
function mousePressed(){
  fill(0,0,0,180);
  if(n<13){
    n++
  }else{
    n=1;
  }
  
  plane(windowWidth,windowHeight)
  frameCount=0;
}