diff --git a/index.html b/index.html index e7f7c8f..558b95f 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ - + diff --git a/stack.js b/stack.js index 893f8e1..24c8875 100644 --- a/stack.js +++ b/stack.js @@ -24,6 +24,9 @@ const ROTATE_X = [Math.cos(0.1), Math.sin(0.1)]; const ROTATE_Y = [Math.cos(-0.15), Math.sin(-0.15)]; const TURN_SECONDS = 48; + // The discs turn together, like a planet's body. The brim's strips circle like its rings: the top + // one keeps the discs' pace and each one below lags a little, so nothing moves faster than the discs. + const RING_SPEEDS = [1, 0.85, 0.7]; const SPOKES = 96; const ROWS = 3; const RINGS = 5; @@ -401,7 +404,7 @@ ctx.clearRect(0, 0, width, canvas.height); const lit = Math.max(...layers.map((layer) => layer.glow)); const phase = angle / (T1 - T0); - const flows = stripParts.map((part) => part.dots(phase)); + const flows = stripParts.map((part) => part.dots(phase * RING_SPEEDS[Math.min(part.strip, RING_SPEEDS.length - 1)])); // Back to front: the brim behind the column, the column from its base up, then the brim in front. // Each shape first hides whatever it covers. const paintStrips = (front) => {