Prompt specification
Build or customize the Three.js 3D scene "Crystal-history chocolate exhibit" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Crystal-history chocolate exhibit
Category: Everyday & Industrial · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/crystal-history-chocolate-exhibit-x0092
Scene Description Prompt:
Crystal-history chocolate exhibit. Create a classroom exhibit with labeled symbolic crystal arrangements and chocolate samples; changing a fictional cooling schedule changes the displayed structure, explicitly avoiding a practical tempering recipe. Please build this with Three.js from cdnjs in one self-contained HTML file, using low-poly forms.
Working Three.js Starter (crystal-history-chocolate-exhibit-x0092):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta
name="description"
content="An interactive classroom exhibit imagining chocolate history through symbolic crystal structures."
>
<title>Crystal / Memory — Chocolate History Exhibit</title>
<style>
:root {
--ink: #fff8ee;
--muted: #c7b9ae;
--panel: #21161d;
--panel-2: #2b1d25;
--line: rgba(255, 238, 218, 0.14);
--gold: #e8b46c;
--accent: #a996ff;
--shadow: rgba(5, 2, 6, 0.42);
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
min-height: 100%;
background: #160d13;
color: var(--ink);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
body {
min-height: 100vh;
overflow-x: hidden;
}
button {
font: inherit;
}
button:focus-visible {
outline: 2px solid var(--gold);
outline-offset: 3px;
}
.masthead {
min-height: 88px;
padding: 18px 28px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
border-bottom: 1px solid var(--line);
background:
linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 45%),
#180e14;
position: relative;
z-index: 5;
}
.brand {
display: flex;
align-items: center;
gap: 16px;
min-width: 0;
}
.museum-mark {
width: 44px;
height: 44px;
flex: 0 0 auto;
border: 1px solid rgba(232, 180, 108, 0.58);
border-radius: 50%;
display: grid;
place-items: center;
color: var(--gold);
box-shadow: inset 0 0 0 5px rgba(232, 180, 108, 0.04);
}
.museum-mark svg {
width: 24px;
height: 24px;
}
.eyebrow {
margin: 0 0 5px;
color: var(--gold);
font-size: 0.68rem;
font-weight: 750;
letter-spacing: 0.18em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(1.35rem, 2.5vw, 2.1rem);
font-weight: 500;
line-height: 1;
letter-spacing: -0.025em;
}
.masthead-actions {
display: flex;
align-items: center;
gap: 10px;
flex: 0 0 auto;
}
.quiet-button {
border: 1px solid var(--line);
background: rgba(255, 255, 255, 0.035);
color: var(--ink);
border-radius: 999px;
padding: 10px 15px;
cursor: pointer;
transition:
background 160ms ease,
border-color 160ms ease,
transform 160ms ease;
}
.quiet-button:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 238, 218, 0.28);
transform: translateY(-1px);
}
.layout {
min-height: calc(100vh - 88px);
display: grid;
grid-template-columns: minmax(0, 1fr) 350px;
}
.scene {
min-width: 0;
min-height: 680px;
position: relative;
isolation: isolate;
overflow: hidden;
background:
radial-gradient(circle at 50% 38%, rgba(118, 75, 102, 0.22), transparent 35%),
radial-gradient(circle at 50% 100%, rgba(232, 180, 108, 0.08), transparent 42%),
linear-gradient(160deg, #21121d 0%, #160d13 65%);
}
#canvas-host {
position: absolute;
inset: 0;
}
#canvas-host canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
#canvas-host canvas:active {
cursor: grabbing;
}
.scene-title {
position: absolute;
z-index: 2;
top: 26px;
left: 28px;
max-width: 430px;
pointer-events: none;
text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}
.scene-title h2 {
margin: 8px 0 10px;
max-width: 390px;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(1.8rem, 3.6vw, 3.5rem);
font-weight: 400;
line-height: 0.98;
letter-spacing: -0.045em;
}
.scene-title p:last-child {
margin: 0;
max-width: 350px;
color: var(--muted);
font-size: 0.9rem;
line-height: 1.55;
}
.scene-tools {
position: absolute;
z-index: 3;
top: 24px;
right: 22px;
display: flex;
gap: 8px;
}
.tool-button {
width: 40px;
height: 40px;
display: grid;
place-items: center;
border: 1px solid var(--line);
border-radius: 50%;
color: var(--ink);
background: rgba(24, 14, 20, 0.72);
backdrop-filter: blur(10px);
cursor: pointer;
}
.tool-button:hover,
.tool-button[aria-pressed="true"] {
border-color: rgba(232, 180, 108, 0.65);
color: var(--gold);
}
.tool-button svg {
width: 18px;
height: 18px;
}
.interaction-hint {
position: absolute;
z-index: 2;
right: 24px;
bottom: 22px;
margin: 0;
padding: 8px 11px;
color: rgba(255, 248, 238, 0.68);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 999px;
background: rgba(22, 13, 19, 0.55);
font-size: 0.72rem;
letter-spacing: 0.03em;
pointer-events: none;
}
.scene-caption {
position: absolute;
z-index: 2;
left: 26px;
bottom: 22px;
display: flex;
align-items: center;
gap: 10px;
padding: 9px 12px;
border-left: 2px solid var(--accent);
background: rgba(20, 12, 17, 0.62);
color: rgba(255, 248, 238, 0.75);
font-size: 0.74rem;
line-height: 1.35;
backdrop-filter: blur(8px);
}
.scene-caption strong {
color: var(--ink);
font-weight: 650;
}
.panel {
padding: 25px 22px 30px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 20%),
var(--panel);
border-left: 1px solid var(--line);
overflow-y: auto;
}
.panel-heading {
margin-bottom: 8px;
}
.panel h2 {
margin: 0 0 8px;
font-family: Georgia, "Times New Roman", serif;
font-size: 1.65rem;
font-weight: 400;
line-height: 1.1;
}
.panel-intro {
margin: 0 0 20px;
color: var(--muted);
font-size: 0.86rem;
line-height: 1.55;
}
.schedule-label {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 0 10px;
color: var(--gold);
font-size: 0.68rem;
font-weight: 750;
letter-spacing: 0.13em;
text-transform: uppercase;
}
.schedule-label span:last-child {
color: var(--muted);
font-size: 0.59rem;
letter-spacing: 0.08em;
}
.schedule-list {
display: grid;
gap: 9px;
}
.schedule-card {
width: 100%;
display: grid;
grid-template-columns: 34px 1fr auto;
align-items: center;
gap: 10px;
padding: 12px;
text-align: left;
color: var(--ink);
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.025);
cursor: pointer;
transition:
border-color 170ms ease,
background 170ms ease,
transform 170ms ease;
}
.schedule-card:hover {
border-color: rgba(255, 238, 218, 0.28);
transform: translateX(-2px);
}
.schedule-card.active {
border-color: var(--card-accent);
background:
linear-gradient(90deg, color-mix(in srgb, var(--card-accent) 13%, transparent), transparent),
rgba(255, 255, 255, 0.035);
box-shadow: inset 3px 0 0 var(--card-accent);
}
.schedule-number {
width: 32px;
height: 32px;
display: grid;
place-items: center;
border: 1px solid rgba(255, 255, 255, 0.13);
border-radius: 50%;
color: var(--card-accent);
font-family: Georgia, "Times New Roman", serif;
font-size: 0.9rem;
}
.schedule-name {
display: block;
margin-bottom: 3px;
font-family: Georgia, "Times New Roman", serif;
font-size: 1.05rem;
}
.schedule-structure {
display: block;
color: var(--muted);
font-size: 0.69rem;
}
.schedule-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--card-accent);
box-shadow: 0 0 12px var(--card-accent);
opacity: 0.4;
}
.schedule-card.active .schedule-dot {
opacity: 1;
}
.readout {
margin-top: 14px;
padding: 15px;
border: 1px solid var(--line);
border-radius: 12px;
background: #181017;
}
.readout-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 8px;
}
.readout h3 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 1.18rem;
font-weight: 400;
}
.live-badge {
padding: 5px 8px;
border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
border-radius: 999px;
color: var(--accent);
font-size: 0.58rem;
font-weight: 800;
letter-spacing: 0.1em;
text-transform: uppercase;
white-space: nowrap;
}
.readout p {
margin: 0;
color: var(--muted);
font-size: 0.79rem;
line-height: 1.55;
}
.symbol-key {
margin-top: 24px;
}
.section-label {
margin: 0 0 11px;
color: var(--gold);
font-size: 0.67rem;
font-weight: 750;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.key-row {
display: grid;
grid-template-columns: 12px 80px 1fr;
gap: 9px;
align-items: baseline;
padding: 9px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
font-size: 0.73rem;
line-height: 1.4;
}
.key-row:last-child {
border-bottom: 0;
}
.key-dot {
width: 7px;
height: 7px;
border-radius: 2px;
transform: rotate(45deg);
}
.key-row strong {
font-weight: 700;
}
.key-row span:last-child {
color: var(--muted);
}
.teaching-prompt {
margin-top: 22px;
padding: 15px;
border: 1px solid rgba(232, 180, 108, 0.24);
border-radius: 12px;
background: rgba(232, 180, 108, 0.055);
}
.teaching-prompt h3 {
margin: 0 0 6px;
color: var(--gold);
font-size: 0.68rem;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.teaching-prompt p {
margin: 0;
color: #ded0c5;
font-size: 0.8rem;
line-height: 1.55;
}
.disclaimer {
margin-top: 22px;
padding: 14px;
border: 1px solid rgba(255, 119, 119, 0.25);
border-radius: 12px;
background: rgba(120, 28, 36, 0.12);
}
.disclaimer strong {
display: block;
margin-bottom: 5px;
color: #ffb1aa;
font-size: 0.72rem;
letter-spacing: 0.04em;
}
.disclaimer p {
margin: 0;
color: #cdb9b5;
font-size: 0.72rem;
line-height: 1.5;
}
.sample-strip {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px;
margin-top: 18px;
}
.sample-chip {
padding: 9px 5px;
border: 1px solid var(--line);
border-radius: 8px;
color: var(--muted);
text-align: center;
font-size: 0.61rem;
line-height: 1.35;
}
.sample-chip strong {
display: block;
margin-bottom: 2px;
color: var(--ink);
font-size: 0.67rem;
}
dialog {
width: min(570px, calc(100vw - 32px));
padding: 0;
color: var(--ink);
border: 1px solid rgba(255, 255, 255, 0.18);
border-radius: 16px;
background: #241820;
box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}
dialog::backdrop {
background: rgba(8, 4, 7, 0.76);
backdrop-filter: blur(5px);
}
.dialog-content {
padding: 26px;
}
.dialog-content h2 {
margin: 0 0 13px;
font-family: Georgia, "Times New Roman", serif;
font-size: 1.8rem;
font-weight: 400;
}
.dialog-content p {
color: var(--muted);
font-size: 0.87rem;
line-height: 1.65;
}
.dialog-content .alert {
padding: 13px;
color: #ffe0dc;
border: 1px solid rgba(255, 119, 119, 0.28);
border-radius: 10px;
background: rgba(120, 28, 36, 0.16);
}
.dialog-content button {
margin-top: 8px;
}
.visually-hidden {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}
@media (max-width: 900px) {
.masthead {
min-height: 78px;
padding: 14px 18px;
}
.museum-mark {
width: 38px;
height: 38px;
}
.layout {
grid-template-columns: 1fr;
}
.scene {
min-height: 68vh;
}
.panel {
border-top: 1px solid var(--line);
border-left: 0;
}
.scene-title {
top: 20px;
left: 20px;
}
.scene-title p:last-child {
display: none;
}
.scene-tools {
top: 18px;
right: 16px;
}
.interaction-hint {
display: none;
}
}
@media (max-width: 560px) {
.masthead-actions .quiet-button:first-child {
display: none;
}
.brand {
gap: 10px;
}
.museum-mark {
display: none;
}
.scene-title h2 {
max-width: 260px;
font-size: 1.8rem;
}
.scene-caption {
left: 14px;
right: 14px;
bottom: 14px;
}
.schedule-card {
grid-template-columns: 32px 1fr auto;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
}
}
</style>
</head>
<body>
<header class="masthead">
<div class="brand">
<div class="museum-mark" aria-hidden="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4">
<path d="M12 2 21 8v8l-9 6-9-6V8l9-6Z"/>
<path d="m3 8 9 6 9-6M12 14v8M7.5 5l9 6"/>
</svg>
</div>
<div>
<p class="eyebrow">Museum Lab 04 · Interpretive Exhibit</p>
<h1>Crystal / Memory</h1>
</div>
</div>
<div class="masthead-actions">
<button class="quiet-button" id="about-button" type="button">About the model</button>
<button class="quiet-button" id="reset-top" type="button">Reset view</button>
</div>
</header>
<main class="layout">
<section class="scene" aria-label="Interactive three-dimensional classroom exhibit">
<div id="canvas-host"></div>
<div class="scene-title">
<p class="eyebrow">A fictional chocolate history</p>
<h2>How might a memory crystallize?</h2>
<p>
Three chocolate symbols sit beneath a structure that changes with an
invented schedule. Drag to orbit; scroll or pinch to zoom.
</p>
</div>
<div class="scene-tools" aria-label="3D view controls">
<button
class="tool-button"
id="orbit-button"
type="button"
aria-label="Toggle slow automatic orbit"
aria-pressed="false"
title="Slow automatic orbit"
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6">
<path d="M20 12a8 8 0 1 1-2.34-5.66"/>
<path d="M20 4v5h-5"/>
</svg>
</button>
<button
class="tool-button"
id="reset-button"
type="button"
aria-label="Reset camera view"
title="Reset camera"
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6">
<path d="M4 4v6h6M20 20v-6h-6"/>
<path d="M5.5 15a7.5 7.5 0 0 0 13 2M18.5 9a7.5 7.5 0 0 0-13-2"/>
</svg>
</button>
</div>
<div class="scene-caption">
<span class="key-dot" style="background: var(--accent)"></span>
<span><strong>Symbolic object:</strong> the crystals describe interpretation, not physical tempering.</span>
</div>
<p class="interaction-hint">Drag to orbit · Scroll to zoom · Double-click to reset</p>
</section>
<aside class="panel" aria-label="Exhibit interpretation and schedule controls">
<div class="panel-heading">
<p class="eyebrow">Choose a narrative</p>
<h2>Fictional cooling schedule</h2>
</div>
<p class="panel-intro">
Select a story beat. The central crystal formation responds to the chosen
narrative. These are invented names, not operating conditions.
</p>
<div class="schedule-label">
<span>Schedule chapters</span>
<span>No time · no temperature</span>
</div>
<div class="schedule-list" role="group" aria-label="Fictional schedule chapters">
<button
class="schedule-card active"
type="button"
data-schedule="0"
style="--card-accent: #a996ff"
aria-pressed="true"
>
<span class="schedule-number">I</span>
<span>
<span class="schedule-name">Quiet Archive</span>
<span class="schedule-structure">Ordered lattice</span>
</span>
<span class="schedule-dot" aria-hidden="true"></span>
</button>
<button
class="schedule-card"
type="button"
data-schedule="1"
style="--card-accent: #ff9567"
aria-pressed="false"
>
<span class="schedule-number">II</span>
<span>
<span class="schedule-name">Crosscurrent</span>
<span class="schedule-structure">Braided memory</span>
</span>
<span class="schedule-dot" aria-hidden="true"></span>
</button>
<button
class="schedule-card"
type="button"
data-schedule="2"
style="--card-accent: #f06478"
aria-pressed="false"
>
<span class="schedule-number">III</span>
<span>
<span class="schedule-name">Ember Recall</span>
<span class="schedule-structure">Faceted afterimage</span>
</span>
<span class="schedule-dot" aria-hidden="true"></span>
</button>
</div>
<section class="readout" aria-live="polite">
<div class="readout-top">
<h3 id="readout-title">Ordered memory</h3>
<span class="live-badge">Chapter I</span>
</div>
<p id="readout-description">
An imagined pause gathers separate memories into a calm, repeating lattice.
</p>
</section>
<section class="symbol-key" aria-labelledby="key-title">
<p class="section-label" id="key-title">Read the symbolic formation</p>
<div class="key-row">
<span class="key-dot" style="background: #bba8ff"></span>
<strong>Facets</strong>
<span>Decisions and fragments preserved by a story.</span>
</div>
<div class="key-row">
<span class="key-dot" style="background: #ffad73"></span>
<strong>Tension</strong>
<span>The pressure created when accounts disagree.</span>
</div>
<div class="key-row">
<span class="key-dot" style="background: #f56b7b"></span>
<strong>Afterimage</strong>
<span>What remains after an object has changed meaning.</span>
</div>
</section>
<section class="teaching-prompt">
<h3>Classroom prompt</h3>
<p>
Which arrangement feels most “stable”? Does changing the narrative change
the object itself, our reading of it, or both?
</p>
</section>
<div class="sample-strip" aria-label="Chocolate sample symbols">
<div class="sample-chip"><strong>01 · Origin</strong>whole / singular</div>
<div class="sample-chip"><strong>02 · Tablet</strong>divided / shared</div>
<div class="sample-chip"><strong>03 · Bonbon</strong>crafted / imagined</div>
</div>
<div class="disclaimer">
<strong>Symbolic exhibit — not a tempering recipe</strong>
<p>
This model deliberately contains no practical temperatures, timings,
ratios, cooling instructions, or tempering endpoint. The “schedule” is
fictional and should never be used to process chocolate.
</p>
</div>
</aside>
</main>
<dialog id="about-dialog" aria-labelledby="dialog-title">
<div class="dialog-content">
<p class="eyebrow">About this exhibit</p>
<h2 id="dialog-title">Interpretation, not instruction</h2>
<p>
The bean, tablet, and bonbon are symbolic props for a fictional museum
history. The floating crystals are a visual metaphor for how memories
might be ordered, pulled apart, or preserved as an afterimage.
</p>
<p>
The schedule names are invented narrative devices. They do not model
cocoa-butter crystal structures, physical cooling behavior, or any
manufacturing process.
</p>
<p class="alert">
This exhibit intentionally omits practical process settings and is not
a chocolate-tempering recipe. Do not use it as processing guidance.
</p>
<p>
<strong>Controls:</strong> drag to orbit, scroll to zoom, double-click to
reset, or use the camera buttons. The schedule cards transform the
symbolic formation.
</p>
<button class="quiet-button" id="close-dialog" type="button">Return to exhibit</button>
</div>
</dialog>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const host = document.querySelector("#canvas-host");
const scene = new THREE.Scene();
scene.fog = new THREE.Fog(0x160d13, 15, 29);
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 1.8));
renderer.setClearColor(0x160d13, 0);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.12;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.domElement.setAttribute(
"aria-label",
"Three chocolate history symbols beneath a changing low-poly crystal formation"
);
host.appendChild(renderer.domElement);
const camera = new THREE.PerspectiveCamera(38, 1, 0.1, 100);
const cameraTarget = new THREE.Vector3(0, 2.05, 0);
let yaw = 0.5;
let pitch = 0.34;
let cameraDistance = 14.6;
let dragging = false;
let previousPointer = { x: 0, y: 0 };
let autoOrbit = false;
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
function updateCamera() {
const horizontal = Math.cos(pitch) * cameraDistance;
camera.position.set(
cameraTarget.x + Math.sin(yaw) * horizontal,
cameraTarget.y + Math.sin(pitch) * cameraDistance,
cameraTarget.z + Math.cos(yaw) * horizontal
);
camera.lookAt(cameraTarget);
}
function resetCamera() {
yaw = 0.5;
pitch = 0.34;
cameraDistance = 14.6;
updateCamera();
}
updateCamera();
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
previousPointer = { x: event.clientX, y: event.clientY };
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!dragging) return;
const dx = event.clientX - previousPointer.x;
const dy = event.clientY - previousPointer.y;
previousPointer = { x: event.clientX, y: event.clientY };
yaw -= dx * 0.005;
pitch = THREE.MathUtils.clamp(pitch + dy * 0.004, 0.08, 0.85);
updateCamera();
});
function endDrag(event) {
dragging = false;
if (event.pointerId !== undefined && renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
renderer.domElement.addEventListener("pointerup", endDrag);
renderer.domElement.addEventListener("pointercancel", endDrag);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
cameraDistance = THREE.MathUtils.clamp(
cameraDistance + event.deltaY * 0.01,
9.4,
19
);
updateCamera();
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", resetCamera);
// Lighting
scene.add(new THREE.HemisphereLight(0xf7d9d0, 0x241522, 2.15));
scene.add(new THREE.AmbientLight(0xb88ca0, 0.55));
const keyLight = new THREE.DirectionalLight(0xffe2bd, 4.4);
keyLight.position.set(5, 10, 7);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(1024, 1024);
keyLight.shadow.camera.left = -9;
keyLight.shadow.camera.right = 9;
keyLight.shadow.camera.top = 9;
keyLight.shadow.camera.bottom = -9;
keyLight.shadow.bias = -0.0006;
scene.add(keyLight);
const violetLight = new THREE.PointLight(0x8d70ff, 15, 13, 2);
violetLight.position.set(-4, 5, 2);
scene.add(violetLight);
const warmLight = new THREE.PointLight(0xff9f5f, 13, 12, 2);
warmLight.position.set(4, 3.8, 1);
scene.add(warmLight);
// Museum floor and architectural rings
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(50, 50),
new THREE.MeshStandardMaterial({
color: 0x1b1118,
roughness: 0.92,
metalness: 0.08
})
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.025;
floor.receiveShadow = true;
scene.add(floor);
const platform = new THREE.Mesh(
new THREE.CylinderGeometry(6.9, 7.2, 0.12, 48),
new THREE.MeshStandardMaterial({
color: 0x24151d,
roughness: 0.82,
metalness: 0.12
})
);
platform.position.set(0, -0.02, 0.25);
platform.receiveShadow = true;
scene.add(platform);
const centralPlinth = new THREE.Mesh(
new THREE.CylinderGeometry(2.25, 2.55, 0.48, 12),
new THREE.MeshStandardMaterial({
color: 0x3a222b,
roughness: 0.62,
metalness: 0.22
})
);
centralPlinth.position.set(0, 0.22, -0.45);
centralPlinth.castShadow = true;
centralPlinth.receiveShadow = true;
scene.add(centralPlinth);
const plinthTop = new THREE.Mesh(
new THREE.CylinderGeometry(2.17, 2.17, 0.07, 12),
new THREE.MeshStandardMaterial({
color: 0x68404a,
roughness: 0.45,
metalness: 0.28
})
);
plinthTop.position.set(0, 0.49, -0.45);
plinthTop.receiveShadow = true;
scene.add(plinthTop);
const halo = new THREE.Mesh(
new THREE.TorusGeometry(4.25, 0.025, 4, 80),
new THREE.MeshBasicMaterial({
color: 0xc18a73,
transparent: true,
opacity: 0.26
})
);
halo.position.set(0, 3.2, -4.5);
halo.scale.x = 1.25;
scene.add(halo);
const haloInner = new THREE.Mesh(
new THREE.TorusGeometry(3.2, 0.012, 4, 72),
new THREE.MeshBasicMaterial({
color: 0xe8b46c,
transparent: true,
opacity: 0.18
})
);
haloInner.position.set(0, 3.2, -4.48);
haloInner.scale.x = 1.25;
scene.add(haloInner);
const floorRing = new THREE.Mesh(
new THREE.RingGeometry(5.95, 6.0, 96),
new THREE.MeshBasicMaterial({
color: 0xe8b46c,
transparent: true,
opacity: 0.18,
side: THREE.DoubleSide
})
);
floorRing.rotation.x = -Math.PI / 2;
floorRing.position.set(0, 0.045, 0.25);
scene.add(floorRing);
// Canvas-texture labels; no CSS2DRenderer or other addons are used.
function roundedRect(context, x, y, width, height, radius) {
const r = Math.min(radius, width / 2, height / 2);
context.beginPath();
context.moveTo(x + r, y);
context.lineTo(x + width - r, y);
context.quadraticCurveTo(x + width, y, x + width, y + r);
context.lineTo(x + width, y + height - r);
context.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
context.lineTo(x + r, y + height);
context.quadraticCurveTo(x, y + height, x, y + height - r);
context.lineTo(x, y + r);
context.quadraticCurveTo(x, y, x + r, y);
context.closePath();
}
function createLabelSprite(title, subtitle, accent = "#e8b46c", width = 3.4) {
const canvas = document.createElement("canvas");
canvas.width = 720;
canvas.height = 180;
const context = canvas.getContext("2d");
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.minFilter = THREE.LinearFilter;
const material = new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthTest: false,
depthWrite: false
});
const sprite = new THREE.Sprite(material);
sprite.scale.set(width, width / 4, 1);
sprite.renderOrder = 20;
function draw(nextTitle = title, nextSubtitle = subtitle) {
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillStyle = "rgba(25, 14, 20, 0.90)";
roundedRect(context, 8, 8, 704, 164, 22);
context.fill();
context.strokeStyle = "rgba(255, 238, 218, 0.20)";
context.lineWidth = 2;
roundedRect(context, 8, 8, 704, 164, 22);
context.stroke();
context.fillStyle = accent;
roundedRect(context, 28, 35, 8, 110, 4);
context.fill();
context.fillStyle = "#fff8ee";
context.font = "600 40px Georgia, serif";
context.fillText(nextTitle, 55, 76);
context.fillStyle = "#cbbab0";
context.font = "500 23px Arial, sans-serif";
context.fillText(nextSubtitle, 56, 121);
texture.needsUpdate = true;
}
draw();
sprite.userData.draw = draw;
return sprite;
}
// Sample pedestals
function makePedestal(x, z, radius, accent) {
const group = new THREE.Group();
const base = new THREE.Mesh(
new THREE.CylinderGeometry(radius, radius * 1.06, 0.4, 12),
new THREE.MeshStandardMaterial({
color: 0x39242d,
roughness: 0.64,
metalness: 0.18
})
);
base.position.set(x, 0.19, z);
base.castShadow = true;
base.receiveShadow = true;
group.add(base);
const top = new THREE.Mesh(
new THREE.CylinderGeometry(radius * 0.91, radius * 0.91, 0.06, 12),
new THREE.MeshStandardMaterial({
color: 0x76505a,
roughness: 0.43,
metalness: 0.25
})
);
top.position.set(x, 0.42, z);
top.receiveShadow = true;
group.add(top);
const ring = new THREE.Mesh(
new THREE.TorusGeometry(radius * 0.76, 0.018, 4, 48),
new THREE.MeshBasicMaterial({
color: accent,
transparent: true,
opacity: 0.38
})
);
ring.rotation.x = -Math.PI / 2;
ring.position.set(x, 0.455, z);
group.add(ring);
return group;
}
scene.add(makePedestal(-4.2, 2.05, 1.42, 0xc69c6f));
scene.add(makePedestal(0, 2.45, 1.52, 0xe8b46c));
scene.add(makePedestal(4.2, 2.05, 1.42, 0xd56b75));
// Sample 01: irregular origin bean
const beanGroup = new THREE.Group();
beanGroup.position.set(-4.2, 0.88, 2.05);
beanGroup.rotation.set(0.15, -0.35, -0.08);
const bean = new THREE.Mesh(
new THREE.DodecahedronGeometry(0.74, 0),
new THREE.MeshStandardMaterial({
color: 0x653523,
roughness: 0.8,
metalness: 0.03,
flatShading: true
})
);
bean.scale.set(1.02, 0.72, 1.36);
bean.castShadow = true;
bean.receiveShadow = true;
beanGroup.add(bean);
const seamPoints = [
new THREE.Vector3(-0.1, 0.52, -0.73),
new THREE.Vector3(-0.16, 0.55, -0.25),
new THREE.Vector3(-0.12, 0.52, 0.28),
new THREE.Vector3(-0.03, 0.48, 0.76)
];
const seam = new THREE.Line(
new THREE.BufferGeometry().setFromPoints(seamPoints),
new THREE.LineBasicMaterial({ color: 0x2e1714 })
);
beanGroup.add(seam);
for (let i = 0; i < 7; i++) {
const nib = new THREE.Mesh(
new THREE.TetrahedronGeometry(0.085 + (i % 2) * 0.015),
new THREE.MeshStandardMaterial({
color: i % 2 ? 0x4b281d : 0x74412b,
roughness: 0.86,
flatShading: true
})
);
nib.position.set(
Math.sin(i * 2.3) * 0.4,
0.42 + Math.cos(i) * 0.06,
Math.cos(i * 1.8) * 0.56
);
nib.rotation.set(i * 0.4, i * 0.7, i * 0.3);
nib.castShadow = true;
beanGroup.add(nib);
}
scene.add(beanGroup);
// Sample 02: low-poly scored tablet
function createTabletGeometry(width, height, depth, corner, bevel) {
const x = -width / 2;
const y = -height / 2;
const shape = new THREE.Shape();
shape.moveTo(x + corner, y);
shape.lineTo(x + width - corner, y);
shape.lineTo(x + width, y + corner);
shape.lineTo(x + width, y + height - corner);
shape.lineTo(x + width - corner, y + height);
shape.lineTo(x + corner, y + height);
shape.lineTo(x, y + height - corner);
shape.lineTo(x, y + corner);
shape.closePath();
const geometry = new THREE.ExtrudeGeometry(shape, {
depth,
steps: 1,
bevelEnabled: true,
bevelSegments: 1,
bevelSize: bevel,
bevelThickness: bevel,
curveSegments: 1
});
geometry.center();
geometry.rotateX(-Math.PI / 2);
geometry.computeVertexNormals();
return geometry;
}
const tabletGroup = new THREE.Group();
tabletGroup.position.set(0, 0.78, 2.45);
tabletGroup.rotation.y = -0.08;
const tablet = new THREE.Mesh(
createTabletGeometry(2.55, 1.62, 0.3, 0.2, 0.055),
new THREE.MeshStandardMaterial({
color: 0x8d5231,
roughness: 0.65,
metalness: 0.04,
flatShading: true
})
);
tablet.castShadow = true;
tablet.receiveShadow = true;
tabletGroup.add(tablet);
const scoreMaterial = new THREE.MeshStandardMaterial({
color: 0x4a271b,
roughness: 0.95
});
for (let i = -1; i <= 1; i++) {
const vertical = new THREE.Mesh(
new THREE.BoxGeometry(0.035, 0.025, 1.36),
scoreMaterial
);
vertical.position.set(i * 0.69, 0.19, 0);
tabletGroup.add(vertical);
const horizontal = new THREE.Mesh(
new THREE.BoxGeometry(2.22, 0.025, 0.035),
scoreMaterial
);
horizontal.position.set(0, 0.191, i * 0.45);
tabletGroup.add(horizontal);
}
scene.add(tabletGroup);
// Sample 03: geometric bonbon with a small colored cap
const bonbonGroup = new THREE.Group();
bonbonGroup.position.set(4.2, 0.93, 2.05);
bonbonGroup.rotation.set(0.12, 0.42, 0.08);
const bonbon = new THREE.Mesh(
new THREE.DodecahedronGeometry(0.74, 0),
new THREE.MeshStandardMaterial({
color: 0x4d2029,
roughness: 0.52,
metalness: 0.1,
flatShading: true
})
);
bonbon.scale.y = 0.84;
bonbon.castShadow = true;
bonbon.receiveShadow = true;
bonbonGroup.add(bonbon);
const glaze = new THREE.Mesh(
new THREE.CylinderGeometry(0.42, 0.49, 0.11, 6),
new THREE.MeshStandardMaterial({
color: 0xd46a67,
roughness: 0.36,
metalness: 0.12,
flatShading: true
})
);
glaze.position.y = 0.55;
glaze.rotation.y = 0.3;
glaze.castShadow = true;
bonbonGroup.add(glaze);
scene.add(bonbonGroup);
// World-space labels for the three chocolate symbols
const beanLabel = createLabelSprite(
"01 · ORIGIN",
"whole / singular",
"#c69c6f",
3.05
);
beanLabel.position.set(-4.2, 2.05, 2.05);
scene.add(beanLabel);
const tabletLabel = createLabelSprite(
"02 · TABLET",
"divided / shared",
"#e8b46c",
3.15
);
tabletLabel.position.set(0, 2.2, 2.45);
scene.add(tabletLabel);
const bonbonLabel = createLabelSprite(
"03 · BONBON",
"crafted / imagined",
"#d56b75",
3.2
);
bonbonLabel.position.set(4.2, 2.08, 2.05);
scene.add(bonbonLabel);
// Thin pathways connect the samples to the central interpretation.
function addPath(points, color) {
const curve = new THREE.CatmullRomCurve3(points);
const tube = new THREE.Mesh(
new THREE.TubeGeometry(curve, 28, 0.018, 4, false),
new THREE.MeshBasicMaterial({
color,
transparent: true,
opacity: 0.36
})
);
scene.add(tube);
}
addPath(
[
new THREE.Vector3(-4.2, 0.48, 1.8),
new THREE.Vector3(-3.1, 0.5, 0.8),
new THREE.Vector3(-1.7, 0.51, -0.2),
new THREE.Vector3(0, 0.51, -0.45)
],
0xc69c6f
);
addPath(
[
new THREE.Vector3(0, 0.49, 2.15),
new THREE.Vector3(0, 0.5, 1.1),
new THREE.Vector3(0, 0.51, -0.45)
],
0xe8b46c
);
addPath(
[
new THREE.Vector3(4.2, 0.48, 1.8),
new THREE.Vector3(3.1, 0.5, 0.8),
new THREE.Vector3(1.7, 0.51, -0.2),
new THREE.Vector3(0, 0.51, -0.45)
],
0xd56b75
);
// Crystal formation
function createCrystalGeometry(height, radius, sides, phase = 0) {
const vertices = [];
const indices = [];
vertices.push(0, height / 2, 0);
vertices.push(0, -height / 2, 0);
for (let i = 0; i < sides; i++) {
const angle = (i / sides) * Math.PI * 2 + phase;
vertices.push(
Math.cos(angle) * radius,
0,
Math.sin(angle) * radius
);
}
for (let i = 0; i < sides; i++) {
const next = (i + 1) % sides;
indices.push(0, 2 + i, 2 + next);
indices.push(1, 2 + next, 2 + i);
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(vertices, 3)
);
geometry.setIndex(indices);
geometry.computeVertexNormals();
return geometry;
}
const schedules = [
{
title: "Quiet Archive",
structure: "Ordered memory",
description:
"An imagined pause gathers separate memories into a calm, repeating lattice.",
accent: "#a996ff",
crystalColor: new THREE.Color(0xa996ff),
lightColor: 0x8d70ff
},
{
title: "Crosscurrent",
structure: "Braided memory",
description:
"Counter-moving story lines pull the facets into a braided, uneven structure.",
accent: "#ff9567",
crystalColor: new THREE.Color(0xff9567),
lightColor: 0xff7f4f
},
{
title: "Ember Recall",
structure: "Faceted afterimage",
description:
"A brief imagined glow leaves a wide faceted halo around a smaller core.",
accent: "#f06478",
crystalColor: new THREE.Color(0xf06478),
lightColor: 0xff5575
}
];
const crystalGroup = new THREE.Group();
crystalGroup.position.set(0, 0.62, -0.45);
scene.add(crystalGroup);
const arrangementLabel = createLabelSprite(
"QUIET ARCHIVE",
"ORDERED MEMORY · SYMBOLIC FORMATION",
schedules[0].accent,
4.3
);
arrangementLabel.position.set(0, 3.65, 0);
crystalGroup.add(arrangementLabel);
const crystalCount = 24;
const crystals = [];
function buildScheduleState(scheduleIndex) {
const state = [];
for (let i = 0; i < crystalCount; i++) {
const tier = Math.floor(i / 8);
const indexInTier = i % 8;
const angle =
(indexInTier / 8) * Math.PI * 2 +
tier * 0.27 +
Math.sin(i * 1.31) * 0.055;
let position;
let scale;
let color;
if (scheduleIndex === 0) {
// Symmetrical, ordered rings.
const radius = [1.48, 1.12, 0.72][tier];
position = new THREE.Vector3(
Math.cos(angle) * radius,
0.72 + tier * 0.79 + Math.cos(angle * 2) * 0.08,
Math.sin(angle) * radius
);
scale = new THREE.Vector3(
0.82 + (indexInTier % 2) * 0.08,
1.04 + (indexInTier % 3) * 0.08,
0.82 + ((indexInTier + 1) % 2) * 0.08
);
color = new THREE.Color().setHSL(
0.72 + (indexInTier % 3) * 0.018,
0.62,
0.57 + (tier % 2) * 0.045
);
} else if (scheduleIndex === 1) {
// Two counter-moving braided streams.
const radius = 0.62 + tier * 0.12;
position = new THREE.Vector3(
Math.cos(angle) * radius + Math.sin(tier * 1.35) * 0.48,
0.67 + tier * 0.77,
Math.sin(angle) * radius * 0.85 - tier * 0.18
);
scale = new THREE.Vector3(
0.68 + (indexInTier % 2) * 0.08,
1.42 + (indexInTier % 3) * 0.12,
0.68 + ((indexInTier + 1) % 2) * 0.08
);
color = new THREE.Color().setHSL(
0.035 + tier * 0.025,
0.78,
0.57 + (indexInTier % 3) * 0.035
);
} else {
// A wide afterimage halo with a tighter upper core.
const radius = [1.62, 1.23, 0.78][tier];
position = new THREE.Vector3(
Math.cos(angle) * radius,
0.5 + tier * 0.83 + Math.sin(angle * 3) * 0.12,
Math.sin(angle) * radius * 0.72
);
scale = new THREE.Vector3(
1.04 + (indexInTier % 2) * 0.1,
1.02 + (tier === 2 ? 0.38 : 0),
0.88 + ((indexInTier + 1) % 2) * 0.08
);
color = new THREE.Color().setHSL(
tier === 2 ? 0.12 : 0.965,
0.74,
0.61 + (indexInTier % 3) * 0.025
);
}
const rotation = new THREE.Euler(
angle * 0.31 + tier * 0.18,
angle,
Math.sin(angle * 2) * 0.24
);
state.push({ position, scale, rotation, color });
}
return state;
}
const scheduleStates = schedules.map((_, index) => buildScheduleState(index));
for (let i = 0; i < crystalCount; i++) {
const geometry = createCrystalGeometry(
0.92,
0.25 + (i % 3) * 0.025,
5,
i * 0.37
);
const material = new THREE.MeshStandardMaterial({
color: scheduleStates[0][i].color,
emissive: scheduleStates[0][i].color.clone().multiplyScalar(0.12),
metalness: 0.34,
roughness: 0.27,
flatShading: true,
transparent: true,
opacity: 0.96
});
const mesh = new THREE.Mesh(geometry, material);
const initial = scheduleStates[0][i];
mesh.position.copy(initial.position);
mesh.scale.copy(initial.scale);
mesh.rotation.copy(initial.rotation);
mesh.castShadow = true;
mesh.receiveShadow = true;
crystalGroup.add(mesh);
const edges = new THREE.LineSegments(
new THREE.EdgesGeometry(geometry, 17),
new THREE.LineBasicMaterial({
color: 0xffead6,
transparent: true,
opacity: 0.28
})
);
mesh.add(edges);
crystals.push({
mesh,
material,
edges,
fromPosition: initial.position.clone(),
fromScale: initial.scale.clone(),
fromRotation: initial.rotation.clone(),
fromColor: initial.color.clone()
});
}
// A central, darker keystone gives the formation a readable focal point.
const keystoneMaterial = new THREE.MeshStandardMaterial({
color: 0xf2cfad,
emissive: 0x5c2c36,
metalness: 0.45,
roughness: 0.2,
flatShading: true
});
const keystone = new THREE.Mesh(
createCrystalGeometry(1.28, 0.38, 6, 0.4),
keystoneMaterial
);
keystone.position.set(0, 1.43, 0.02);
keystone.rotation.z = 0.1;
keystone.castShadow = true;
crystalGroup.add(keystone);
// Sparse particles provide depth without becoming visual noise.
const dustPositions = new Float32Array(90 * 3);
for (let i = 0; i < 90; i++) {
const radius = 3 + Math.random() * 7;
const angle = Math.random() * Math.PI * 2;
dustPositions[i * 3] = Math.cos(angle) * radius;
dustPositions[i * 3 + 1] = 0.7 + Math.random() * 6.5;
dustPositions[i * 3 + 2] = Math.sin(angle) * radius - 1;
}
const dustGeometry = new THREE.BufferGeometry();
dustGeometry.setAttribute(
"position",
new THREE.BufferAttribute(dustPositions, 3)
);
const dust = new THREE.Points(
dustGeometry,
new THREE.PointsMaterial({
color: 0xe6c7ad,
size: 0.035,
transparent: true,
opacity: 0.36,
depthWrite: false
})
);
scene.add(dust);
// Interface state and transitions
const cards = [...document.querySelectorAll(".schedule-card")];
const readoutTitle = document.querySelector("#readout-title");
const readoutDescription = document.querySelector("#readout-description");
const liveBadge = document.querySelector(".live-badge");
let currentSchedule = 0;
let transitionStart = 0;
let transitionTo = 0;
let transitionActive = false;
const roman = ["I", "II", "III"];
function selectSchedule(index) {
if (index === transitionTo && transitionActive) return;
for (const crystal of crystals) {
crystal.fromPosition.copy(crystal.mesh.position);
crystal.fromScale.copy(crystal.mesh.scale);
crystal.fromRotation.copy(crystal.mesh.rotation);
crystal.fromColor.copy(crystal.material.color);
}
transitionTo = index;
transitionStart = performance.now();
transitionActive = true;
currentSchedule = index;
const schedule = schedules[index];
document.documentElement.style.setProperty("--accent", schedule.accent);
cards.forEach((card, cardIndex) => {
const active = cardIndex === index;
card.classList.toggle("active", active);
card.setAttribute("aria-pressed", String(active));
});
readoutTitle.textContent = schedule.structure;
readoutDescription.textContent = schedule.description;
liveBadge.textContent = `Chapter ${roman[index]}`;
arrangementLabel.userData.draw(
schedule.title.toUpperCase(),
`${schedule.structure.toUpperCase()} · SYMBOLIC FORMATION`
);
violetLight.color.setHex(schedule.lightColor);
warmLight.color.setHex(
index === 1 ? 0xffb067 : index === 2 ? 0xff6374 : 0xd69bff
);
}
cards.forEach((card) => {
card.addEventListener("click", () => {
selectSchedule(Number(card.dataset.schedule));
});
});
document.querySelector("#reset-button").addEventListener("click", resetCamera);
document.querySelector("#reset-top").addEventListener("click", resetCamera);
const orbitButton = document.querySelector("#orbit-button");
orbitButton.addEventListener("click", () => {
autoOrbit = !autoOrbit;
orbitButton.setAttribute("aria-pressed", String(autoOrbit));
});
// About dialog
const dialog = document.querySelector("#about-dialog");
document.querySelector("#about-button").addEventListener("click", () => {
dialog.showModal();
});
document.querySelector("#close-dialog").addEventListener("click", () => {
dialog.close();
});
dialog.addEventListener("click", (event) => {
const rect = dialog.getBoundingClientRect();
const outside =
event.clientX < rect.left ||
event.clientX > rect.right ||
event.clientY < rect.top ||
event.clientY > rect.bottom;
if (outside) dialog.close();
});
// Responsive canvas sizing
function resize() {
const width = host.clientWidth;
const height = host.clientHeight;
if (!width || !height) return;
renderer.setSize(width, height, false);
camera.aspect = width / height;
camera.updateProjectionMatrix();
updateCamera();
}
new ResizeObserver(resize).observe(host);
resize();
// Animation loop
const clock = new THREE.Clock();
function animate(now) {
requestAnimationFrame(animate);
const delta = Math.min(clock.getDelta(), 0.05);
if (autoOrbit && !reducedMotion && !dragging) {
yaw += delta * 0.09;
updateCamera();
}
if (!reducedMotion) {
crystalGroup.rotation.y += delta * 0.035;
dust.rotation.y -= delta * 0.012;
}
if (transitionActive) {
const duration = reducedMotion ? 1 : 1150;
const raw = THREE.MathUtils.clamp((now - transitionStart) / duration, 0, 1);
const eased = 1 - Math.pow(1 - raw, 3);
const target = scheduleStates[transitionTo];
crystals.forEach((crystal, index) => {
const destination = target[index];
crystal.mesh.position.lerpVectors(
crystal.fromPosition,
destination.position,
eased
);
crystal.mesh.scale.lerpVectors(
crystal.fromScale,
destination.scale,
eased
);
crystal.mesh.rotation.set(
THREE.MathUtils.lerp(
crystal.fromRotation.x,
destination.rotation.x,
eased
),
THREE.MathUtils.lerp(
crystal.fromRotation.y,
destination.rotation.y,
eased
),
THREE.MathUtils.lerp(
crystal.fromRotation.z,
destination.rotation.z,
eased
)
);
crystal.material.color.lerpColors(
crystal.fromColor,
destination.color,
eased
);
crystal.material.emissive
.copy(crystal.material.color)
.multiplyScalar(0.12);
crystal.edges.material.color.lerpColors(
new THREE.Color(0xffe8d0),
destination.color.clone().lerp(new THREE.Color(0xffffff), 0.4),
eased
);
});
keystoneMaterial.emissive.lerpColors(
new THREE.Color(0x5c2c36),
target[0].color.clone().multiplyScalar(0.45),
eased
);
if (raw >= 1) {
transitionActive = false;
}
}
renderer.render(scene, camera);
}
requestAnimationFrame(animate);
</script>
</body>
</html>
```