๐ŸŽ‡ Arc Animation

BamgasiJMยท2025๋…„ 12์›” 26์ผ

p5.js Art

๋ชฉ๋ก ๋ณด๊ธฐ
41/65
post-thumbnail

๐Ÿ“ p5.js

const num = 20;
let step, theta;

function setup() {
  createCanvas(600, 600);
  strokeWeight(5);
  step = 22;
  theta = 0;
}

function draw() {
  background(20);
  translate(width / 2, height * 0.75);

  for (let i = 0; i < num; i++) {
    stroke(200);
    noFill();
    const size = i * step;
    const offSet = (TWO_PI / num) * i;
    // sin ๊ฐ’์„ 0.001~1 ๋ฒ”์œ„๋กœ ๋งคํ•‘ํ•˜์—ฌ arcEnd๊ฐ€ ํ•ญ์ƒ PI๋ณด๋‹ค ํฌ๋„๋ก ์„ค์ •
    const arcEnd = map(sin(theta + offSet), -1, 1, PI + 0.001, TWO_PI);
    arc(0, 0, size, size, PI, arcEnd);
  }
  resetMatrix();
  theta += 0.03;
}

profile
Coding Art with Blender / oF / Processing / p5.js / nannou

0๊ฐœ์˜ ๋Œ“๊ธ€