Prompt specification
Build or customize the Three.js 3D scene "Accessible lecture room demonstration" 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: Accessible lecture room demonstration
Category: Architecture & Cities · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/accessible-lecture-room-demonstration-x0439
Scene Description Prompt:
Create a single self-contained HTML file using Three.js from cdnjs that shows hearing assistance systems. Compose a lecture room with speaker, projected captions, and assistance-system diagram; selectable viewpoints show how several communication channels refer to the same presentation moment. Stylized solid forms.
Working Three.js Starter (accessible-lecture-room-demonstration-x0439):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hearing Assistance Systems — One Presentation, Many Channels</title>
<style>
:root {
--ink: #16263a;
--muted: #627083;
--paper: #f5f1e8;
--panel: rgba(250, 248, 242, 0.92);
--line: rgba(22, 38, 58, 0.14);
--captions: #1a9d9a;
--hearing: #ef6b61;
--loop: #d7a735;
--interpretation: #716bd5;
}
* { box-sizing: border-box; }
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #e9e4da;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button, input { font: inherit; }
#scene {
position: fixed;
inset: 0;
}
#scene canvas {
display: block;
width: 100%;
height: 100%;
cursor: grab;
touch-action: none;
}
#scene canvas:active { cursor: grabbing; }
.masthead {
position: fixed;
z-index: 10;
top: 24px;
left: 28px;
max-width: 510px;
pointer-events: none;
}
.eyebrow {
display: inline-flex;
align-items: center;
gap: 9px;
margin-bottom: 10px;
color: var(--captions);
font-size: 11px;
font-weight: 800;
letter-spacing: .15em;
text-transform: uppercase;
}
.eyebrow::before {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: currentColor;
box-shadow: 0 0 0 5px rgba(26, 157, 154, .12);
}
h1 {
margin: 0;
max-width: 500px;
font-size: clamp(28px, 3.2vw, 49px);
line-height: .98;
letter-spacing: -.045em;
font-weight: 760;
}
.masthead p {
max-width: 440px;
margin: 13px 0 0;
color: var(--muted);
font-size: 14px;
line-height: 1.45;
}
.control-panel {
position: fixed;
z-index: 20;
top: 24px;
right: 24px;
width: 310px;
max-height: calc(100vh - 48px);
overflow: auto;
padding: 18px;
border: 1px solid rgba(255, 255, 255, .65);
border-radius: 20px;
background: var(--panel);
box-shadow: 0 18px 55px rgba(22, 38, 58, .14);
backdrop-filter: blur(16px);
scrollbar-width: thin;
}
.panel-heading {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
font-size: 10px;
font-weight: 800;
letter-spacing: .14em;
text-transform: uppercase;
}
.panel-heading span:last-child {
color: #8791a0;
font-weight: 700;
}
.view-list {
display: grid;
gap: 6px;
}
.view-button {
display: grid;
grid-template-columns: 29px 1fr 18px;
align-items: center;
width: 100%;
padding: 9px 10px;
border: 1px solid transparent;
border-radius: 11px;
background: transparent;
color: var(--ink);
text-align: left;
cursor: pointer;
transition: background .18s, border-color .18s, transform .18s;
}
.view-button:hover {
background: rgba(22, 38, 58, .05);
transform: translateX(-2px);
}
.view-button.active {
border-color: rgba(22, 38, 58, .12);
background: #fff;
box-shadow: 0 5px 16px rgba(22, 38, 58, .07);
}
.view-number {
color: #8993a1;
font-size: 10px;
font-weight: 800;
letter-spacing: .08em;
}
.view-button.active .view-number { color: var(--captions); }
.view-name {
font-size: 13px;
font-weight: 720;
}
.view-arrow {
color: #9aa3ae;
font-size: 16px;
opacity: 0;
transform: translateX(-4px);
transition: .18s;
}
.view-button.active .view-arrow {
opacity: 1;
transform: none;
color: var(--captions);
}
.divider {
height: 1px;
margin: 16px 0;
background: var(--line);
}
.channel-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 7px;
}
.channel-button {
position: relative;
min-height: 66px;
padding: 10px 9px 9px 12px;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, .55);
color: var(--ink);
text-align: left;
cursor: pointer;
transition: .18s;
}
.channel-button:hover {
background: #fff;
transform: translateY(-1px);
}
.channel-button.active {
border-color: var(--channel-color);
box-shadow: inset 0 0 0 1px var(--channel-color);
background: #fff;
}
.channel-button::before {
content: "";
position: absolute;
top: 12px;
bottom: 12px;
left: 0;
width: 4px;
border-radius: 0 4px 4px 0;
background: var(--channel-color);
}
.channel-title {
display: block;
margin-bottom: 6px;
font-size: 11px;
line-height: 1.15;
font-weight: 760;
}
.channel-time {
display: flex;
align-items: center;
gap: 5px;
color: var(--muted);
font-size: 10px;
font-variant-numeric: tabular-nums;
}
.channel-time::before {
content: "";
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--channel-color);
}
.channel-focus {
min-height: 57px;
margin-top: 12px;
padding: 11px 12px;
border-radius: 12px;
background: var(--ink);
color: white;
}
.channel-focus strong {
display: block;
margin-bottom: 5px;
color: #fff;
font-size: 11px;
letter-spacing: .04em;
}
.channel-focus p {
margin: 0;
color: rgba(255, 255, 255, .7);
font-size: 11px;
line-height: 1.4;
}
.moment-bar {
position: fixed;
z-index: 20;
left: 50%;
bottom: 24px;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 15px;
width: min(680px, calc(100vw - 48px));
padding: 13px 16px;
border: 1px solid rgba(255, 255, 255, .7);
border-radius: 17px;
background: rgba(250, 248, 242, .94);
box-shadow: 0 16px 42px rgba(22, 38, 58, .15);
backdrop-filter: blur(14px);
transform: translateX(-50%);
}
.play-button {
display: grid;
place-items: center;
width: 36px;
height: 36px;
padding: 0;
border: 0;
border-radius: 50%;
background: var(--ink);
color: white;
cursor: pointer;
font-size: 12px;
}
.timeline-wrap { min-width: 0; }
.timeline-labels {
display: flex;
justify-content: space-between;
margin-bottom: 6px;
color: var(--muted);
font-size: 9px;
font-weight: 750;
letter-spacing: .08em;
text-transform: uppercase;
}
input[type="range"] {
--progress: 50%;
display: block;
width: 100%;
height: 5px;
margin: 0;
border-radius: 10px;
outline: none;
background: linear-gradient(
to right,
var(--captions) 0 var(--progress),
#d9ddd9 var(--progress) 100%
);
appearance: none;
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
width: 15px;
height: 15px;
border: 3px solid white;
border-radius: 50%;
background: var(--captions);
box-shadow: 0 2px 8px rgba(22, 38, 58, .25);
appearance: none;
}
input[type="range"]::-moz-range-thumb {
width: 10px;
height: 10px;
border: 3px solid white;
border-radius: 50%;
background: var(--captions);
box-shadow: 0 2px 8px rgba(22, 38, 58, .25);
}
.shared-time {
min-width: 65px;
text-align: right;
}
.shared-time strong {
display: block;
font-size: 18px;
line-height: 1;
letter-spacing: -.03em;
font-variant-numeric: tabular-nums;
}
.shared-time span {
color: var(--muted);
font-size: 8px;
font-weight: 800;
letter-spacing: .1em;
text-transform: uppercase;
}
.hint {
position: fixed;
z-index: 8;
left: 28px;
bottom: 30px;
color: rgba(22, 38, 58, .62);
font-size: 10px;
line-height: 1.5;
pointer-events: none;
}
.hint strong {
color: var(--ink);
font-weight: 800;
}
.loading {
position: fixed;
z-index: 100;
inset: 0;
display: grid;
place-items: center;
background: #e9e4da;
color: var(--ink);
font-size: 12px;
font-weight: 750;
letter-spacing: .12em;
text-transform: uppercase;
transition: opacity .35s;
}
.loading.hidden { opacity: 0; pointer-events: none; }
@media (max-width: 850px) {
.masthead {
top: 16px;
left: 16px;
max-width: calc(100vw - 32px);
}
.masthead p { display: none; }
h1 { max-width: 340px; font-size: 30px; }
.control-panel {
top: auto;
right: 12px;
bottom: 96px;
width: 264px;
max-height: 48vh;
padding: 13px;
border-radius: 16px;
}
.view-list {
grid-template-columns: 1fr 1fr;
}
.view-button {
grid-template-columns: 23px 1fr;
padding: 8px;
}
.view-arrow { display: none; }
.channel-focus { display: none; }
.moment-bar { bottom: 12px; width: calc(100vw - 24px); }
.hint { display: none; }
}
</style>
</head>
<body>
<div id="scene" aria-label="Interactive three-dimensional lecture room"></div>
<header class="masthead">
<div class="eyebrow">Hearing access lab</div>
<h1>One lecture.<br>Many ways to hear.</h1>
<p>
Select a viewpoint or communication channel to see how captions,
assistive listening, induction loop, and interpretation refer to the
same presentation moment.
</p>
</header>
<aside class="control-panel" aria-label="Scene controls">
<div class="panel-heading">
<span>Selectable viewpoints</span>
<span>01—06</span>
</div>
<nav class="view-list">
<button class="view-button active" data-view="overview">
<span class="view-number">01</span>
<span class="view-name">Lecture room</span>
<span class="view-arrow">↗</span>
</button>
<button class="view-button" data-view="speaker">
<span class="view-number">02</span>
<span class="view-name">Speaker & source</span>
<span class="view-arrow">↗</span>
</button>
<button class="view-button" data-view="captions">
<span class="view-number">03</span>
<span class="view-name">Projected captions</span>
<span class="view-arrow">↗</span>
</button>
<button class="view-button" data-view="network">
<span class="view-number">04</span>
<span class="view-name">Channel map</span>
<span class="view-arrow">↗</span>
</button>
<button class="view-button" data-view="listener">
<span class="view-number">05</span>
<span class="view-name">Assisted listener</span>
<span class="view-arrow">↗</span>
</button>
<button class="view-button" data-view="interpreter">
<span class="view-number">06</span>
<span class="view-name">Interpretation relay</span>
<span class="view-arrow">↗</span>
</button>
</nav>
<div class="divider"></div>
<div class="panel-heading">
<span>Communication channels</span>
<span>4 synchronized</span>
</div>
<div class="channel-grid">
<button class="channel-button active" data-channel="captions"
style="--channel-color: var(--captions)">
<span class="channel-title">Live captions</span>
<span class="channel-time" data-time>08:42</span>
</button>
<button class="channel-button" data-channel="hearing"
style="--channel-color: var(--hearing)">
<span class="channel-title">Assistive listening</span>
<span class="channel-time" data-time>08:42</span>
</button>
<button class="channel-button" data-channel="loop"
style="--channel-color: var(--loop)">
<span class="channel-title">Induction loop</span>
<span class="channel-time" data-time>08:42</span>
</button>
<button class="channel-button" data-channel="interpretation"
style="--channel-color: var(--interpretation)">
<span class="channel-title">Interpretation relay</span>
<span class="channel-time" data-time>08:42</span>
</button>
</div>
<div class="channel-focus" aria-live="polite">
<strong id="focus-title">LIVE CAPTIONS</strong>
<p id="focus-copy">
The spoken sentence becomes a synchronized visual text stream on the wall.
</p>
</div>
</aside>
<section class="moment-bar" aria-label="Shared presentation moment">
<button class="play-button" id="play" aria-label="Play shared timeline">▶</button>
<div class="timeline-wrap">
<div class="timeline-labels">
<span>Shared presentation moment</span>
<span>Scrub all channels</span>
</div>
<input id="timeline" type="range" min="522" max="526" step="1" value="522"
aria-label="Presentation timestamp">
</div>
<div class="shared-time">
<strong id="shared-time">08:42</strong>
<span>all aligned</span>
</div>
</section>
<div class="hint">
<strong>Drag</strong> to orbit · <strong>Scroll</strong> to zoom ·<br>
<strong>Click a route</strong> or use keys 1–6
</div>
<div class="loading" id="loading">Building the lecture room…</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const $ = (selector) => document.querySelector(selector);
const $$ = (selector) => [...document.querySelectorAll(selector)];
const sceneHost = $("#scene");
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xe9e4da);
scene.fog = new THREE.Fog(0xe9e4da, 26, 48);
const renderer = new THREE.WebGLRenderer({ antialias: true });
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;
sceneHost.appendChild(renderer.domElement);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
100
);
const hemisphere = new THREE.HemisphereLight(0xfffbef, 0x85909b, 2.15);
scene.add(hemisphere);
const keyLight = new THREE.DirectionalLight(0xfff4dc, 3.2);
keyLight.position.set(-6, 11, 8);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -13;
keyLight.shadow.camera.right = 13;
keyLight.shadow.camera.top = 12;
keyLight.shadow.camera.bottom = -12;
keyLight.shadow.bias = -0.0004;
scene.add(keyLight);
const fillLight = new THREE.DirectionalLight(0xcce8f0, 1.0);
fillLight.position.set(8, 6, -3);
scene.add(fillLight);
const palette = {
ink: 0x16263a,
navy: 0x26394f,
cream: 0xf4efe4,
white: 0xfffdf8,
teal: 0x1a9d9a,
coral: 0xef6b61,
gold: 0xd7a735,
purple: 0x716bd5,
skin: 0xc98f69,
darkSkin: 0x81563f,
wood: 0xc99b68,
wall: 0xe7e1d5,
floor: 0xd7d0c4
};
const material = (color, extra = {}) =>
new THREE.MeshStandardMaterial({
color,
roughness: 0.82,
metalness: 0,
...extra
});
const M = {
ink: material(palette.ink),
navy: material(palette.navy),
cream: material(palette.cream),
white: material(palette.white),
wall: material(palette.wall),
floor: material(palette.floor),
wood: material(palette.wood),
skin: material(palette.skin),
darkSkin: material(palette.darkSkin),
teal: material(palette.teal),
coral: material(palette.coral),
gold: material(palette.gold),
purple: material(palette.purple)
};
function box(w, h, d, mat, x = 0, y = 0, z = 0, parent = scene) {
const mesh = new THREE.Mesh(new THREE.BoxGeometry(w, h, d), mat);
mesh.position.set(x, y, z);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function sphere(radius, mat, x, y, z, parent = scene, segments = 20) {
const mesh = new THREE.Mesh(
new THREE.SphereGeometry(radius, segments, Math.max(12, segments / 2)),
mat
);
mesh.position.set(x, y, z);
mesh.castShadow = true;
parent.add(mesh);
return mesh;
}
function cylinderBetween(a, b, radius, mat, parent = scene, radialSegments = 12) {
const va = new THREE.Vector3(...a);
const vb = new THREE.Vector3(...b);
const direction = vb.clone().sub(va);
const mesh = new THREE.Mesh(
new THREE.CylinderGeometry(
radius,
radius,
direction.length(),
radialSegments
),
mat
);
mesh.position.copy(va).add(vb).multiplyScalar(0.5);
mesh.quaternion.setFromUnitVectors(
new THREE.Vector3(0, 1, 0),
direction.clone().normalize()
);
mesh.castShadow = true;
parent.add(mesh);
return mesh;
}
function roundedRect(ctx, x, y, w, h, r) {
const radius = Math.min(r, w / 2, h / 2);
ctx.beginPath();
ctx.moveTo(x + radius, y);
ctx.arcTo(x + w, y, x + w, y + h, radius);
ctx.arcTo(x + w, y + h, x, y + h, radius);
ctx.arcTo(x, y + h, x, y, radius);
ctx.arcTo(x, y, x + w, y, radius);
ctx.closePath();
}
function makeLabel(width, height, title, subtitle = "", options = {}) {
const canvas = document.createElement("canvas");
canvas.width = 1024;
canvas.height = Math.max(160, Math.round(1024 * height / width));
const ctx = canvas.getContext("2d");
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.minFilter = THREE.LinearFilter;
const mesh = new THREE.Mesh(
new THREE.PlaneGeometry(width, height),
new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
depthWrite: false,
side: THREE.DoubleSide
})
);
function draw(nextTitle = title, nextSubtitle = subtitle, active = false) {
const w = canvas.width;
const h = canvas.height;
ctx.clearRect(0, 0, w, h);
if (options.bg !== false) {
roundedRect(ctx, 4, 4, w - 8, h - 8, 28);
ctx.fillStyle = options.bg || "rgba(250,248,242,0.94)";
ctx.fill();
ctx.lineWidth = active ? 9 : 3;
ctx.strokeStyle = active
? (options.accent || "#1a9d9a")
: (options.border || "rgba(22,38,58,0.16)");
ctx.stroke();
}
const titleY = subtitle ? h * 0.39 : h * 0.53;
ctx.fillStyle = options.fg || "#16263a";
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.font = `${options.weight || 800} ${options.titleSize || 54}px Arial, sans-serif`;
ctx.fillText(nextTitle, w / 2, titleY, w - 60);
if (nextSubtitle) {
ctx.fillStyle = options.subColor || "#627083";
ctx.font = `700 ${options.subSize || 34}px Arial, sans-serif`;
ctx.fillText(nextSubtitle, w / 2, h * 0.72, w - 70);
}
texture.needsUpdate = true;
}
draw(title, subtitle, options.active || false);
return {
mesh,
texture,
draw,
setActive(active) {
draw(title, subtitle, active);
}
};
}
// Room shell.
box(18, 0.24, 14, M.floor, 0, -0.12, 0);
box(18, 6, 0.22, M.wall, 0, 3, -7);
box(0.22, 6, 14, M.wall, -9, 3, 0);
// Architectural wall rhythm.
for (let x = -7.5; x <= 7.5; x += 2.5) {
box(0.055, 5.5, 0.05, M.cream, x, 3, -6.86);
}
box(10.4, 0.26, 3.2, material(0xb9aa95), -1.4, 0.13, -5.25);
box(10.55, 0.09, 3.3, M.cream, -1.4, 0.30, -5.25);
// A few audience chairs establish the lecture-room scale.
function chair(x, z, color = 0x526678, rotation = 0) {
const group = new THREE.Group();
group.position.set(x, 0, z);
group.rotation.y = rotation;
const chairMat = material(color);
box(0.76, 0.14, 0.70, chairMat, 0, 0.58, 0, group);
box(0.76, 0.70, 0.14, chairMat, 0, 0.96, 0.34, group);
box(0.08, 0.58, 0.08, M.ink, -0.29, 0.29, -0.23, group);
box(0.08, 0.58, 0.08, M.ink, 0.29, 0.29, -0.23, group);
scene.add(group);
}
for (const z of [3.0, 4.35, 5.7]) {
chair(-3.0, z, 0x526678, 0.02);
chair(-1.55, z, 0x607487, -0.02);
chair(-0.1, z, 0x526678, 0.02);
}
// Projected caption screen.
box(7.9, 4.2, 0.18, M.ink, -1.65, 3.55, -6.78);
box(7.62, 3.93, 0.08, M.navy, -1.65, 3.55, -6.66);
const screenCanvas = document.createElement("canvas");
screenCanvas.width = 1536;
screenCanvas.height = 768;
const screenCtx = screenCanvas.getContext("2d");
const screenTexture = new THREE.CanvasTexture(screenCanvas);
screenTexture.colorSpace = THREE.SRGBColorSpace;
screenTexture.minFilter = THREE.LinearFilter;
const screenMesh = new THREE.Mesh(
new THREE.PlaneGeometry(7.42, 3.72),
new THREE.MeshBasicMaterial({ map: screenTexture })
);
screenMesh.position.set(-1.65, 3.55, -6.58);
screenMesh.userData.channel = "captions";
scene.add(screenMesh);
// Ceiling projector and a restrained translucent projection beam.
box(0.72, 0.25, 0.58, M.ink, -1.65, 5.25, -4.8);
const beamGeometry = new THREE.BufferGeometry();
beamGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute([
-1.78, 5.18, -4.95,
-5.35, 5.35, -6.56,
2.05, 5.35, -6.56,
-1.78, 5.18, -4.95,
2.05, 5.35, -6.56,
2.05, 1.74, -6.56,
-1.78, 5.18, -4.95,
2.05, 1.74, -6.56,
-5.35, 1.74, -6.56,
-1.78, 5.18, -4.95,
-5.35, 1.74, -6.56,
-5.35, 5.35, -6.56
], 3)
);
const beam = new THREE.Mesh(
beamGeometry,
new THREE.MeshBasicMaterial({
color: palette.teal,
transparent: true,
opacity: 0.055,
side: THREE.DoubleSide,
depthWrite: false
})
);
scene.add(beam);
// Speaker.
function standingPerson(x, z, shirtMat, skinMat, hairMat) {
const group = new THREE.Group();
group.position.set(x, 0.27, z);
const torso = new THREE.Mesh(
new THREE.CylinderGeometry(0.37, 0.49, 1.05, 16),
shirtMat
);
torso.position.y = 1.52;
torso.castShadow = true;
group.add(torso);
const neck = new THREE.Mesh(
new THREE.CylinderGeometry(0.12, 0.13, 0.18, 12),
skinMat
);
neck.position.y = 2.12;
group.add(neck);
const hair = sphere(0.335, hairMat, 0, 2.36, -0.045, group);
hair.scale.set(1, 1.02, 0.92);
sphere(0.295, skinMat, 0, 2.34, 0.07, group);
sphere(0.025, M.ink, -0.105, 2.39, 0.343, group, 10);
sphere(0.025, M.ink, 0.105, 2.39, 0.343, group, 10);
cylinderBetween([-0.19, 1.05, 0], [-0.23, 0.18, 0.03], 0.13, M.navy, group);
cylinderBetween([0.19, 1.05, 0], [0.23, 0.18, -0.03], 0.13, M.navy, group);
box(0.28, 0.12, 0.43, M.ink, -0.23, 0.08, 0.08, group);
box(0.28, 0.12, 0.43, M.ink, 0.23, 0.08, -0.02, group);
cylinderBetween([-0.35, 1.85, 0], [-0.60, 1.30, 0.12], 0.10, shirtMat, group);
cylinderBetween([0.35, 1.85, 0], [0.59, 1.48, 0.23], 0.10, shirtMat, group);
sphere(0.11, skinMat, 0.60, 1.46, 0.24, group);
scene.add(group);
return group;
}
standingPerson(
-5.15,
-4.95,
M.coral,
material(0xd39a75),
material(0x2d2630)
);
// Podium and microphone.
const podium = new THREE.Group();
podium.position.set(-5.15, 0.27, -4.02);
box(1.02, 1.25, 0.62, M.wood, 0, 0.63, 0, podium);
box(1.18, 0.13, 0.75, M.cream, 0, 1.30, 0, podium);
box(0.42, 0.04, 0.26, M.ink, 0, 1.39, 0.06, podium);
cylinderBetween([0.18, 1.40, 0.05], [0.27, 1.95, -0.03], 0.025, M.ink, podium);
sphere(0.065, M.ink, 0.28, 1.98, -0.03, podium, 12);
scene.add(podium);
const sourceTag = makeLabel(1.9, 0.42, "SPOKEN SOURCE", "microphone + room audio", {
bg: "rgba(250,248,242,0.94)",
titleSize: 50,
subSize: 29
});
sourceTag.mesh.position.set(-5.15, 3.0, -4.85);
scene.add(sourceTag.mesh);
// Hearing relay table and device.
box(1.35, 0.12, 0.85, M.cream, 3.05, 0.93, 0.28);
box(0.10, 0.90, 0.10, M.ink, 2.52, 0.47, 0.02);
box(0.10, 0.90, 0.10, M.ink, 3.58, 0.47, 0.02);
box(0.64, 0.34, 0.42, M.ink, 3.05, 1.16, 0.28);
sphere(0.055, M.coral, 3.20, 1.18, 0.505, scene, 12);
const relayTag = makeLabel(1.8, 0.40, "HEARING RELAY", "direct audio transmission", {
accent: "#ef6b61",
titleSize: 48,
subSize: 27
});
relayTag.mesh.position.set(3.05, 1.72, 0.32);
scene.add(relayTag.mesh);
// Seated listener and receiver.
function seatedPerson(x, z, shirtMat, skinMat, headset = true) {
const group = new THREE.Group();
group.position.set(x, 0, z);
const torso = new THREE.Mesh(
new THREE.CylinderGeometry(0.34, 0.40, 0.78, 16),
shirtMat
);
torso.position.y = 1.08;
torso.castShadow = true;
group.add(torso);
const neck = new THREE.Mesh(
new THREE.CylinderGeometry(0.11, 0.12, 0.17, 12),
skinMat
);
neck.position.y = 1.54;
group.add(neck);
sphere(0.295, skinMat, 0, 1.79, 0, group);
sphere(0.025, M.ink, -0.10, 1.83, 0.276, group, 10);
sphere(0.025, M.ink, 0.10, 1.83, 0.276, group, 10);
cylinderBetween([-0.17, 0.76, 0], [-0.19, 0.61, 0.48], 0.13, M.navy, group);
cylinderBetween([0.17, 0.76, 0], [0.19, 0.61, 0.48], 0.13, M.navy, group);
cylinderBetween([-0.19, 0.61, 0.48], [-0.19, 0.18, 0.55], 0.11, M.navy, group);
cylinderBetween([0.19, 0.61, 0.48], [0.19, 0.18, 0.55], 0.11, M.navy, group);
box(0.25, 0.11, 0.40, M.ink, -0.19, 0.10, 0.65, group);
box(0.25, 0.11, 0.40, M.ink, 0.19, 0.10, 0.65, group);
cylinderBetween([-0.31, 1.30, 0], [-0.47, 0.96, 0.20], 0.10, shirtMat, group);
cylinderBetween([0.31, 1.30, 0], [0.43, 1.06, 0.34], 0.10, shirtMat, group);
if (headset) {
const band = new THREE.Mesh(
new THREE.TorusGeometry(0.34, 0.035, 8, 30, Math.PI),
M.ink
);
band.position.set(0, 1.80, 0);
band.rotation.z = 0;
group.add(band);
sphere(0.10, M.ink, -0.31, 1.80, 0, group, 12);
sphere(0.10, M.ink, 0.31, 1.80, 0, group, 12);
}
// Small personal receiver.
box(0.18, 0.29, 0.10, M.cream, 0.36, 1.20, 0.31, group);
sphere(0.035, M.coral, 0.36, 1.25, 0.37, group, 10);
scene.add(group);
return group;
}
// Listener chair.
box(0.86, 0.17, 0.80, M.teal, 5.3, 0.62, 1.75);
box(0.86, 0.82, 0.14, M.teal, 5.3, 1.06, 2.10);
box(0.08, 0.62, 0.08, M.ink, 4.96, 0.31, 1.48);
box(0.08, 0.62, 0.08, M.ink, 5.64, 0.31, 1.48);
const listener = seatedPerson(
5.3,
1.61,
M.teal,
material(0xe0ad83),
true
);
const listenerTag = makeLabel(1.8, 0.40, "LISTENING POINT", "receiver + loop headset", {
accent: "#1a9d9a",
titleSize: 48,
subSize: 27
});
listenerTag.mesh.position.set(5.3, 2.56, 1.65);
scene.add(listenerTag.mesh);
// Induction loop around the listening area.
const loopPoints = [
new THREE.Vector3(3.35, 0.065, 0.65),
new THREE.Vector3(6.85, 0.065, 0.65),
new THREE.Vector3(7.10, 0.065, 1.05),
new THREE.Vector3(7.10, 0.065, 3.10),
new THREE.Vector3(6.85, 0.065, 3.50),
new THREE.Vector3(3.35, 0.065, 3.50),
new THREE.Vector3(3.10, 0.065, 3.10),
new THREE.Vector3(3.10, 0.065, 1.05)
];
const loopCurve = new THREE.CatmullRomCurve3(loopPoints, true, "catmullrom", 0.18);
const floorLoop = new THREE.Mesh(
new THREE.TubeGeometry(loopCurve, 160, 0.028, 7, true),
material(palette.gold, { emissive: palette.gold, emissiveIntensity: 0.18 })
);
scene.add(floorLoop);
const loopTag = makeLabel(1.55, 0.38, "INDUCTION LOOP", "magnetic field", {
accent: "#d7a735",
titleSize: 45,
subSize: 28
});
loopTag.mesh.position.set(6.35, 0.45, 3.38);
loopTag.mesh.rotation.x = -Math.PI / 2;
scene.add(loopTag.mesh);
// Interpreter station.
box(2.25, 0.16, 1.08, M.wood, -6.45, 1.05, 1.62);
box(0.12, 1.0, 0.12, M.ink, -7.42, 0.52, 1.38);
box(0.12, 1.0, 0.12, M.ink, -5.48, 0.52, 1.38);
box(0.12, 1.0, 0.12, M.ink, -7.42, 0.52, 1.90);
box(0.12, 1.0, 0.12, M.ink, -5.48, 0.52, 1.90);
box(0.65, 0.42, 0.10, M.ink, -6.72, 1.35, 1.68);
const interpreter = seatedPerson(
-6.45,
0.76,
M.purple,
material(0xb77c5b),
true
);
interpreter.rotation.y = 0;
const interpreterTag = makeLabel(2.0, 0.42, "INTERPRETATION RELAY", "signed / spoken relay", {
accent: "#716bd5",
titleSize: 43,
subSize: 27
});
interpreterTag.mesh.position.set(-6.45, 2.55, 0.85);
scene.add(interpreterTag.mesh);
// Assistance-system diagram board.
const board = new THREE.Group();
board.position.set(5.30, 2.72, -5.62);
scene.add(board);
box(4.85, 3.85, 0.18, M.ink, 0, 0, 0, board);
box(4.58, 3.58, 0.20, M.cream, 0, 0, 0.025, board);
const boardTitle = makeLabel(3.85, 0.46, "ONE MOMENT • MANY PATHS", "all routes share the same timestamp", {
bg: false,
titleSize: 50,
subSize: 28
});
boardTitle.mesh.position.set(0, 1.45, 0.16);
board.add(boardTitle.mesh);
const channelData = {
captions: {
color: palette.teal,
title: "CAPTIONS",
view: "captions",
copy: "The spoken sentence becomes a synchronized visual text stream on the wall."
},
hearing: {
color: palette.coral,
title: "HEARING RELAY",
view: "listener",
copy: "A direct audio route carries the same sentence to the listener’s personal receiver."
},
loop: {
color: palette.gold,
title: "INDUCTION LOOP",
view: "listener",
copy: "The magnetic loop delivers the same sentence to a compatible headset or hearing aid."
},
interpretation: {
color: palette.purple,
title: "INTERPRETATION",
view: "interpreter",
copy: "The interpreter relay presents the same presentation moment in another communication mode."
}
};
const boardPaths = {};
const boardNodes = {};
const boardLabels = {};
const selectable = [];
const sourceNode = new THREE.Mesh(
new THREE.CylinderGeometry(0.31, 0.31, 0.09, 28),
material(palette.ink, { emissive: palette.ink, emissiveIntensity: 0.2 })
);
sourceNode.rotation.x = Math.PI / 2;
sourceNode.position.set(0, -0.25, 0.17);
board.add(sourceNode);
const sourceBoardLabel = makeLabel(1.75, 0.48, "PRESENTATION", "08:42", {
titleSize: 48,
subSize: 34
});
sourceBoardLabel.mesh.position.set(0, -0.72, 0.18);
board.add(sourceBoardLabel.mesh);
boardLabels.source = sourceBoardLabel;
const nodePositions = {
captions: [-1.70, 0.62],
hearing: [1.70, 0.62],
loop: [-1.70, -1.18],
interpretation: [1.70, -1.18]
};
for (const [key, position] of Object.entries(nodePositions)) {
const data = channelData[key];
const node = new THREE.Mesh(
new THREE.CylinderGeometry(0.24, 0.24, 0.10, 24),
material(data.color, {
emissive: data.color,
emissiveIntensity: 0.25,
roughness: 0.65
})
);
node.rotation.x = Math.PI / 2;
node.position.set(position[0], position[1], 0.18);
node.userData.channel = key;
board.add(node);
boardNodes[key] = node;
selectable.push(node);
const control = new THREE.Vector3(
position[0] * 0.48,
-0.25 + (position[1] + 0.25) * 0.48,
0.17
);
const curve = new THREE.QuadraticBezierCurve3(
new THREE.Vector3(0, -0.25, 0.17),
control,
new THREE.Vector3(position[0], position[1], 0.17)
);
const path = new THREE.Mesh(
new THREE.TubeGeometry(curve, 48, 0.024, 7, false),
material(data.color, {
emissive: data.color,
emissiveIntensity: 0.35,
transparent: true,
opacity: 0.55
})
);
board.add(path);
boardPaths[key] = path;
const label = makeLabel(1.58, 0.46, data.title, "08:42", {
accent: `#${data.color.toString(16).padStart(6, "0")}`,
titleSize: 39,
subSize: 31
});
const labelY = position[1] > 0 ? position[1] + 0.48 : position[1] - 0.47;
label.mesh.position.set(position[0], labelY, 0.19);
board.add(label.mesh);
boardLabels[key] = label;
}
// Physical routes through the room.
const routePaths = {};
const routePulses = {};
function addRoute(key, points, radius = 0.035) {
const data = channelData[key];
const curve = new THREE.CatmullRomCurve3(
points.map((p) => new THREE.Vector3(...p)),
false,
"catmullrom",
0.28
);
const route = new THREE.Mesh(
new THREE.TubeGeometry(curve, 90, radius, 7, false),
material(data.color, {
emissive: data.color,
emissiveIntensity: 0.55,
transparent: true,
opacity: 0.28,
depthWrite: false
})
);
route.userData.channel = key;
scene.add(route);
routePaths[key] = route;
selectable.push(route);
const pulse = new THREE.Mesh(
new THREE.SphereGeometry(0.09, 14, 10),
new THREE.MeshBasicMaterial({ color: data.color })
);
scene.add(pulse);
routePulses[key] = { mesh: pulse, curve, offset: Math.random() };
}
addRoute("captions", [
[-5.05, 2.62, -4.92],
[-4.55, 3.12, -5.55],
[-3.25, 3.42, -6.42],
[-1.1, 3.45, -6.45]
], 0.030);
addRoute("hearing", [
[-5.05, 2.55, -4.92],
[-2.9, 2.2, -3.7],
[1.4, 1.65, -1.3],
[3.15, 1.25, 0.35],
[4.75, 1.35, 1.38]
], 0.038);
addRoute("loop", [
[-5.05, 2.48, -4.92],
[-1.4, 1.55, -2.9],
[2.65, 0.32, -0.2],
[3.18, 0.10, 1.1],
[4.9, 0.12, 1.9],
[5.4, 1.35, 1.72]
], 0.034);
addRoute("interpretation", [
[-5.05, 2.58, -4.92],
[-5.8, 2.05, -3.15],
[-6.35, 1.75, -1.4],
[-6.45, 1.85, 0.68]
], 0.038);
// Timestamp and screen rendering.
let currentSecond = 522;
let activeChannel = "captions";
let selectedView = "overview";
let playing = false;
let lastTimelineTick = performance.now();
function formatTime(second) {
const minutes = Math.floor(second / 60);
const seconds = second % 60;
return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
}
function drawScreen() {
const w = screenCanvas.width;
const h = screenCanvas.height;
const accent = `#${channelData[activeChannel].color.toString(16).padStart(6, "0")}`;
screenCtx.fillStyle = "#101c2a";
screenCtx.fillRect(0, 0, w, h);
screenCtx.fillStyle = "#ffffff";
screenCtx.font = "800 31px Arial, sans-serif";
screenCtx.textAlign = "left";
screenCtx.textBaseline = "middle";
screenCtx.fillText("LIVE CAPTIONS", 74, 74);
roundedRect(screenCtx, w - 205, 37, 132, 72, 20);
screenCtx.fillStyle = accent;
screenCtx.fill();
screenCtx.fillStyle = "#ffffff";
screenCtx.font = "800 32px Arial, sans-serif";
screenCtx.textAlign = "center";
screenCtx.fillText(formatTime(currentSecond), w - 139, 74);
screenCtx.fillStyle = accent;
screenCtx.fillRect(74, 142, 102, 8);
screenCtx.textAlign = "left";
screenCtx.fillStyle = "#ffffff";
screenCtx.font = "700 55px Arial, sans-serif";
screenCtx.fillText("Spatial models help us compare", 74, 270);
screenCtx.fillText("ideas before we build them.", 74, 342);
screenCtx.fillStyle = "#aebbc8";
screenCtx.font = "600 26px Arial, sans-serif";
screenCtx.fillText("DR. MAYA CHEN • COMPUTER GRAPHICS", 74, 448);
screenCtx.fillStyle = "#526274";
screenCtx.font = "600 22px Arial, sans-serif";
screenCtx.fillText("All assistance channels are aligned to this presentation moment.", 74, 628);
screenCtx.textAlign = "right";
screenCtx.fillStyle = accent;
screenCtx.font = "800 22px Arial, sans-serif";
screenCtx.fillText("SHARED MOMENT", w - 74, 628);
screenTexture.needsUpdate = true;
}
function updateMoment() {
const time = formatTime(currentSecond);
$("#shared-time").textContent = time;
$$('[data-time]').forEach((element) => element.textContent = time);
const range = $("#timeline");
const progress = (currentSecond - Number(range.min)) /
(Number(range.max) - Number(range.min)) * 100;
range.style.setProperty("--progress", `${progress}%`);
sourceBoardLabel.draw("PRESENTATION", time);
for (const key of Object.keys(boardLabels)) {
if (key !== "source") {
boardLabels[key].draw(channelData[key].title, time);
}
}
drawScreen();
}
// Camera presets use spherical coordinates for direct, dependency-free controls.
const presets = {
overview: {
target: new THREE.Vector3(-0.2, 1.75, -1.5),
position: new THREE.Vector3(12.8, 8.6, 14.6)
},
speaker: {
target: new THREE.Vector3(-5.05, 1.65, -4.45),
position: new THREE.Vector3(-1.55, 3.15, -0.55)
},
captions: {
target: new THREE.Vector3(-1.65, 3.35, -6.48),
position: new THREE.Vector3(1.10, 4.15, -0.20)
},
network: {
target: new THREE.Vector3(5.30, 2.65, -5.52),
position: new THREE.Vector3(6.75, 3.35, -0.55)
},
listener: {
target: new THREE.Vector3(5.25, 1.30, 1.62),
position: new THREE.Vector3(8.25, 3.15, 5.25)
},
interpreter: {
target: new THREE.Vector3(-6.40, 1.42, 1.05),
position: new THREE.Vector3(-3.45, 3.10, 4.55)
}
};
function sphericalFrom(position, target) {
const offset = position.clone().sub(target);
const spherical = new THREE.Spherical().setFromVector3(offset);
return {
target: target.clone(),
radius: spherical.radius,
theta: spherical.theta,
phi: spherical.phi
};
}
const currentCamera = sphericalFrom(presets.overview.position, presets.overview.target);
const desiredCamera = sphericalFrom(presets.overview.position, presets.overview.target);
function updateEmphasis() {
for (const key of Object.keys(channelData)) {
const isActive = key === activeChannel;
const boardPath = boardPaths[key];
const roomPath = routePaths[key];
const node = boardNodes[key];
if (selectedView === "network" || selectedView === "overview") {
boardPath.material.opacity = isActive ? 1 : 0.62;
roomPath.material.opacity = isActive ? 0.94 : 0.38;
boardPath.material.emissiveIntensity = isActive ? 0.9 : 0.38;
roomPath.material.emissiveIntensity = isActive ? 1.05 : 0.50;
node.material.emissiveIntensity = isActive ? 0.95 : 0.30;
} else {
boardPath.material.opacity = isActive ? 1 : 0.12;
roomPath.material.opacity = isActive ? 0.95 : 0.10;
boardPath.material.emissiveIntensity = isActive ? 0.95 : 0.12;
roomPath.material.emissiveIntensity = isActive ? 1.1 : 0.12;
node.material.emissiveIntensity = isActive ? 1.0 : 0.15;
}
}
}
function setView(view, moveCamera = true) {
if (!presets[view]) return;
selectedView = view;
if (moveCamera) {
desiredCamera.target.copy(presets[view].target);
const next = sphericalFrom(presets[view].position, presets[view].target);
desiredCamera.radius = next.radius;
desiredCamera.theta = next.theta;
desiredCamera.phi = next.phi;
}
$$(".view-button").forEach((button) => {
button.classList.toggle("active", button.dataset.view === view);
});
updateEmphasis();
}
function selectChannel(channel, moveCamera = true) {
if (!channelData[channel]) return;
activeChannel = channel;
$$(".channel-button").forEach((button) => {
button.classList.toggle("active", button.dataset.channel === channel);
});
$("#focus-title").textContent = channelData[channel].title;
$("#focus-copy").textContent = channelData[channel].copy;
if (moveCamera) {
setView(channelData[channel].view, true);
} else {
updateEmphasis();
}
drawScreen();
}
$$(".view-button").forEach((button) => {
button.addEventListener("click", () => setView(button.dataset.view, true));
});
$$(".channel-button").forEach((button) => {
button.addEventListener("click", () => selectChannel(button.dataset.channel, true));
});
// Custom pointer controls: drag orbit, Shift-drag pan, wheel zoom.
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
let pointerDown = null;
renderer.domElement.addEventListener("pointerdown", (event) => {
pointerDown = {
x: event.clientX,
y: event.clientY,
moved: false,
shift: event.shiftKey
};
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!pointerDown) return;
const dx = event.clientX - pointerDown.x;
const dy = event.clientY - pointerDown.y;
if (Math.abs(dx) + Math.abs(dy) > 4) pointerDown.moved = true;
if (pointerDown.shift) {
const scale = desiredCamera.radius * 0.0012;
desiredCamera.target.x -= dx * scale;
desiredCamera.target.y += dy * scale;
desiredCamera.target.x = THREE.MathUtils.clamp(
desiredCamera.target.x, -8.2, 8.2
);
desiredCamera.target.y = THREE.MathUtils.clamp(
desiredCamera.target.y, 0.3, 5.4
);
} else {
desiredCamera.theta -= dx * 0.006;
desiredCamera.phi = THREE.MathUtils.clamp(
desiredCamera.phi - dy * 0.005,
0.28,
1.48
);
}
pointerDown.x = event.clientX;
pointerDown.y = event.clientY;
});
renderer.domElement.addEventListener("pointerup", (event) => {
if (!pointerDown) return;
if (!pointerDown.moved) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
raycaster.setFromCamera(pointer, camera);
const hits = raycaster.intersectObjects(selectable, false);
if (hits.length) {
selectChannel(hits[0].object.userData.channel, true);
} else {
const screenHit = raycaster.intersectObject(screenMesh, false);
if (screenHit.length) selectChannel("captions", true);
}
}
pointerDown = null;
});
renderer.domElement.addEventListener("pointercancel", () => {
pointerDown = null;
});
renderer.domElement.addEventListener("wheel", (event) => {
event.preventDefault();
desiredCamera.radius = THREE.MathUtils.clamp(
desiredCamera.radius * Math.exp(event.deltaY * 0.001),
3.2,
27
);
}, { passive: false });
// Shared timeline controls.
const timeline = $("#timeline");
timeline.addEventListener("input", () => {
currentSecond = Number(timeline.value);
updateMoment();
});
$("#play").addEventListener("click", () => {
playing = !playing;
lastTimelineTick = performance.now();
$("#play").textContent = playing ? "Ⅱ" : "▶";
$("#play").setAttribute(
"aria-label",
playing ? "Pause shared timeline" : "Play shared timeline"
);
});
window.addEventListener("keydown", (event) => {
if (event.target instanceof HTMLInputElement) return;
const views = Object.keys(presets);
const index = Number(event.key) - 1;
if (index >= 0 && index < views.length) {
setView(views[index], true);
}
if (event.key.toLowerCase() === " ") {
event.preventDefault();
$("#play").click();
}
});
function resize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
}
window.addEventListener("resize", resize);
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
const clock = new THREE.Clock();
let routeTime = 0;
function animate() {
requestAnimationFrame(animate);
const delta = clock.getDelta();
routeTime += delta;
if (playing && performance.now() - lastTimelineTick > 900) {
lastTimelineTick = performance.now();
currentSecond = currentSecond >= Number(timeline.max)
? Number(timeline.min)
: currentSecond + 1;
timeline.value = currentSecond;
updateMoment();
}
const lerpAmount = reducedMotion ? 1 : 1 - Math.exp(-delta * 6.5);
currentCamera.target.lerp(desiredCamera.target, lerpAmount);
currentCamera.radius = THREE.MathUtils.lerp(
currentCamera.radius, desiredCamera.radius, lerpAmount
);
currentCamera.phi = THREE.MathUtils.lerp(
currentCamera.phi, desiredCamera.phi, lerpAmount
);
let thetaDifference =
desiredCamera.theta - currentCamera.theta;
thetaDifference = Math.atan2(
Math.sin(thetaDifference),
Math.cos(thetaDifference)
);
currentCamera.theta += thetaDifference * lerpAmount;
const offset = new THREE.Vector3().setFromSpherical(
new THREE.Spherical(
currentCamera.radius,
currentCamera.phi,
currentCamera.theta
)
);
camera.position.copy(currentCamera.target).add(offset);
camera.lookAt(currentCamera.target);
for (const [key, pulse] of Object.entries(routePulses)) {
const isActive = key === activeChannel;
const speed = isActive ? 0.20 : 0.10;
const t = (routeTime * speed + pulse.offset) % 1;
pulse.mesh.position.copy(pulse.curve.getPointAt(t));
pulse.mesh.scale.setScalar(isActive ? 1.25 : 0.72);
pulse.mesh.material.opacity = isActive ? 1 : 0.42;
pulse.mesh.material.transparent = true;
}
floorLoop.material.emissiveIntensity =
activeChannel === "loop" ? 0.72 : 0.18;
renderer.render(scene, camera);
}
updateMoment();
selectChannel("captions", false);
setView("overview", false);
animate();
requestAnimationFrame(() => {
$("#loading").classList.add("hidden");
});
</script>
</body>
</html>
```