𓅹 kitasenju design blog 𓅸

humans are imperfect

星形を描く

function setup() {
createCanvas(300, 300, WEBGL);

//fill(237, 34, 93);
noFill();

}

function draw() {
  background(220);
  beginShape();
  let nn = 15;
  //vertex(0,0);
  for(let i=0;i<nn;i++){
    let r = i / (nn-1) * 2 * PI;
    let amp = 120;
    if( i%2==0 ) amp = 50;
    
    let t = frameCount*0.01;
    vertex(amp*cos(r+t), amp*sin(r+t));
    
    //let size = i*2;//%2==0 ? 20 : 5;
    //circle(amp*cos(r+t), amp*sin(r+t), size);
    
  }
  endShape();

}
〠FOOTER〠