fractalkitty looking for math? fractalkitty.com

100 days of code

figure8Immersion

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

theta

let r=2.5;
function setup(){
  createCanvas(600,600,WEBGL);
  angleMode(DEGREES);
  fill(100,100,100,30);
  noStroke();//strokeWeight(0.2)
}
function draw(){
  background(0)
  orbitControl();
  rotateZ(frameCount);
  rotateY(frameCount);
  pointLight(100,100,100,0,300,1200)
  pointLight(100,100,100,0,-300,-1200)
  for(let v=0;v<361;v=v+7){
    specularMaterial(50*cos(v/2),205*sin(v/2),255*sin(v/2))
    for(let theta=0;theta<361;theta=theta+7){
    x=(r+cos(theta/2)*sin(v)-sin(theta/2)*sin(2*v))*cos(theta);
    y=(r+cos(theta/2)*sin(v)-sin(theta/2)*sin(2*v))*sin(theta);
    z=sin(theta/2)*sin(v)+cos(theta/2)*sin(2*v);
    push()
    translate(50*x,50*y,50*z);
    plane(40,40,40)
    pop()
  }
  }
}