Prompt specification
Build or customize the Three.js 3D scene "Local history display corner" 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: Local history display corner
Category: Architecture & Cities · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/local-history-display-corner-x0191
Scene Description Prompt:
Compose a community exhibit with glass cases, model artifacts, captions, and benches; selecting a case lights its contents and dims nearby reflections for inspection. Use Three.js from cdnjs in a single HTML file, with stylized solid shapes.
Working Three.js Starter (local-history-display-corner-x0191):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#e6dfd1" />
<title>Common Ground — A Community Exhibit</title>
<style>
:root {
--ink: #173d37;
--muted: #68756f;
--paper: #f4efe5;
--accent: #d76c3d;
--line: rgba(23, 61, 55, 0.16);
--glass: rgba(250, 247, 238, 0.86);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
color: var(--ink);
background: #ded9ce;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button {
font: inherit;
}
#stage {
position: fixed;
inset: 0;
}
#stage canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
outline: none;
}
.brand {
position: fixed;
top: 28px;
left: 30px;
z-index: 5;
display: flex;
align-items: center;
gap: 14px;
pointer-events: none;
user-select: none;
}
.brand-mark {
position: relative;
width: 42px;
height: 42px;
border: 2px solid var(--ink);
border-radius: 50%;
}
.brand-mark::before,
.brand-mark::after {
content: "";
position: absolute;
border-radius: 50%;
background: var(--accent);
}
.brand-mark::before {
width: 10px;
height: 10px;
top: 7px;
left: 7px;
}
.brand-mark::after {
width: 7px;
height: 7px;
right: 7px;
bottom: 7px;
background: var(--ink);
}
.brand-copy small {
display: block;
margin-bottom: 3px;
color: var(--muted);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.18em;
text-transform: uppercase;
}
.brand-copy strong {
display: block;
font-family: Georgia, "Times New Roman", serif;
font-size: 24px;
font-weight: 500;
letter-spacing: 0.015em;
}
.brand-copy span {
display: block;
margin-top: 2px;
color: var(--muted);
font-size: 12px;
}
.detail {
position: fixed;
z-index: 10;
top: 28px;
right: 28px;
width: min(350px, calc(100vw - 40px));
padding: 23px 24px 21px;
overflow: hidden;
border: 1px solid rgba(255, 255, 255, 0.58);
border-radius: 18px;
background: var(--glass);
box-shadow:
0 24px 70px rgba(36, 44, 39, 0.16),
inset 0 1px 0 rgba(255, 255, 255, 0.72);
backdrop-filter: blur(18px) saturate(0.9);
-webkit-backdrop-filter: blur(18px) saturate(0.9);
transition:
opacity 240ms ease,
transform 240ms ease;
}
.detail.hidden {
opacity: 0;
pointer-events: none;
transform: translateY(-10px);
}
.detail-top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 18px;
}
.case-index {
display: grid;
width: 38px;
height: 38px;
place-items: center;
border-radius: 50%;
color: white;
background: var(--accent);
font-size: 12px;
font-weight: 800;
letter-spacing: 0.08em;
}
.icon-button {
display: grid;
width: 34px;
height: 34px;
padding: 0;
place-items: center;
border: 1px solid var(--line);
border-radius: 50%;
color: var(--ink);
background: transparent;
cursor: pointer;
transition: background 160ms ease, transform 160ms ease;
}
.icon-button:hover {
background: rgba(23, 61, 55, 0.08);
transform: rotate(5deg);
}
.kicker {
margin: 0 0 8px;
color: var(--accent);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.17em;
text-transform: uppercase;
}
.detail h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(28px, 3vw, 36px);
font-weight: 500;
line-height: 1.02;
letter-spacing: -0.025em;
}
.description {
margin: 15px 0 18px;
color: #4f5f59;
font-size: 13px;
line-height: 1.65;
}
blockquote {
margin: 0 0 19px;
padding: 0 0 0 15px;
border-left: 2px solid var(--accent);
color: var(--ink);
font-family: Georgia, "Times New Roman", serif;
font-size: 16px;
font-style: italic;
line-height: 1.5;
}
.provenance {
display: flex;
flex-direction: column;
gap: 4px;
margin-bottom: 18px;
padding-top: 15px;
border-top: 1px solid var(--line);
}
.provenance span {
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.15em;
text-transform: uppercase;
}
.provenance strong {
font-size: 12px;
font-weight: 650;
}
.focus-button {
width: 100%;
padding: 11px 14px;
border: 0;
border-radius: 10px;
color: white;
background: var(--ink);
font-size: 11px;
font-weight: 750;
letter-spacing: 0.035em;
cursor: pointer;
transition: background 160ms ease, transform 160ms ease;
}
.focus-button:hover {
background: #24554c;
transform: translateY(-1px);
}
.inspection-note {
display: flex;
align-items: center;
gap: 8px;
margin-top: 13px;
color: var(--muted);
font-size: 10px;
line-height: 1.4;
}
.inspection-note::before {
content: "";
flex: 0 0 auto;
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 0 4px rgba(215, 108, 61, 0.12);
}
.case-nav {
position: fixed;
z-index: 8;
bottom: 26px;
left: 28px;
display: flex;
max-width: calc(100vw - 440px);
gap: 7px;
overflow-x: auto;
padding: 6px;
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 14px;
background: rgba(244, 239, 229, 0.82);
box-shadow: 0 12px 38px rgba(36, 44, 39, 0.12);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
}
.case-nav button {
flex: 0 0 auto;
min-width: 120px;
padding: 10px 13px;
border: 0;
border-radius: 9px;
color: #53625c;
background: transparent;
text-align: left;
cursor: pointer;
transition: color 160ms ease, background 160ms ease;
}
.case-nav button:hover {
color: var(--ink);
background: rgba(23, 61, 55, 0.06);
}
.case-nav button.active {
color: white;
background: var(--ink);
}
.case-nav button span {
display: block;
margin-bottom: 2px;
font-size: 9px;
font-weight: 800;
letter-spacing: 0.12em;
opacity: 0.72;
}
.case-nav button strong {
font-size: 11px;
font-weight: 700;
white-space: nowrap;
}
.hint {
position: fixed;
z-index: 5;
right: 28px;
bottom: 30px;
color: rgba(23, 61, 55, 0.67);
font-size: 10px;
font-weight: 650;
letter-spacing: 0.035em;
pointer-events: none;
user-select: none;
}
.loading {
position: fixed;
z-index: 30;
inset: 0;
display: grid;
place-items: center;
color: var(--ink);
background: #e6dfd1;
transition: opacity 500ms ease;
}
.loading.done {
opacity: 0;
pointer-events: none;
}
.loading-inner {
text-align: center;
}
.loading-mark {
width: 42px;
height: 42px;
margin: 0 auto 15px;
border: 2px solid var(--ink);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 900ms linear infinite;
}
.loading p {
margin: 0;
font-size: 11px;
font-weight: 750;
letter-spacing: 0.14em;
text-transform: uppercase;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
@media (max-width: 800px) {
.brand {
top: 15px;
left: 15px;
}
.brand-mark {
width: 36px;
height: 36px;
}
.brand-copy strong {
font-size: 20px;
}
.brand-copy span {
display: none;
}
.detail {
top: auto;
right: 12px;
bottom: 12px;
left: 12px;
width: auto;
max-height: 43vh;
padding: 17px 18px;
overflow-y: auto;
}
.detail-top {
margin-bottom: 10px;
}
.detail h1 {
font-size: 26px;
}
.description {
margin: 10px 0 12px;
font-size: 12px;
}
blockquote {
margin-bottom: 12px;
font-size: 14px;
}
.provenance {
margin-bottom: 12px;
padding-top: 10px;
}
.case-nav {
top: 79px;
right: 12px;
bottom: auto;
left: 12px;
max-width: none;
}
.case-nav button {
min-width: 112px;
padding: 8px 11px;
}
.hint {
display: none;
}
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
scroll-behavior: auto !important;
}
}
</style>
</head>
<body>
<main id="stage" aria-label="Interactive community museum exhibit"></main>
<header class="brand">
<div class="brand-mark" aria-hidden="true"></div>
<div class="brand-copy">
<small>Community Collections</small>
<strong>Common Ground</strong>
<span>Four objects. One shared story.</span>
</div>
</header>
<aside class="detail" id="detail" aria-live="polite">
<div class="detail-top">
<div class="case-index" id="caseIndex">01</div>
<button class="icon-button" id="closeDetail" aria-label="Close case information">×</button>
</div>
<p class="kicker" id="caseCategory"></p>
<h1 id="caseTitle"></h1>
<p class="description" id="caseDescription"></p>
<blockquote id="caseQuote"></blockquote>
<div class="provenance">
<span>Contributed by</span>
<strong id="caseContributor"></strong>
</div>
<button class="focus-button" id="focusCase">Center this case ↗</button>
<div class="inspection-note">
Interior lighting is active and nearby glass reflections are softened.
</div>
</aside>
<nav class="case-nav" id="caseNav" aria-label="Select an exhibit case"></nav>
<div class="hint">
Drag to orbit · Scroll to zoom · Click a case to inspect
</div>
<div class="loading" id="loading">
<div class="loading-inner">
<div class="loading-mark"></div>
<p>Opening the gallery</p>
</div>
</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// ------------------------------------------------------------
// Renderer and scene
// ------------------------------------------------------------
const stage = document.querySelector("#stage");
const loading = document.querySelector("#loading");
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.domElement.setAttribute("aria-label", "3D community exhibit gallery");
stage.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xded9ce);
scene.fog = new THREE.Fog(0xded9ce, 21, 39);
const camera = new THREE.PerspectiveCamera(
43,
window.innerWidth / window.innerHeight,
0.1,
70
);
const homeTarget = new THREE.Vector3(0, 1.05, -0.4);
const spherical = new THREE.Spherical(16.8, 1.03, 0.68);
const cameraTarget = homeTarget.clone();
function updateCamera() {
camera.position.copy(cameraTarget);
camera.position.add(new THREE.Vector3().setFromSpherical(spherical));
camera.lookAt(cameraTarget);
}
updateCamera();
const ambient = new THREE.HemisphereLight(0xfff7e7, 0x66736b, 1.65);
scene.add(ambient);
const sun = new THREE.DirectionalLight(0xfff2d9, 2.6);
sun.position.set(-7, 14, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -16;
sun.shadow.camera.right = 16;
sun.shadow.camera.top = 14;
sun.shadow.camera.bottom = -12;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 38;
sun.shadow.bias = -0.0005;
scene.add(sun);
const fill = new THREE.DirectionalLight(0xc8e4e0, 0.85);
fill.position.set(10, 7, -8);
scene.add(fill);
// ------------------------------------------------------------
// Shared geometry and material helpers
// ------------------------------------------------------------
function standard(color, roughness = 0.72, metalness = 0) {
return new THREE.MeshStandardMaterial({
color,
roughness,
metalness
});
}
const materials = {
wall: standard(0xe8e3d8, 0.94),
floor: standard(0xc9c6bb, 0.79, 0.04),
plinth: standard(0x244a43, 0.7),
plinthTop: standard(0xe4dfd3, 0.78),
frame: standard(0x48675f, 0.35, 0.65),
dark: standard(0x1c3430, 0.6),
wood: standard(0x9b6845, 0.78),
woodLight: standard(0xc08b61, 0.74),
brass: standard(0xb77832, 0.3, 0.72),
terracotta: standard(0xb75f3d, 0.82),
leaf: standard(0x47775d, 0.85),
leafLight: standard(0x729467, 0.86),
blue: standard(0x477f91, 0.58, 0.08),
blueDark: standard(0x285565, 0.66),
cream: standard(0xe9dcc3, 0.88),
road: standard(0x776f62, 0.9),
roof: standard(0xa95338, 0.78)
};
function addMesh(parent, geometry, material, x = 0, y = 0, z = 0) {
const object = new THREE.Mesh(geometry, material);
object.position.set(x, y, z);
object.castShadow = true;
object.receiveShadow = true;
parent.add(object);
return object;
}
function addBox(parent, w, h, d, material, x = 0, y = 0, z = 0) {
return addMesh(parent, new THREE.BoxGeometry(w, h, d), material, x, y, z);
}
function addCylinder(
parent,
rTop,
rBottom,
height,
segments,
material,
x = 0,
y = 0,
z = 0
) {
return addMesh(
parent,
new THREE.CylinderGeometry(rTop, rBottom, height, segments),
material,
x,
y,
z
);
}
function makeCanvasTexture(width, height, draw) {
const canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
const context = canvas.getContext("2d");
draw(context, width, height);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();
return texture;
}
function addTextPlane(texture, width, height, x, y, z) {
const material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
depthWrite: false,
toneMapped: false
});
const plane = new THREE.Mesh(new THREE.PlaneGeometry(width, height), material);
plane.position.set(x, y, z);
scene.add(plane);
return plane;
}
// ------------------------------------------------------------
// Gallery architecture
// ------------------------------------------------------------
const room = new THREE.Group();
scene.add(room);
const floor = addMesh(
room,
new THREE.PlaneGeometry(30, 25),
materials.floor,
0,
0,
0
);
floor.rotation.x = -Math.PI / 2;
floor.castShadow = false;
addBox(room, 28, 8.6, 0.4, materials.wall, 0, 4.3, -8.45);
addBox(room, 0.4, 8.6, 25, materials.wall, -13.8, 4.3, -0.5);
addBox(room, 28, 0.12, 0.12, materials.plinth, 0, 0.08, -8.19);
addBox(room, 0.12, 0.12, 25, materials.plinth, -13.54, 0.08, -0.5);
const titleTexture = makeCanvasTexture(1600, 500, (ctx, w, h) => {
ctx.clearRect(0, 0, w, h);
ctx.textAlign = "center";
ctx.fillStyle = "#173d37";
ctx.font = "500 138px Georgia";
ctx.fillText("COMMON GROUND", w / 2, 205);
ctx.fillStyle = "#d76c3d";
ctx.fillRect(w / 2 - 78, 255, 156, 5);
ctx.fillStyle = "#586860";
ctx.font = "700 28px Arial";
ctx.letterSpacing = "8px";
ctx.fillText("A COMMUNITY EXHIBIT", w / 2, 330);
ctx.font = "italic 31px Georgia";
ctx.fillStyle = "#6a756f";
ctx.fillText("Small objects. Shared histories. Enduring connection.", w / 2, 405);
});
addTextPlane(titleTexture, 8.5, 2.66, 0, 4.9, -8.215);
function wallRelief(x, color, flip = false) {
const group = new THREE.Group();
group.position.set(x, 4.8, -8.12);
room.add(group);
addBox(group, 3.05, 2.3, 0.13, materials.frame, 0, 0, 0);
addBox(group, 2.78, 2.03, 0.08, materials.plinthTop, 0, 0, 0.09);
const accent = standard(color, 0.8);
const dark = standard(0x254a42, 0.75);
addMesh(group, new THREE.CircleGeometry(0.57, 40), accent, -0.62, 0.2, 0.14);
addBox(group, 0.7, 0.95, 0.035, dark, 0.42, -0.16, 0.15);
addMesh(group, new THREE.CircleGeometry(0.3, 32), accent, 0.84, 0.52, 0.15);
for (let i = 0; i < 3; i++) {
const dot = addMesh(
group,
new THREE.CircleGeometry(0.065, 16),
dark,
-0.85 + i * 0.28,
-0.62,
0.15
);
if (flip) dot.scale.x = -1;
}
}
wallRelief(-7.4, 0xd88a58, true);
wallRelief(7.4, 0x6f9a84);
// A floor line connecting the cases.
const routePoints = [
new THREE.Vector3(-7.2, 0.025, 4.7),
new THREE.Vector3(-4.8, 0.025, -2.2),
new THREE.Vector3(0.4, 0.025, -3.4),
new THREE.Vector3(4.8, 0.025, -1.6),
new THREE.Vector3(7.4, 0.025, 5.0)
];
const routeCurve = new THREE.CatmullRomCurve3(routePoints);
const route = addMesh(
room,
new THREE.TubeGeometry(routeCurve, 100, 0.026, 6, false),
standard(0xb97852, 0.8),
0,
0,
0
);
route.castShadow = false;
// Pendant lights above the main display area.
[-4.8, 0.4, 4.8].forEach((x, index) => {
const pendant = new THREE.Group();
pendant.position.set(x, 0, index === 1 ? -3.2 : -1.8);
room.add(pendant);
addCylinder(pendant, 0.018, 0.018, 1.4, 8, materials.dark, 0, 7.05, 0);
addCylinder(pendant, 0.23, 0.52, 0.32, 20, materials.dark, 0, 6.24, 0);
const bulbMaterial = new THREE.MeshStandardMaterial({
color: 0xffe4a8,
emissive: 0xffbb58,
emissiveIntensity: 1.4,
roughness: 0.5
});
addCylinder(pendant, 0.34, 0.34, 0.025, 20, bulbMaterial, 0, 6.06, 0);
const bulbLight = new THREE.PointLight(0xffd58e, 2.5, 5, 2);
bulbLight.position.set(0, 5.95, 0);
pendant.add(bulbLight);
});
// ------------------------------------------------------------
// Benches
// ------------------------------------------------------------
function addBench(x, z, rotation, withBack = false) {
const bench = new THREE.Group();
bench.position.set(x, 0, z);
bench.rotation.y = rotation;
room.add(bench);
for (let i = 0; i < 5; i++) {
addBox(
bench,
3.25,
0.13,
0.15,
i % 2 ? materials.wood : materials.woodLight,
0,
0.53,
-0.36 + i * 0.18
);
}
[-1.22, 1.22].forEach((legX) => {
addBox(bench, 0.16, 0.52, 0.62, materials.dark, legX, 0.25, 0);
addBox(bench, 0.38, 0.06, 0.75, materials.dark, legX, 0.02, 0);
});
if (withBack) {
addBox(bench, 3.25, 0.14, 0.12, materials.wood, 0, 0.98, -0.4);
addBox(bench, 3.25, 0.14, 0.12, materials.woodLight, 0, 1.22, -0.4);
[-1.22, 1.22].forEach((postX) => {
addBox(bench, 0.1, 0.95, 0.1, materials.dark, postX, 0.73, -0.4);
});
}
}
addBench(-6.7, 5.0, 0.14, true);
addBench(6.7, 5.2, -0.18, false);
// ------------------------------------------------------------
// Stylized model artifacts
// ------------------------------------------------------------
function makeLantern() {
const group = new THREE.Group();
addCylinder(group, 0.48, 0.55, 0.16, 20, materials.brass, 0, 0.08, 0);
addCylinder(group, 0.075, 0.11, 0.77, 12, materials.brass, 0, 0.52, 0);
const orbMaterial = new THREE.MeshStandardMaterial({
color: 0xf4a13e,
emissive: 0xff8f28,
emissiveIntensity: 0.72,
roughness: 0.28,
metalness: 0.08
});
const orb = addMesh(
group,
new THREE.IcosahedronGeometry(0.43, 1),
orbMaterial,
0,
1.16,
0
);
addCylinder(group, 0.28, 0.44, 0.19, 12, materials.brass, 0, 1.58, 0);
addCylinder(group, 0.34, 0.28, 0.08, 12, materials.brass, 0, 0.78, 0);
const handle = addMesh(
group,
new THREE.TorusGeometry(0.4, 0.035, 8, 36, Math.PI),
materials.brass,
0,
1.68,
0
);
for (let i = 0; i < 6; i++) {
const angle = (i / 6) * Math.PI * 2;
addBox(
group,
0.025,
0.68,
0.025,
materials.brass,
Math.cos(angle) * 0.36,
1.16,
Math.sin(angle) * 0.36
);
}
group.userData.animate = (time) => {
orb.rotation.y = time * 0.22;
orb.rotation.x = Math.sin(time * 0.35) * 0.035;
handle.rotation.z = Math.sin(time * 0.45) * 0.018;
};
return group;
}
function makeTideMarker() {
const group = new THREE.Group();
const body = addMesh(
group,
new THREE.SphereGeometry(0.78, 22, 14),
materials.blue,
0,
0.62,
0
);
body.scale.set(1.22, 0.57, 0.52);
const belly = addMesh(
group,
new THREE.SphereGeometry(0.68, 18, 12),
materials.cream,
0.04,
0.43,
0.22
);
belly.scale.set(1.05, 0.43, 0.24);
const tailTop = addMesh(
group,
new THREE.ConeGeometry(0.3, 0.82, 4),
materials.blueDark,
0.91,
0.76,
0
);
tailTop.rotation.z = Math.PI / 2 - 0.55;
const tailBottom = addMesh(
group,
new THREE.ConeGeometry(0.28, 0.72, 4),
materials.blue,
0.86,
0.51,
0
);
tailBottom.rotation.z = Math.PI / 2 + 0.55;
const fin = addMesh(
group,
new THREE.ConeGeometry(0.2, 0.64, 3),
materials.blueDark,
-0.1,
0.42,
0.43
);
fin.rotation.z = -0.65;
fin.rotation.x = 0.9;
addMesh(group, new THREE.SphereGeometry(0.055, 12, 8), materials.dark, 0.45, 0.76, 0.39);
addMesh(group, new THREE.SphereGeometry(0.055, 12, 8), materials.dark, 0.45, 0.76, -0.39);
const rings = [];
for (let i = 0; i < 3; i++) {
const ring = addMesh(
group,
new THREE.TorusGeometry(0.58 + i * 0.23, 0.028, 7, 50),
i === 1 ? materials.blue : materials.blueDark,
-0.05,
0.08 + i * 0.025,
0
);
ring.rotation.x = Math.PI / 2;
rings.push(ring);
}
group.userData.animate = (time) => {
rings.forEach((ring, i) => {
ring.rotation.z = time * (0.07 + i * 0.018);
ring.position.x = -0.05 + Math.sin(time * 0.45 + i) * 0.025;
});
};
return group;
}
function makeSeedKeepers() {
const group = new THREE.Group();
const leaves = [];
function pot(x, z, scale = 1) {
const potGroup = new THREE.Group();
potGroup.position.set(x, 0, z);
potGroup.scale.setScalar(scale);
group.add(potGroup);
addCylinder(potGroup, 0.29, 0.21, 0.56, 12, materials.terracotta, 0, 0.28, 0);
addCylinder(potGroup, 0.25, 0.25, 0.045, 12, materials.dark, 0, 0.57, 0);
addCylinder(potGroup, 0.31, 0.31, 0.07, 12, materials.terracotta, 0, 0.53, 0);
addCylinder(potGroup, 0.022, 0.03, 0.72, 7, materials.leaf, 0, 0.91, 0);
const leafSpecs = [
[-0.13, 0.93, 0.03, 0.55, -0.55],
[0.13, 1.12, 0, -0.5, 0.55],
[-0.08, 1.34, -0.02, -0.35, -0.25]
];
leafSpecs.forEach((spec, i) => {
const leaf = addMesh(
potGroup,
new THREE.SphereGeometry(0.22, 8, 6),
i === 1 ? materials.leafLight : materials.leaf,
spec[0],
spec[1],
spec[2]
);
leaf.scale.set(0.62, 1.38, 0.16);
leaf.rotation.z = spec[3];
leaf.rotation.y = spec[4];
leaf.userData.baseRotation = leaf.rotation.z;
leaves.push(leaf);
});
}
pot(-0.78, 0.05, 0.92);
pot(0.05, -0.08, 1.08);
pot(0.8, 0.12, 0.78);
const seed = addMesh(
group,
new THREE.IcosahedronGeometry(0.18, 1),
materials.brass,
0.03,
1.49,
0
);
seed.scale.set(0.72, 1.25, 0.72);
group.userData.animate = (time) => {
leaves.forEach((leaf, i) => {
leaf.rotation.z =
leaf.userData.baseRotation + Math.sin(time * 0.75 + i * 0.7) * 0.035;
});
seed.rotation.y = time * 0.18;
};
return group;
}
function makeCornerStories() {
const group = new THREE.Group();
addBox(group, 2.45, 0.14, 1.58, materials.woodLight, 0, 0.07, 0);
addBox(group, 2.2, 0.025, 0.19, materials.road, 0, 0.155, 0.05);
addBox(group, 0.18, 0.025, 1.35, materials.road, 0.18, 0.157, 0);
function house(x, z, w, d, h, wallColor, roofColor) {
const wallMaterial = standard(wallColor, 0.82);
const roofMaterial = standard(roofColor, 0.78);
addBox(group, w, h, d, wallMaterial, x, 0.15 + h / 2, z);
const roof = addMesh(
group,
new THREE.ConeGeometry(Math.max(w, d) * 0.73, h * 0.48, 4),
roofMaterial,
x,
0.15 + h + h * 0.24,
z
);
roof.rotation.y = Math.PI / 4;
}
house(-0.78, -0.46, 0.5, 0.46, 0.47, 0xe2d2b4, 0x9d4d38);
house(-0.72, 0.5, 0.56, 0.42, 0.38, 0x94b5a8, 0x315e56);
house(0.73, 0.42, 0.62, 0.47, 0.58, 0xd7b690, 0x8d4f39);
house(0.78, -0.45, 0.46, 0.38, 0.35, 0x7fa0a9, 0x31545e);
function tree(x, z, scale = 1) {
addCylinder(group, 0.045 * scale, 0.06 * scale, 0.42 * scale, 7, materials.wood, x, 0.36 * scale, z);
addMesh(
group,
new THREE.ConeGeometry(0.28 * scale, 0.7 * scale, 8),
materials.leaf,
x,
0.75 * scale,
z
);
}
tree(-1.03, 0.02, 0.72);
tree(0.1, 0.53, 0.62);
tree(1.02, -0.05, 0.74);
// Tiny residents make the model read as a lived-in neighborhood.
[
[-0.13, 0.26, 0xa55a3e],
[0.48, -0.22, 0x356a65]
].forEach(([x, z, color]) => {
const personMaterial = standard(color, 0.8);
addCylinder(group, 0.045, 0.055, 0.16, 8, personMaterial, x, 0.27, z);
addMesh(group, new THREE.SphereGeometry(0.06, 10, 8), personMaterial, x, 0.39, z);
});
return group;
}
// ------------------------------------------------------------
// Glass cases and captions
// ------------------------------------------------------------
const exhibitCases = [];
const pickTargets = [];
const reflectionTexture = makeCanvasTexture(256, 256, (ctx, w, h) => {
const gradient = ctx.createRadialGradient(w / 2, h / 2, 0, w / 2, h / 2, w / 2);
gradient.addColorStop(0, "rgba(255,255,255,0.72)");
gradient.addColorStop(0.42, "rgba(255,255,255,0.24)");
gradient.addColorStop(1, "rgba(255,255,255,0)");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, w, h);
});
function makeCaseCaption(number, title, subtitle) {
const texture = makeCanvasTexture(1200, 230, (ctx, w, h) => {
ctx.fillStyle = "#eee8da";
ctx.fillRect(0, 0, w, h);
ctx.fillStyle = "#d76c3d";
ctx.fillRect(0, 0, 18, h);
ctx.fillStyle = "#173d37";
ctx.beginPath();
ctx.arc(75, h / 2, 42, 0, Math.PI * 2);
ctx.fill();
ctx.fillStyle = "#ffffff";
ctx.font = "800 28px Arial";
ctx.textAlign = "center";
ctx.fillText(number, 75, h / 2 + 10);
ctx.textAlign = "left";
ctx.font = "700 47px Georgia";
ctx.fillText(title.toUpperCase(), 145, 91);
ctx.fillStyle = "#66736d";
ctx.font = "400 29px Georgia";
ctx.fillText(subtitle, 148, 146);
ctx.strokeStyle = "rgba(23,61,55,0.18)";
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(145, 185);
ctx.lineTo(w - 45, 185);
ctx.stroke();
});
const material = new THREE.MeshBasicMaterial({
map: texture,
toneMapped: false
});
const caption = new THREE.Mesh(new THREE.PlaneGeometry(2.86, 0.55), material);
caption.position.set(0, 0.34, 1.112);
return caption;
}
function createCase(id, position, rotation, artifactFactory, captionData) {
const group = new THREE.Group();
group.position.copy(position);
group.rotation.y = rotation;
scene.add(group);
addBox(group, 3.2, 0.62, 2.2, materials.plinth, 0, 0.31, 0);
addBox(group, 3.08, 0.07, 2.08, materials.plinthTop, 0, 0.65, 0);
const glassMaterial = new THREE.MeshPhysicalMaterial({
color: 0xc9e3df,
transparent: true,
opacity: 0.23,
roughness: 0.09,
metalness: 0.08,
transmission: 0.08,
thickness: 0.1,
ior: 1.45,
clearcoat: 0.65,
clearcoatRoughness: 0.12,
depthWrite: false,
side: THREE.DoubleSide
});
const glassPanels = [
addBox(group, 3.05, 1.92, 0.025, glassMaterial, 0, 1.66, 1.01),
addBox(group, 3.05, 1.92, 0.025, glassMaterial, 0, 1.66, -1.01),
addBox(group, 0.025, 1.92, 2.02, glassMaterial, -1.525, 1.66, 0),
addBox(group, 0.025, 1.92, 2.02, glassMaterial, 1.525, 1.66, 0),
addBox(group, 3.05, 0.025, 2.02, glassMaterial, 0, 2.62, 0)
];
glassPanels.forEach((panel) => {
panel.castShadow = false;
panel.receiveShadow = false;
panel.renderOrder = 4;
});
[-1.525, 1.525].forEach((x) => {
[-1.01, 1.01].forEach((z) => {
addBox(group, 0.035, 1.98, 0.035, materials.frame, x, 1.66, z);
});
});
const edgeGeometry = new THREE.EdgesGeometry(
new THREE.BoxGeometry(3.05, 1.97, 2.02)
);
const edgeMaterial = new THREE.LineBasicMaterial({
color: 0x78938b,
transparent: true,
opacity: 0.62
});
const edges = new THREE.LineSegments(edgeGeometry, edgeMaterial);
edges.position.y = 1.66;
group.add(edges);
const glintMaterial = new THREE.MeshBasicMaterial({
color: 0xffffff,
transparent: true,
opacity: 0.1,
depthWrite: false,
blending: THREE.AdditiveBlending,
side: THREE.DoubleSide
});
const glintA = new THREE.Mesh(new THREE.PlaneGeometry(0.28, 1.38), glintMaterial);
glintA.position.set(-0.77, 1.66, 1.029);
glintA.rotation.z = -0.24;
glintA.renderOrder = 5;
group.add(glintA);
const glintB = new THREE.Mesh(new THREE.PlaneGeometry(0.09, 1.12), glintMaterial);
glintB.position.set(0.86, 1.61, 1.031);
glintB.rotation.z = -0.24;
glintB.renderOrder = 5;
group.add(glintB);
const sideGlint = new THREE.Mesh(
new THREE.PlaneGeometry(0.1, 1.28),
glintMaterial
);
sideGlint.position.set(1.541, 1.68, -0.15);
sideGlint.rotation.y = Math.PI / 2;
sideGlint.renderOrder = 5;
group.add(sideGlint);
const glowMaterial = new THREE.MeshBasicMaterial({
color: 0xe78143,
transparent: true,
opacity: 0,
depthWrite: false
});
const glowRing = new THREE.Mesh(
new THREE.TorusGeometry(1.19, 0.027, 8, 64),
glowMaterial
);
glowRing.rotation.x = Math.PI / 2;
glowRing.position.y = 0.697;
group.add(glowRing);
const content = artifactFactory();
content.position.y = 0.69;
group.add(content);
const contentMaterials = new Set();
content.traverse((object) => {
if (!object.isMesh || !object.material?.isMeshStandardMaterial) return;
const objectMaterials = Array.isArray(object.material)
? object.material
: [object.material];
objectMaterials.forEach((material) => contentMaterials.add(material));
});
const trackedMaterials = [...contentMaterials].map((material) => ({
material,
baseEmissive: material.emissiveIntensity ?? 0
}));
const spot = new THREE.SpotLight(0xffd7a1, 0, 4.7, 0.68, 0.68, 2);
spot.position.set(0, 2.53, 0.78);
spot.target.position.set(0, 0.85, 0);
group.add(spot, spot.target);
const point = new THREE.PointLight(0xffbd72, 0, 3.6, 2);
point.position.set(0, 1.28, 0.08);
group.add(point);
group.add(makeCaseCaption(captionData.number, captionData.title, captionData.subtitle));
const hitbox = new THREE.Mesh(
new THREE.BoxGeometry(3.16, 2.02, 2.15),
new THREE.MeshBasicMaterial({
transparent: true,
opacity: 0,
depthWrite: false,
colorWrite: false
})
);
hitbox.position.y = 1.66;
hitbox.userData.caseIndex = id;
group.add(hitbox);
pickTargets.push(hitbox);
const floorReflection = new THREE.Mesh(
new THREE.PlaneGeometry(3.5, 2.55),
new THREE.MeshBasicMaterial({
map: reflectionTexture,
color: 0xe8f5ef,
transparent: true,
opacity: 0.045,
depthWrite: false,
blending: THREE.AdditiveBlending
})
);
floorReflection.rotation.x = -Math.PI / 2;
floorReflection.position.set(position.x, 0.009, position.z);
scene.add(floorReflection);
const exhibitCase = {
id,
group,
position: position.clone(),
glassMaterial,
edgeMaterial,
glintMaterial,
glowMaterial,
floorReflection,
content,
contentMaterials: trackedMaterials,
animator: content.userData.animate,
spot,
point,
hover: false
};
exhibitCases.push(exhibitCase);
return exhibitCase;
}
createCase(
0,
new THREE.Vector3(-4.8, 0, -2.2),
0.05,
makeLantern,
{
number: "01",
title: "Shared Lantern",
subtitle: "A light passed from door to door"
}
);
createCase(
1,
new THREE.Vector3(0.4, 0, -3.4),
-0.03,
makeTideMarker,
{
number: "02",
title: "Tide Marker",
subtitle: "A carved record of the changing shoreline"
}
);
createCase(
2,
new THREE.Vector3(4.8, 0, -1.6),
-0.1,
makeSeedKeepers,
{
number: "03",
title: "Seed Keepers",
subtitle: "Garden varieties carried across the neighborhood"
}
);
createCase(
3,
new THREE.Vector3(-1.8, 0, 3.3),
0.08,
makeCornerStories,
{
number: "04",
title: "Corner Stories",
subtitle: "A hand-built model of the first community block"
}
);
// ------------------------------------------------------------
// Exhibit information and selection UI
// ------------------------------------------------------------
const caseInformation = [
{
title: "The Shared Lantern",
category: "Light / Memory",
description:
"This amber lantern traveled between porches during winter gatherings. Its engraved base lists every household that once carried it.",
quote: "A light is small, but nobody carries it alone.",
contributor: "Mina Patel and the Ridgeview Block"
},
{
title: "The Tide Marker",
category: "Place / Change",
description:
"A community member carved this miniature whale after the shoreline moved beyond the old footpath. It maps memories rather than a fixed coast.",
quote: "The water always returns, but never in quite the same way.",
contributor: "Owen Reyes, Harbor Street"
},
{
title: "Seed Keepers",
category: "Garden / Continuity",
description:
"These three vessels hold seeds exchanged by local gardeners. Their leaves represent the families and growing traditions that continue together.",
quote: "Every garden begins with someone sharing a handful.",
contributor: "The Common Ground Garden Circle"
},
{
title: "Corner Stories",
category: "Model / Belonging",
description:
"Built from photographs and memories, this model records the first neighborhood gathering place and the homes gathered around it.",
quote: "A place becomes ours by the stories we build there.",
contributor: "Jun Park and the Corner Street Families"
}
];
const caseNav = document.querySelector("#caseNav");
const detail = document.querySelector("#detail");
const caseIndex = document.querySelector("#caseIndex");
const caseCategory = document.querySelector("#caseCategory");
const caseTitle = document.querySelector("#caseTitle");
const caseDescription = document.querySelector("#caseDescription");
const caseQuote = document.querySelector("#caseQuote");
const caseContributor = document.querySelector("#caseContributor");
const focusCaseButton = document.querySelector("#focusCase");
caseInformation.forEach((information, index) => {
const button = document.createElement("button");
button.type = "button";
button.dataset.case = String(index);
button.innerHTML = `
<span>${String(index + 1).padStart(2, "0")}</span>
<strong>${information.title.replace(/^The /, "")}</strong>
`;
button.addEventListener("click", () => selectCase(index));
caseNav.appendChild(button);
});
let selectedCase = 0;
let hoveredCase = -1;
function selectCase(index) {
selectedCase = index;
[...caseNav.children].forEach((button, buttonIndex) => {
button.classList.toggle("active", buttonIndex === index);
});
if (index < 0) {
detail.classList.add("hidden");
return;
}
const information = caseInformation[index];
caseIndex.textContent = String(index + 1).padStart(2, "0");
caseCategory.textContent = information.category;
caseTitle.textContent = information.title;
caseDescription.textContent = information.description;
caseQuote.textContent = `“${information.quote}”`;
caseContributor.textContent = information.contributor;
detail.classList.remove("hidden");
}
document.querySelector("#closeDetail").addEventListener("click", () => {
selectCase(-1);
});
// ------------------------------------------------------------
// Custom camera controls: orbit, zoom, touch, keyboard
// ------------------------------------------------------------
const pointerPositions = new Map();
let lastSinglePointer = null;
let gestureMoved = 0;
let pinchStartDistance = 0;
let pinchStartRadius = spherical.radius;
let cameraTween = null;
function pointerDistance() {
const points = [...pointerPositions.values()];
if (points.length < 2) return 0;
return Math.hypot(
points[0].x - points[1].x,
points[0].y - points[1].y
);
}
function cancelCameraTween() {
cameraTween = null;
}
renderer.domElement.addEventListener("pointerdown", (event) => {
if (event.pointerType === "mouse" && event.button !== 0) return;
cancelCameraTween();
pointerPositions.set(event.pointerId, {
x: event.clientX,
y: event.clientY
});
renderer.domElement.setPointerCapture(event.pointerId);
if (pointerPositions.size === 1) {
lastSinglePointer = {
x: event.clientX,
y: event.clientY
};
gestureMoved = 0;
} else if (pointerPositions.size === 2) {
pinchStartDistance = pointerDistance();
pinchStartRadius = spherical.radius;
gestureMoved = 100;
}
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (pointerPositions.has(event.pointerId)) {
pointerPositions.set(event.pointerId, {
x: event.clientX,
y: event.clientY
});
if (pointerPositions.size === 1 && lastSinglePointer) {
const dx = event.clientX - lastSinglePointer.x;
const dy = event.clientY - lastSinglePointer.y;
gestureMoved += Math.abs(dx) + Math.abs(dy);
spherical.theta -= dx * 0.0052;
spherical.phi = THREE.MathUtils.clamp(
spherical.phi - dy * 0.0045,
0.35,
1.38
);
lastSinglePointer = {
x: event.clientX,
y: event.clientY
};
updateCamera();
} else if (pointerPositions.size >= 2) {
const distance = pointerDistance();
if (distance > 0 && pinchStartDistance > 0) {
spherical.radius = THREE.MathUtils.clamp(
pinchStartRadius * (pinchStartDistance / distance),
8.2,
23
);
updateCamera();
}
}
} else {
const hit = pickCase(event.clientX, event.clientY);
setHoveredCase(hit);
}
});
renderer.domElement.addEventListener("pointerup", (event) => {
const wasSingle = pointerPositions.size === 1;
pointerPositions.delete(event.pointerId);
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
if (wasSingle && gestureMoved < 7) {
const hit = pickCase(event.clientX, event.clientY);
if (hit !== -1) selectCase(hit);
}
if (pointerPositions.size === 1) {
const remaining = [...pointerPositions.values()][0];
lastSinglePointer = { ...remaining };
gestureMoved = 100;
}
});
renderer.domElement.addEventListener("pointercancel", (event) => {
pointerPositions.delete(event.pointerId);
lastSinglePointer = null;
});
renderer.domElement.addEventListener("pointerleave", () => {
if (pointerPositions.size === 0) setHoveredCase(-1);
});
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
cancelCameraTween();
spherical.radius = THREE.MathUtils.clamp(
spherical.radius + event.deltaY * 0.012,
8.2,
23
);
updateCamera();
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", (event) => {
const hit = pickCase(event.clientX, event.clientY);
if (hit !== -1) {
selectCase(hit);
focusSelected();
}
});
window.addEventListener("keydown", (event) => {
if (event.key >= "1" && event.key <= "4") {
selectCase(Number(event.key) - 1);
} else if (event.key.toLowerCase() === "f") {
focusSelected();
} else if (event.key.toLowerCase() === "r") {
resetView();
} else if (event.key === "Escape") {
selectCase(-1);
}
});
function focusSelected() {
if (selectedCase < 0) return;
const exhibitCase = exhibitCases[selectedCase];
const target = exhibitCase.position.clone();
target.y = 1.1;
cameraTween = {
started: performance.now(),
duration: 850,
fromTarget: cameraTarget.clone(),
toTarget: target,
fromRadius: spherical.radius,
toRadius: 8.6,
fromTheta: spherical.theta,
toTheta: 0.36,
fromPhi: spherical.phi,
toPhi: 1.02
};
}
function resetView() {
cameraTween = {
started: performance.now(),
duration: 900,
fromTarget: cameraTarget.clone(),
toTarget: homeTarget.clone(),
fromRadius: spherical.radius,
toRadius: 16.8,
fromTheta: spherical.theta,
toTheta: 0.68,
fromPhi: spherical.phi,
toPhi: 1.03
};
}
focusCaseButton.addEventListener("click", focusSelected);
// ------------------------------------------------------------
// Raycasting
// ------------------------------------------------------------
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function pickCase(clientX, clientY) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((clientY - rect.top) / rect.height) * 2 + 1;
scene.updateMatrixWorld(true);
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(pickTargets, false);
return intersections.length
? intersections[0].object.userData.caseIndex
: -1;
}
function setHoveredCase(index) {
if (hoveredCase === index) return;
hoveredCase = index;
exhibitCases.forEach((exhibitCase) => {
exhibitCase.hover = exhibitCase.id === index;
});
renderer.domElement.style.cursor = index !== -1 ? "pointer" : "grab";
}
// ------------------------------------------------------------
// Resize and animation
// ------------------------------------------------------------
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
});
function damp(current, target, speed, delta) {
return THREE.MathUtils.lerp(
current,
target,
1 - Math.exp(-speed * delta)
);
}
const defaultEdgeColor = new THREE.Color(0x78938b);
const selectedEdgeColor = new THREE.Color(0xd76c3d);
const hoverEdgeColor = new THREE.Color(0xe4b36f);
const clock = new THREE.Clock();
function animate() {
requestAnimationFrame(animate);
const delta = Math.min(clock.getDelta(), 0.05);
const time = clock.elapsedTime;
if (cameraTween) {
const progress = THREE.MathUtils.clamp(
(performance.now() - cameraTween.started) / cameraTween.duration,
0,
1
);
const eased =
progress < 0.5
? 4 * progress * progress * progress
: 1 - Math.pow(-2 * progress + 2, 3) / 2;
cameraTarget.lerpVectors(
cameraTween.fromTarget,
cameraTween.toTarget,
eased
);
spherical.radius = THREE.MathUtils.lerp(
cameraTween.fromRadius,
cameraTween.toRadius,
eased
);
spherical.theta = THREE.MathUtils.lerp(
cameraTween.fromTheta,
cameraTween.toTheta,
eased
);
spherical.phi = THREE.MathUtils.lerp(
cameraTween.fromPhi,
cameraTween.toPhi,
eased
);
if (progress >= 1) cameraTween = null;
}
updateCamera();
exhibitCases.forEach((exhibitCase) => {
const isSelected = exhibitCase.id === selectedCase;
const distance = selectedCase >= 0
? Math.hypot(
exhibitCase.position.x - exhibitCases[selectedCase].position.x,
exhibitCase.position.z - exhibitCases[selectedCase].position.z
)
: Infinity;
const isNearby = distance < 5.9;
exhibitCase.spot.intensity = damp(
exhibitCase.spot.intensity,
isSelected ? 38 : 0,
6,
delta
);
exhibitCase.point.intensity = damp(
exhibitCase.point.intensity,
isSelected ? 5.4 : 0,
6,
delta
);
exhibitCase.glowMaterial.opacity = damp(
exhibitCase.glowMaterial.opacity,
isSelected ? 0.9 : 0,
6,
delta
);
const glassTarget = isSelected ? 0.14 : isNearby ? 0.17 : 0.23;
exhibitCase.glassMaterial.opacity = damp(
exhibitCase.glassMaterial.opacity,
glassTarget,
5,
delta
);
// Reflections around the selected object are deliberately softened.
const reflectionTarget = isSelected
? 0.015
: isNearby
? 0.022
: 0.1;
exhibitCase.glintMaterial.opacity = damp(
exhibitCase.glintMaterial.opacity,
reflectionTarget,
5,
delta
);
const floorReflectionTarget = isSelected
? 0.016
: isNearby
? 0.022
: 0.05;
exhibitCase.floorReflection.material.opacity = damp(
exhibitCase.floorReflection.material.opacity,
floorReflectionTarget,
5,
delta
);
exhibitCase.contentMaterials.forEach(({ material, baseEmissive }) => {
material.emissiveIntensity = damp(
material.emissiveIntensity ?? 0,
baseEmissive + (isSelected ? 0.34 : 0),
6,
delta
);
});
const targetEdgeColor = isSelected
? selectedEdgeColor
: exhibitCase.hover
? hoverEdgeColor
: defaultEdgeColor;
exhibitCase.edgeMaterial.color.lerp(
targetEdgeColor,
1 - Math.exp(-10 * delta)
);
exhibitCase.animator?.(time);
});
renderer.render(scene, camera);
}
selectCase(0);
animate();
requestAnimationFrame(() => {
loading.classList.add("done");
setTimeout(() => loading.remove(), 600);
});
</script>
</body>
</html>
```