A golden-ratio tiling that spirals outward forever — and loops seamlessly.
The Fibonacci tiling — the one that traces a golden spiral through nested squares of side 1, 1, 2, 3, 5, 8, 13… — drawn live and forever zooming outward. Because each turn of the spiral is exactly φ² bigger than the last, the animation can zoom out by that factor and land back where it started: a seamless, endless windmill. It’s all white lines on black, and every line is math, not geometry.
There is no list of rectangles stored anywhere. Each square is a
abs() so only the edge is near zero — an outline instead of a filled box. The
float dist = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
return abs(dist + w*2.0) - w; // distance to the outline, width wThe loop carries four numbers in an ivec4 and grows them by the Fibonacci rule — each new side is the sum of the previous two — stamping a square on alternating axes each step. No array, no recursion; the sequence 2, 3, 5, 8, 13, 21, 34, 55 simply unrolls itself.
for (ivec4 n = ivec4(1,1,2,3); n.z < 56; ) {
bw = min(bw, drawSquare(p, vec2(0,n.y), vec2(n.zw), lineWidth));
n.xz += n.yw;
bw = min(bw, drawSquare(p, vec2(n.x,0), vec2(n.zw), lineWidth));
n.yw += n.xz;
}The spiral is drawn once, in a single quadrant — then the plane is 90° wedge, and convert back:
p = length(p) * cos( mod(atan(p.y,p.x), PI/2.) - vec2(PI/2., 0) );That’s the move that earns the name windmill. (Trick courtesy of Fabrice Neyret.)
Time t sweeps from 0 to 2 and back. Across one sweep the 0.618² ≈ φ⁻² — one whole step of the sequence — so the frame at the end is geometrically identical to the start, just shifted one square along. New 89×89 and 144×144 squares slide in from the edges right as the old ones scale past, hiding the loop point. A gentle