fractalkitty looking for math? fractalkitty.com

all

Enneper

#trig#3d#interactive#animation#study#math

enneperangle


let enneper;
let angle = 0;

function preload() {
  enneper = loadModel("/assets/enneper.obj", true);
}

function setup() {
  createCanvas(windowWidth, windowHeight, WEBGL);
}

function draw() {
  background(20);
  orbitControl(3, 3, 0.1);
  ambientLight(60, 60, 60);
  directionalLight(255, 255, 255, 1, 1, -1);
  scale(1);
  for (let i = 1; i <= 6; i++) {
    push();

    rotateX(PI / 2);
    rotateY(((2 * PI) / 6) * i);
    rotateZ(((2 * PI) / 6) * i + 2 * PI * sin(i * angle));
    translate(0, 0, width / 4);

    normalMaterial();
    model(enneper);
    pop();
    push();

    rotateZ(((2 * PI) / 6) * i);
    rotateZ(((2 * PI) / 6) * i + 2 * PI * (i * cos(angle)));
    translate(0, 0, width / 4);

    normalMaterial();
    model(enneper);
    pop();
  }

  angle += 0.001;
}

function windowResized() {
  resizeCanvas(windowWidth, windowHeight);
}