返回
function setup() { createCanvas(windowWidth, windowHeight); background(0); // noStroke() colorMode(HSB, 100) } let theta = 0 let thetaDelta = 4.01 let j = 0 let jDelta = 5.21 let lastX let lastY let rotateRadian = 0 let scaleDelta = 0 let stop = true function draw() { translate(width / 2, height / 2) rotate(rotateRadian) rotateRadian += 0.1 if (theta >= 6 * 360) { background(0) thetaDelta = random(1, 5) theta = 0 j = 0 jDelta = random(0, 10) } theta += thetaDelta const radius = 100 stroke((frameCount * 0.05) % 100, 50, 100, 20) let x = (radius) * Math.cos(theta * 1.2) let y = (radius) * Math.sin(theta * 1.2) const newX = x + 100 * cos(j * Math.PI * 2.1) const newY = y + 100 * sin(j * Math.PI * 2.1) circle(newX, newY, 2); if (typeof lastX != 'undefined') { line(lastX, lastY, newX, newY) } lastX = newX lastY = newY j += 5.21 } function mouseClicked() { stop = false }