第二个平滑旋转

Smooth rotation with second

想知道有没有办法让圆的旋转更顺畅?

这是我目前拥有的:

  let angle = 0;
  let pointCount = 12;
  let speed;
  strokeWeight(60);

  rotate(second());
  for(let i = angle; i < radians(360 + angle) ; i += radians(360 / pointCount)){
    let x = width / 2 * Math.cos(i);
    let y = width / 2 * Math.sin(i);
    point(x, y)
  }

旋转每秒都在跳跃,但我希望它能平稳移动。

我使用旋转是因为我认为这是最简单的方法,但如果不方便请告诉我是否应该尝试其他方法。

使用millis()函数:

Returns the number of milliseconds (thousandths of a second) since starting the sketch [...]

rotate() 天使的默认单位是弧度。如果你想要每秒一个完整的 ture,你必须将毫秒数缩放 2*PI / 1000:

rotate(millis() * 2*PI / 1000);