fractalkitty looking for math? fractalkitty.com

early works

knottedRibbons

#trig#3d#interactive#animation#math#topology#mathober

let q=2,p=3,a=50;
function setup(){
  createCanvas(windowWidth,windowHeight,WEBGL);
  angleMode(DEGREES);
  noStroke();
  a=min(width,height)/12
}

function draw(){
  background(0)
  orbitControl()
  t=frameCount;
  pointLight(250,250,250,200,200,200)
  pointLight(250,250,250,-200,-200,-200)
  for (let i=0;i<=360;i=i+0.2){
    x=a*cos(q*i+t)*(3+cos(p*i+t))
    y=a*sin(q*i+t)*(3+cos(p*i+t))
    z=a*sin(p*i)
    fill(100+z*3)
    push()
    translate(x,y,z)
    sphere(z/p,24,24)
    pop()
  }
}

function keyPressed(){
  if(p<15){
    p++
    q++;
  }else{q=2;p=3}
}