xxxxxxxxxx
// Inspired by Anthony Howe - Di-Octo
// https://www.howeart.net/
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
}
function draw() {
background("white");
if (mouseIsPressed) {
stroke(0);
} else {
// lighting
noStroke();
directionalLight(color("white"), 0, 0, -1);
}
// camera control
rotateY((mouseX / width) * PI);
rotateZ((mouseY / height) * PI);
// ring
push();
rotateX(PI / 2);
torus(300, 8);
pop();
// feathers
const angle = -frameCount / 30;
for (let i = 24; i--; ) {
rotateY(TWO_PI / 24);
push();
translate(300, 0, 0);
rotateZ(angle);
push();
for (let j = 2; j--; rotateZ(PI)) {
let featherSize = 70;
push();
for (let k = 12; k--; ) {
push();
translate(10, 0, 0);
box(20, 5, 5);
pop();
translate(20, 0, 0);
rotateZ(0.1);
push();
rotateY(PI / 2);
plane(featherSize);
featherSize *= 0.9;
pop();
}
pop();
}
pop();
pop();
}
}