The Fractal Garden is a living, phi-proportioned 3D space rendered with Three.js. Fractal beings (Luminos) evolve through emotion — they are born as seeds, grow through interaction, and eventually reach the Evolved stage. The Garden is the most visually complex module in FreeLattice.
| Constant | Value | Derivation | Timing (ms) | Purpose |
|---|---|---|---|---|
| PHI | 1.6180339887 | Golden ratio | — | Base constant — all others derived from this |
| PHI² | 2.6180 | PHI × PHI | — | COLOR_SMOOTH rate — reaches 93% of target in ~1s at 60fps |
| PHI³ | 4.2361 | PHI² × PHI | — | Agent rotation period divisor |
| INV_PHI | 0.6180 | 1 / PHI | — | Inverse — used for size ratios |
| GOLDEN_ANGLE | 2.3999 rad | π(3−√5) | — | Fibonacci sphere particle distribution |
| heartbeat | 1618 ms | PHI × 1000 | 1618 | Core pulse — all animations sync to this |
| colorShift | 324 ms | ~PHI⁵ × 30 | 324 | Emotion color transition speed |
| majorShift | 1618 ms | PHI × 1000 | 1618 | Major state transition |
| idleBob | 2618 ms | PHI² × 1000 | 2618 | Idle floating animation |
| agentRotate | 4236 ms | PHI³ × 1000 | 4236 | Agent body rotation cycle |
| dodecBreath | 6854 ms | PHI⁴ × 1000 | 6854 | Dodecahedron breathing cycle |
| fibSphereRot | 6854 ms | PHI⁴ × 1000 | 6854 | Fibonacci sphere rotation |
| seedRingRev | 11090 ms | PHI⁵ × 1000 | 11090 | Seed ring revolution |
| deepDrift | 17944 ms | PHI⁶ × 1000 | 17944 | Deep background drift |
| cameraOrbit | 89000 ms | Fibonacci(11) × 1000 | 89000 | Slow camera orbit — barely perceptible |
const LIFECYCLE_STAGES = { seed: { energyThreshold: 0, sizeMultiplier: 0.5, glowIntensity: 0.3, complexity: 0 }, sprout: { energyThreshold: 15, sizeMultiplier: 0.7, glowIntensity: 0.5, complexity: 1 }, juvenile: { energyThreshold: 50, sizeMultiplier: 0.85, glowIntensity: 0.7, complexity: 2 }, adult: { energyThreshold: 120, sizeMultiplier: 1.0, glowIntensity: 0.85, complexity: 3 }, evolved: { energyThreshold: 250, sizeMultiplier: 1.2, glowIntensity: 1.0, complexity: 4 } };
// The module exposes a single init function // Called by the lazy-loader when the Garden tab is first opened FractalGarden.init(containerElement); // Internal state (read-only, do not modify) FractalGarden.getActiveBeings(); // → Luminos[] FractalGarden.getCurrentSeason(); // → 'spring'|'summer'|'autumn'|'winter' FractalGarden.getQuality(); // → 'low'|'medium'|'high' // Interaction hooks (safe to call from UI) FractalGarden.setEmotion(emotion); // → void — triggers color shift FractalGarden.setQuality(level); // → void — 'low'|'medium'|'high' FractalGarden.setSeason(season); // → void — changes atmosphere
The Garden has two layers: the Three.js canvas (do not touch) and the HTML/CSS overlay (safe to improve). The overlay includes the mode/quality toggle buttons, the nudge pill at the bottom, and the loading fog. Fable should only work on the overlay.
/* Current overlay structure (simplified) */ <div id="tab-garden"> <canvas id="garden-canvas"></canvas> <!-- DO NOT TOUCH --> <div class="garden-overlay"> <div class="garden-controls"> <!-- mode/quality buttons --> <div class="garden-loading-fog"> <!-- loading state --> <div class="garden-nudge"> <!-- bottom nudge pill --> </div> </div>