Prompt specification
Build or customize the Three.js 3D scene "Multisensory Community Center Wayfinding" 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: Multisensory Community Center Wayfinding
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/multisensory-community-center-wayfinding-x3203
Scene Description Prompt:
Please make a voxel Three.js scene in one standalone HTML file using cdnjs. Build a center entrance with visual symbols, tactile path cues, and optional text. Demonstrate redundant navigation information while avoiding invented claims of compliance with accessibility standards.
Working Three.js Starter (multisensory-community-center-wayfinding-x3203):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Voxel Wayfinding Study — Redundant Navigation Information</title>
<style>
:root{
--ink:#e9eef4; --muted:#a9b6c4; --panel:rgba(14,20,27,.82); --line:rgba(255,255,255,.14);
--accent:#f0b429; --accent2:#35b6c9;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:#0b1118;color:var(--ink);
font-family:ui-sans-serif,system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
#stage{position:fixed;inset:0}
#stage canvas{display:block}
#ui{
position:fixed;top:14px;right:14px;width:min(360px,calc(100vw - 28px));
max-height:calc(100vh - 28px);overflow:auto;background:var(--panel);
border:1px solid var(--line);border-radius:14px;padding:16px 16px 14px;
backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
box-shadow:0 18px 50px rgba(0,0,0,.45);
}
#ui h1{font-size:15px;letter-spacing:.14em;text-transform:uppercase;margin:0 0 6px}
#ui h2{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);
margin:16px 0 8px;padding-top:10px;border-top:1px solid var(--line)}
#ui p.lede{font-size:12.5px;line-height:1.5;color:var(--muted);margin:0 0 4px}
#ui ol.cues{font-size:12px;line-height:1.45;margin:0;padding-left:18px}
#ui ol.cues li{margin-bottom:5px}
#ui ol.cues b{color:var(--accent)}
.row{display:flex;align-items:center;gap:8px;font-size:12.5px;padding:4px 0;cursor:pointer}
.row input{accent-color:var(--accent);width:14px;height:14px}
.row span.sw{display:inline-block;width:9px;height:9px;border-radius:2px;flex:0 0 auto}
.views{display:flex;flex-wrap:wrap;gap:6px}
button{
font:inherit;font-size:11.5px;color:var(--ink);background:rgba(255,255,255,.07);
border:1px solid var(--line);border-radius:8px;padding:6px 9px;cursor:pointer}
button:hover{background:rgba(255,255,255,.16)}
button.on{background:var(--accent);color:#10161d;border-color:transparent;font-weight:600}
.note{font-size:11px;line-height:1.5;color:var(--muted);border-left:3px solid var(--accent);
padding:8px 10px;background:rgba(240,180,41,.08);border-radius:0 8px 8px 0;margin:0}
#hint{position:fixed;left:14px;bottom:12px;font-size:11.5px;color:#dfe7ef;
background:rgba(14,20,27,.7);border:1px solid var(--line);border-radius:10px;padding:7px 11px}
#toggle{position:fixed;left:14px;top:14px}
@media (max-width:760px){ #ui{top:auto;bottom:12px;right:12px;left:12px;width:auto;max-height:46vh}
#hint{display:none} }
</style>
</head>
<body>
<div id="stage"></div>
<div id="toggle">
<button id="panelBtn">Controls & cue legend</button>
</div>
<div id="ui">
<h1>Voxel Wayfinding Study</h1>
<p class="lede">An illustrative voxel plaza showing <b>redundant navigation information</b>:
the same route is communicated by tactile patterns, shape-coded symbols, text,
contrast and a flashing beacon — so removing any single channel does not remove the message.</p>
<h2>Information layers (toggle)</h2>
<label class="row"><input type="checkbox" id="l-symbols" checked><span class="sw" style="background:#f0b429"></span>Symbols & pictograms</label>
<label class="row"><input type="checkbox" id="l-labels" checked><span class="sw" style="background:#ffffff"></span>Text labels (optional layer)</label>
<label class="row"><input type="checkbox" id="l-guide" checked><span class="sw" style="background:#f2c13c"></span>Tactile guide strip (ribbed)</label>
<label class="row"><input type="checkbox" id="l-warn" checked><span class="sw" style="background:#e79b2c"></span>Tactile warning field (dots)</label>
<label class="row"><input type="checkbox" id="l-contrast" checked><span class="sw" style="background:#39424c"></span>Contrast bands & step nosings</label>
<label class="row"><input type="checkbox" id="l-beacon" checked><span class="sw" style="background:#ef7a45"></span>Flashing visual beacon</label>
<label class="row"><input type="checkbox" id="l-badges" checked><span class="sw" style="background:#ffffff"></span>Cue badges (numbered)</label>
<label class="row"><input type="checkbox" id="l-gray"><span class="sw" style="background:linear-gradient(90deg,#000,#fff)"></span>Simulate reduced colour perception</label>
<h2>Views</h2>
<div class="views">
<button data-view="overview" class="on">1 Overview</button>
<button data-view="entrance">2 Entrance</button>
<button data-view="junction">3 Decision point</button>
<button data-view="walk">4 Walk the route</button>
<button data-view="plan">5 Plan</button>
</div>
<h2>Cue inventory (badges)</h2>
<ol class="cues">
<li><b>Symbols</b> — arrow + doorway pictograms on the entrance fascia.</li>
<li><b>Text</b> — "MAIN ENTRANCE" panel (an optional, removable layer).</li>
<li><b>Tactile guidance</b> — continuous ribbed strip following the route.</li>
<li><b>Tactile warning</b> — dot fields at the decision point and thresholds.</li>
<li><b>Contrast</b> — dark edge bands and contrasting step nosings.</li>
<li><b>Shape coding</b> — distinct arrow shapes per destination, not colour alone.</li>
<li><b>Beacon</b> — flashing light marking the entrance from a distance.</li>
<li><b>Sign family</b> — same post/frame/type repeated at every decision point.</li>
</ol>
<h2>Note</h2>
<p class="note">Demonstration only. This model illustrates common wayfinding patterns
(multi-coded signage, tactile paving types, contrast cues). It is <b>not</b> an accessibility
audit and makes <b>no claim of conformance</b> with any standard or building code.
Dimensions, contrast ratios, font sizes, reach ranges, clearances, slopes and materials
shown here are illustrative placeholders and would have to be verified against the
applicable standard by qualified professionals.</p>
</div>
<div id="hint">Drag to orbit · Scroll to zoom · Shift/right-drag to pan · Keys 1–5 for views · R toggles panel</div>
<script type="module">
import * as THREE from 'https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js';
/* ------------------------------------------------------------------ *
* Renderer / scene basics
* ------------------------------------------------------------------ */
const host = document.getElementById('stage');
const renderer = new THREE.WebGLRenderer({ antialias: true, powerPreference: 'high-performance' });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(innerWidth, innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
host.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xa6bfd2);
scene.fog = new THREE.Fog(0xa6bfd2, 60, 135);
const camera = new THREE.PerspectiveCamera(50, innerWidth / innerHeight, 0.1, 400);
scene.add(new THREE.HemisphereLight(0xdfe9f4, 0x6a6252, 0.85));
const sun = new THREE.DirectionalLight(0xfff4e2, 1.15);
sun.position.set(16, 26, 14);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -34; sun.shadow.camera.right = 34;
sun.shadow.camera.top = 34; sun.shadow.camera.bottom = -34;
sun.shadow.camera.near = 1; sun.shadow.camera.far = 90;
sun.shadow.bias = -0.0008;
scene.add(sun);
const fill = new THREE.DirectionalLight(0xbcd6ea, 0.35);
fill.position.set(-14, 12, -10);
scene.add(fill);
/* ------------------------------------------------------------------ *
* Palette + tiny helpers
* ------------------------------------------------------------------ */
const C = {
paving:0xa9a49a, paving2:0x9e988d, paving3:0x948e84,
grass:0x5c7f4e, grass2:0x6b8f59,
path:0xd8d2c6, path2:0xcec8bc, edge:0x39424c,
wall:0xded6c7, wall2:0xd3cabb, wall3:0xc7bead, trim:0x37414b,
glass:0x8fbcd2, metal:0x5b636c, wood:0x8b6543,
yellow:0xf0b429, cyan:0x2fb6c9, orange:0xef7a45,
guide:0xf2c13c, warn:0xe79b2c, light:0xf3efe4,
foliage:0x4e7c48, foliage2:0x5d8f52, foliage3:0x44703f, trunk:0x6b4b32,
board:0x18222d
};
let seed = 987654321;
const rnd = () => (seed = (seed * 1664525 + 1013904223) >>> 0) / 4294967296;
const pick = a => a[Math.floor(rnd() * a.length)];
/* ------------------------------------------------------------------ *
* Voxel layer system: one InstancedMesh per colour, per toggleable layer
* ------------------------------------------------------------------ */
const unitGeo = new THREE.BoxGeometry(1, 1, 1);
class Layer {
constructor(name) { this.name = name; this.items = []; this.group = new THREE.Group(); this.group.name = name; }
add(x, y, z, w, h, d, color) { this.items.push({ x, y, z, w, h, d, color }); return this; }
build(scene, materialFor) {
const byColor = new Map();
for (const it of this.items) {
if (!byColor.has(it.color)) byColor.set(it.color, []);
byColor.get(it.color).push(it);
}
const dummy = new THREE.Object3D();
for (const [color, list] of byColor) {
const mat = materialFor(color, list.length);
const mesh = new THREE.InstancedMesh(unitGeo, mat, list.length);
mesh.castShadow = true; mesh.receiveShadow = true; mesh.frustumCulled = false;
list.forEach((it, i) => {
dummy.position.set(it.x, it.y, it.z);
dummy.scale.set(it.w, it.h, it.d);
dummy.updateMatrix();
mesh.setMatrixAt(i, dummy.matrix);
});
mesh.instanceMatrix.needsUpdate = true;
this.group.add(mesh);
if (mat.userData.animated) this.animatedMat = mat;
}
scene.add(this.group);
return this.group;
}
}
const L = {
base: new Layer('base'),
contrast: new Layer('contrast'),
guide: new Layer('guide'),
warn: new Layer('warn'),
symbols: new Layer('symbols'),
lamps: new Layer('lamps'),
beacon: new Layer('beacon')
};
const labelGroup = new THREE.Group(); labelGroup.name = 'labels'; scene.add(labelGroup);
const badgeGroup = new THREE.Group(); badgeGroup.name = 'badges'; scene.add(badgeGroup);
/* ------------------------------------------------------------------ *
* Pictogram patterns (voxel-built symbols)
* ------------------------------------------------------------------ */
const PIC = {
arrowUp: [
'..###..',
'.#####.',
'#######',
'...#...',
'...#...',
'...#...',
'...#...'
],
arrowRight: [
'.......',
'..#....',
'..##...',
'#######',
'..##...',
'..#....',
'.......'
],
door: [
'#######',
'#.....#',
'#.....#',
'#.....#',
'#.....#',
'#.....#',
'#######'
],
person: [
'..###..',
'.#####.',
'..###..',
'.#####.',
'#######',
'..###..',
'.#####.'
]
};
/** Place a pictogram made of voxel cubes. cx = centre X, cy = centre Y, z = depth plane. */
function pictogram(layer, pat, cx, cy, z, cell, color) {
const rows = pat.length, cols = pat[0].length;
const ox = cx - (cols * cell) / 2, oy = cy - (rows * cell) / 2;
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
if (pat[r][c] !== '#') continue;
layer.add(ox + (c + 0.5) * cell, oy + (rows - 1 - r + 0.5) * cell, z,
cell * 0.92, cell * 0.92, 0.10, color);
}
}
}
/* ------------------------------------------------------------------ *
* Text panels (canvas textures) — an optional, toggleable layer
* ------------------------------------------------------------------ */
function makeTextTexture(title, sub, { aspect = 3.2, bg = '#18222d', fg = '#f6f3ec', subc = '#9fb0c0', accent = null } = {}) {
const w = 1024, h = Math.round(1024 / aspect);
const cv = document.createElement('canvas'); cv.width = w; cv.height = h;
const g = cv.getContext('2d');
g.fillStyle = bg; g.fillRect(0, 0, w, h);
if (accent) { g.fillStyle = accent; g.fillRect(0, 0, w, Math.max(10, h * 0.07)); }
g.strokeStyle = 'rgba(255,255,255,.22)'; g.lineWidth = 5; g.strokeRect(3, 3, w - 6, h - 6);
g.textAlign = 'center'; g.textBaseline = 'middle';
g.fillStyle = fg;
g.font = '700 ' + Math.round(h * 0.34) + 'px Helvetica, Arial, sans-serif';
g.fillText(title, w / 2, sub ? h * 0.40 : h * 0.5);
if (sub) {
g.fillStyle = subc;
g.font = '500 ' + Math.round(h * 0.17) + 'px Helvetica, Arial, sans-serif';
g.fillText(sub, w / 2, h * 0.70);
}
const t = new THREE.CanvasTexture(cv);
t.colorSpace = THREE.SRGBColorSpace;
t.anisotropy = 8;
return t;
}
function textPanel(x, y, z, w, h, title, sub, accent) {
const tex = makeTextTexture(title, sub, { aspect: w / h, accent });
const mesh = new THREE.Mesh(new THREE.PlaneGeometry(w, h), new THREE.MeshBasicMaterial({ map: tex }));
mesh.position.set(x, y, z);
labelGroup.add(mesh);
return mesh;
}
/* ------------------------------------------------------------------ *
* Sign boards: dark board in base layer, accent frame + pictograms in
* the symbol layer, wording in the label layer.
* ------------------------------------------------------------------ */
function board({ x, y, z, w, h, pictos = [], text, accent = C.yellow, textArea }) {
L.base.add(x, y, z, w, h, 0.18, C.board); // board face
L.base.add(x, y + h / 2 - 0.06, z + 0.02, w, 0.12, 0.22, C.trim); // frame rails
L.base.add(x, y - h / 2 + 0.06, z + 0.02, w, 0.12, 0.22, C.trim);
L.symbols.add(x, y + h / 2 - 0.06, z + 0.03, w, 0.12, 0.24, accent); // accent band (shape-coded)
L.symbols.add(x, y - h / 2 + 0.06, z + 0.03, w, 0.12, 0.24, accent);
for (const p of pictos) pictogram(L.symbols, PIC[p.pat], p.cx, y, z + 0.16, p.cell, p.color);
if (text) {
const ta = textArea || { cx: x, w: w * 0.5, h: h * 0.7 };
textPanel(ta.cx, y, z + 0.11, ta.w, ta.h, text[0], text[1], null);
}
}
/* ------------------------------------------------------------------ *
* Ground: plaza paving, darker grass edges, lighter route paving
* ------------------------------------------------------------------ */
const GX0 = -22, GX1 = 21, GZ0 = -20, GZ1 = 13;
const isMainPath = (x, z) => (x >= -1 && x <= 1 && z >= -12 && z <= 12);
const isBranchPath = (x, z) =>
(x >= 1 && x <= 9 && z >= -1 && z <= 1) || (x >= 7 && x <= 9 && z >= -6 && z <= -1);
for (let x = GX0; x <= GX1; x++) {
for (let z = GZ0; z <= GZ1; z++) {
let c = pick([C.paving, C.paving, C.paving2, C.paving3]);
if (x < -19 || x > 18 || z > 11 || z < -16) c = pick([C.grass, C.grass2]);
if (isMainPath(x, z) || isBranchPath(x, z)) c = pick([C.path, C.path, C.path2]);
L.base.add(x, -0.07, z, 0.96, 0.14, 0.96, c);
}
}
/* Contrast edge bands (toggleable) */
for (let z = -10; z <= 12; z++) {
L.contrast.add(-2, 0.015, z, 0.96, 0.03, 0.96, C.edge);
L.contrast.add(2, 0.015, z, 0.96, 0.03, 0.96, C.edge);
}
for (let x = 1; x <= 9; x++) {
L.contrast.add(x, 0.015, -2, 0.96, 0.03, 0.96, C.edge);
L.contrast.add(x, 0.015, 2, 0.96, 0.03, 0.96, C.edge);
}
for (let z = -6; z <= -2; z++) {
L.contrast.add(6, 0.015, z, 0.96, 0.03, 0.96, C.edge);
L.contrast.add(10, 0.015, z, 0.96, 0.03, 0.96, C.edge);
}
/* ------------------------------------------------------------------ *
* Centre building with the main entrance
* ------------------------------------------------------------------ */
const BX0 = -6, BX1 = 5, BZ0 = -19, BZ1 = -13, BH = 9;
for (let x = BX0; x <= BX1; x++) {
for (let y = 0; y < BH; y++) {
const doorOpening = (x === -1 || x === 0) && y < 5;
if (doorOpening) continue;
let c = pick([C.wall, C.wall, C.wall2, C.wall3]);
if (x === -2 || x === 1) { if (y < 5) c = C.trim; } // door frame columns
if (y === 5 && (x === -1 || x === 0)) c = C.trim; // lintel
if ((x === -5 || x === -4 || x === -3 || x === 3 || x === 4) && (y === 6 || y === 7)) c = C.glass; // windows
L.base.add(x + 0.5, y + 0.5, BZ1 + 0.5, 1, 1, 1, c);
}
}
for (let x = BX0; x <= BX1; x++)
for (let y = 0; y < BH; y++) L.base.add(x + 0.5, y + 0.5, BZ0 + 0.5, 1, 1, 1, pick([C.wall2, C.wall, C.wall3]));
for (let z = BZ0; z <= BZ1; z++)
for (let y = 0; y < BH; y++) {
L.base.add(BX0 + 0.5, y + 0.5, z + 0.5, 1, 1, 1, pick([C.wall2, C.wall, C.wall3]));
L.base.add(BX1 + 0.5, y + 0.5, z + 0.5, 1, 1, 1, pick([C.wall2, C.wall, C.wall3]));
}
for (let x = BX0; x <= BX1; x++)
for (let z = BZ0; z <= BZ1; z++) L.base.add(x + 0.5, BH + 0.15, z + 0.5, 1, 0.3, 1, C.trim);
/* Steps + landing (3 risers) with contrasting nosings */
const stepTop = [0.2, 0.4, 0.6];
const stepZ = [-10.25, -10.75, -11.25];
for (let i = 0; i < 3; i++) {
L.base.add(0, stepTop[i] / 2, stepZ[i], 4.2, stepTop[i], 0.5, pick([C.wall2, C.paving2]));
L.contrast.add(0, stepTop[i] - 0.04, stepZ[i] + 0.22, 4.2, 0.08, 0.12, C.light); // nosing band
}
L.base.add(0, 0.3, -12.0, 4.2, 0.6, 1.0, C.paving2); // landing at door threshold
L.base.add(0, 0.62, -12.0, 4.2, 0.04, 1.0, C.path); // landing surface
/* Ribbed tactile strip on the landing edge (bars across the direction of travel) */
for (let i = 0; i < 4; i++) {
L.guide.add(0, 0.66, -12.05 - i * 0.12, 3.4, 0.05, 0.075, C.guide);
}
/* Doors */
L.base.add(-0.47, 2.5, -11.97, 0.92, 3.8, 0.09, C.glass);
L.base.add(0.47, 2.5, -11.97, 0.92, 3.8, 0.09, C.glass);
L.base.add(0, 2.5, -11.95, 0.12, 3.9, 0.13, C.trim);
L.base.add(0, 4.45, -11.95, 2.0, 0.14, 0.13, C.trim);
L.base.add(-0.12, 2.2, -11.86, 0.07, 1.0, 0.07, C.metal);
L.base.add(0.12, 2.2, -11.86, 0.07, 1.0, 0.07, C.metal);
/* Lit lobby behind the glass */
L.base.add(0, 0.55, -14.6, 8, 0.1, 5.0, C.light);
L.lamps.add(0, 2.2, -17.6, 6, 2.6, 0.2, 0xfff1d8);
L.lamps.add(0, 4.35, -14.4, 3.4, 0.16, 2.2, 0xffeecb);
L.base.add(1.2, 1.1, -15.2, 2.4, 1.0, 0.8, C.wood);
L.base.add(-2.2, 0.95, -15.6, 0.7, 0.7, 0.7, C.foliage2);
/* Canopy + fascia sign */
L.base.add(0, 5.05, -11.2, 7.2, 0.35, 1.6, C.trim);
L.base.add(0, 4.85, -10.45, 7.2, 0.18, 0.16, C.metal);
L.base.add(0, 6.55, -11.88, 8.0, 1.5, 0.20, C.board);
L.base.add(0, 7.28, -11.86, 8.0, 0.12, 0.24, C.trim);
L.base.add(0, 5.82, -11.86, 8.0, 0.12, 0.24, C.trim);
L.symbols.add(0, 7.28, -11.84, 8.0, 0.12, 0.26, C.yellow);
L.symbols.add(0, 5.82, -11.84, 8.0, 0.12, 0.26, C.yellow);
pictogram(L.symbols, PIC.arrowUp, -3.25, 6.55, -11.78, 0.18, C.yellow);
pictogram(L.symbols, PIC.door, -1.85, 6.55, -11.78, 0.18, C.yellow);
textPanel(1.45, 6.55, -11.76, 4.4, 1.16, 'MAIN ENTRANCE', 'RECEPTION TO THE RIGHT');
/* Flashing visual beacon above the entrance */
L.beacon.add(0, 5.55, -10.55, 0.4, 0.4, 0.4, 0xff7a45);
L.beacon.add(-0.8, 5.5, -10.6, 0.26, 0.26, 0.26, 0xffb27a);
L.beacon.add(0.8, 5.5, -10.6, 0.26, 0.26, 0.26, 0xffb27a);
L.base.add(0, 5.3, -10.55, 0.5, 0.22, 0.5, C.trim);
/* ------------------------------------------------------------------ *
* Reception wing (second destination — the "turn right" branch)
* ------------------------------------------------------------------ */
const WX0 = 5, WX1 = 11, WZ0 = -13, WZ1 = -7, WH = 6;
for (let x = WX0; x <= WX1; x++) {
for (let y = 0; y < WH; y++) {
const open = (x === 7 || x === 8) && y < 3;
if (open) continue;
let c = pick([C.wall2, C.wall3, C.wall]);
if (x === 6 || x === 9) { if (y < 3) c = C.trim; }
if (y === 3 && (x === 7 || x === 8)) c = C.trim;
if ((x === 5 || x === 10) && (y === 4 || y === 5)) c = C.glass;
L.base.add(x + 0.5, y + 0.5, WZ1 + 0.5, 1, 1, 1, c);
}
}
for (let x = WX0; x <= WX1; x++)
for (let y = 0; y < WH; y++) L.base.add(x + 0.5, y + 0.5, WZ0 + 0.5, 1, 1, 1, pick([C.wall2, C.wall3]));
for (let z = WZ0; z <= WZ1; z++)
for (let y = 0; y < WH; y++) {
L.base.add(WX0 + 0.5, y + 0.5, z + 0.5, 1, 1, 1, pick([C.wall2, C.wall3]));
L.base.add(WX1 + 0.5, y + 0.5, z + 0.5, 1, 1, 1, pick([C.wall2, C.wall3]));
}
for (let x = WX0; x <= WX1; x++)
for (let z = WZ0; z <= WZ1; z++) L.base.add(x + 0.5, WH + 0.15, z + 0.5, 1, 0.3, 1, C.trim);
/* reception doors + threshold */
L.base.add(7.47, 1.5, -6.97, 0.9, 3.0, 0.08, C.glass);
L.base.add(8.53, 1.5, -6.97, 0.9, 3.0, 0.08, C.glass);
L.base.add(8.0, 1.5, -6.95, 0.12, 3.1, 0.12, C.trim);
L.base.add(7.90, 1.4, -6.88, 0.06, 0.9, 0.06, C.metal);
L.base.add(8.10, 1.4, -6.88, 0.06, 0.9, 0.06, C.metal);
L.base.add(8.0, 0.03, -6.3, 2.4, 0.06, 0.8, C.path);
/* sign over the reception door */
L.base.add(8.0, 3.75, -6.88, 3.6, 0.9, 0.18, C.board);
L.base.add(8.0, 4.18, -6.86, 3.6, 0.12, 0.22, C.trim);
L.base.add(8.0, 3.32, -6.86, 3.6, 0.12, 0.22, C.trim);
L.symbols.add(8.0, 4.18, -6.84, 3.6, 0.12, 0.24, C.cyan);
L.symbols.add(8.0, 3.32, -6.84, 3.6, 0.12, 0.24, C.cyan);
pictogram(L.symbols, PIC.door, 6.6, 3.75, -6.78, 0.12, C.cyan);
textPanel(8.9, 3.75, -6.76, 1.9, 0.72, 'RECEPTION', 'RIGHT TURN');
/* ------------------------------------------------------------------ *
* Left context building (windows only)
* ------------------------------------------------------------------ */
const LX0 = -18, LX1 = -9, LZ0 = -12, LZ1 = -5, LH = 7;
for (let x = LX0; x <= LX1; x++)
for (let y = 0; y < LH; y++) {
let c = pick([C.wall3, C.wall2]);
if (y >= 2 && y <= 5 && (x + y) % 2 === 0) c = C.glass;
L.base.add(x + 0.5, y + 0.5, LZ1 + 0.5, 1, 1, 1, c);
}
for (let x = LX0; x <= LX1; x++)
for (let y = 0; y < LH; y++) L.base.add(x + 0.5, y + 0.5, LZ0 + 0.5, 1, 1, 1, pick([C.wall2, C.wall3]));
for (let z = LZ0; z <= LZ1; z++)
for (let y = 0; y < LH; y++) {
L.base.add(LX0 + 0.5, y + 0.5, z + 0.5, 1, 1, 1, pick([C.wall3, C.wall2]));
L.base.add(LX1 + 0.5, y + 0.5, z + 0.5, 1, 1, 1, pick([C.wall3, C.wall2]));
}
for (let x = LX0; x <= LX1; x++)
for (let z = LZ0; z <= LZ1; z++) L.base.add(x + 0.5, LH + 0.15, z + 0.5, 1, 0.3, 1, C.trim);
/* ------------------------------------------------------------------ *
* Tactile guidance: ribbed strip (parallel ribs) along the route
* ------------------------------------------------------------------ */
const ribOffsets = [-0.27, -0.09, 0.09, 0.27];
for (let z = 9.9; z >= -9.0; z -= 0.55)
for (const ox of ribOffsets) L.guide.add(ox, 0.055, z, 0.08, 0.07, 0.5, C.guide);
/* branch: east along z = 0 */
for (let x = 0.65; x <= 7.4; x += 0.55)
for (const oz of ribOffsets) L.guide.add(x, 0.055, oz, 0.5, 0.07, 0.08, C.guide);
/* branch: north along x = 8 */
for (let z = -0.6; z >= -5.0; z -= 0.55)
for (const ox of [7.73, 7.91, 8.09, 8.27]) L.guide.add(ox, 0.055, z, 0.08, 0.07, 0.5, C.guide);
/* Tactile warning: dot fields at the decision point and both thresholds */
function dotField(z0, z1, x0, x1) {
for (let z = z0; z <= z1; z += 0.3)
for (let x = x0; x <= x1; x += 0.3)
L.warn.add(x, 0.055, z, 0.16, 0.07, 0.16, C.warn);
}
dotField(-9.9, -9.3, -1.35, 1.35); // in front of the entrance steps
dotField(0.8, 1.4, -1.35, 1.35); // decision point ahead of the junction
dotField(-5.7, -5.1, 7.15, 8.85); // in front of the reception door
dotField(-0.9, -0.3, 0.35, 0.95); // start of the branch
/* ------------------------------------------------------------------ *
* Signage at the decision points (same sign family throughout)
* ------------------------------------------------------------------ */
function totem(x, z, boards, height) {
L.base.add(x, height / 2, z, 0.24, height, 0.24, C.metal);
L.base.add(x, 0.06, z, 0.9, 0.12, 0.9, C.metal);
for (const b of boards) board({ x, y: b.y, z: z + 0.02, w: b.w, h: b.h, pictos: b.pictos, text: b.text, accent: b.accent, textArea: b.textArea });
}
/* Approach totem */
totem(-3.4, 8.2, [{
y: 2.9, w: 4.4, h: 1.3, accent: C.yellow,
pictos: [{ pat: 'arrowUp', cx: -5.05, cell: 0.155, color: C.yellow },
{ pat: 'door', cx: -4.15, cell: 0.155, color: C.yellow }],
text: ['MAIN ENTRANCE', 'KEEP STRAIGHT'],
textArea: { cx: -2.55, w: 2.5, h: 1.0 }
}], 3.8);
/* Junction totem: two directions, each with arrow shape + colour + words + pictogram */
totem(-3.4, 0.0, [
{
y: 3.35, w: 4.4, h: 1.3, accent: C.yellow,
pictos: [{ pat: 'arrowUp', cx: -5.05, cell: 0.155, color: C.yellow },
{ pat: 'door', cx: -4.15, cell: 0.155, color: C.yellow }],
text: ['MAIN ENTRANCE', 'STRAIGHT AHEAD'],
textArea: { cx: -2.55, w: 2.5, h: 1.0 }
},
{
y: 1.75, w: 4.4, h: 1.3, accent: C.cyan,
pictos: [{ pat: 'arrowRight', cx: -5.05, cell: 0.155, color: C.cyan },
{ pat: 'person', cx: -4.15, cell: 0.155, color: C.cyan }],
text: ['RECEPTION', 'TURN RIGHT'],
textArea: { cx: -2.55, w: 2.5, h: 1.0 }
}
], 4.3);
/* Totem near the reception wing */
totem(11.6, -4.4, [{
y: 2.7, w: 3.8, h: 1.2, accent: C.cyan,
pictos: [{ pat: 'door', cx: 10.2, cell: 0.14, color: C.cyan }],
text: ['RECEPTION', 'AHEAD'],
textArea: { cx: 12.4, w: 2.1, h: 0.95 }
}], 3.4);
/* ------------------------------------------------------------------ *
* Street furniture: trees, benches, lamp posts, planters, bollards
* ------------------------------------------------------------------ */
function tree(x, z, s = 1) {
L.base.add(x, 0.8 * s, z, 0.4 * s, 1.6 * s, 0.4 * s, C.trunk);
for (let i = 0; i < 9; i++) {
const dx = (rnd() - 0.5) * 1.9 * s, dz = (rnd() - 0.5) * 1.9 * s, dy = (1.9 + rnd() * 1.2) * s;
L.base.add(x + dx, dy, z + dz, 0.95 * s, 0.95 * s, 0.95 * s, pick([C.foliage, C.foliage2, C.foliage3]));
}
}
[[-7.5, 7, 1.0], [-8.5, -1, 0.85], [12.5, 6.5, 1.05], [14, -1.5, 0.9], [-15, 4, 1.0], [3.5, -11, 0.75]]
.forEach(([x, z, s]) => tree(x, z, s));
function bench(x, z) {
L.base.add(x, 0.52, z, 2.2, 0.14, 0.6, C.wood);
L.base.add(x, 0.86, z - 0.26, 2.2, 0.6, 0.12, C.wood);
L.base.add(x - 0.9, 0.24, z, 0.16, 0.48, 0.55, C.metal);
L.base.add(x + 0.9, 0.24, z, 0.16, 0.48, 0.55, C.metal);
}
bench(-4.6, 4.4); bench(4.6, 4.4); bench(-4.6, -6.4); bench(5.2, -3.4);
function lamp(x, z) {
L.base.add(x, 2.1, z, 0.18, 4.2, 0.18, C.metal);
L.base.add(x, 4.22, z, 0.7, 0.22, 0.7, C.trim);
L.lamps.add(x, 4.02, z, 0.5, 0.24, 0.5, 0xfff0cf);
}
[[-3.2, 10.5], [3.2, 6.5], [-3.2, 2.5], [3.2, -2.5], [-6.5, -3.5], [12.2, -3.2], [-10.5, 9.5], [8.5, 11]]
.forEach(([x, z]) => lamp(x, z));
/* Planters flanking the entrance steps */
function planter(x, z) {
L.base.add(x, 0.28, z, 1.1, 0.56, 1.1, C.trim);
L.base.add(x, 0.58, z, 0.95, 0.12, 0.95, C.wood);
for (let i = 0; i < 4; i++)
L.base.add(x + (rnd() - 0.5) * 0.5, 0.85, z + (rnd() - 0.5) * 0.5, 0.5, 0.45, 0.5, pick([C.foliage, C.foliage2]));
}
planter(-3.4, -10.6); planter(3.4, -10.6); planter(5.0, -4.6); planter(11.2, -4.6);
/* Bollards marking the route edge (shape cue, not colour-only) */
for (let z = 9; z >= -6; z -= 3) {
L.base.add(-2.6, 0.35, z, 0.28, 0.7, 0.28, C.metal);
L.base.add(-2.6, 0.72, z, 0.32, 0.12, 0.32, C.light);
L.base.add(2.6, 0.35, z, 0.28, 0.7, 0.28, C.metal);
L.base.add(2.6, 0.72, z, 0.32, 0.12, 0.32, C.light);
}
/* ------------------------------------------------------------------ *
* Numbered cue badges (annotations)
* ------------------------------------------------------------------ */
function badge(n, x, y, z) {
const cv = document.createElement('canvas'); cv.width = cv.height = 128;
const g = cv.getContext('2d');
g.beginPath(); g.arc(64, 64, 56, 0, Math.PI * 2);
g.fillStyle = 'rgba(250,250,250,.94)'; g.fill();
g.lineWidth = 9; g.strokeStyle = '#16202b'; g.stroke();
g.fillStyle = '#16202b'; g.font = 'bold 62px Helvetica, Arial, sans-serif';
g.textAlign = 'center'; g.textBaseline = 'middle';
g.fillText(String(n), 64, 66);
const tex = new THREE.CanvasTexture(cv); tex.colorSpace = THREE.SRGBColorSpace;
const sp = new THREE.Sprite(new THREE.SpriteMaterial({ map: tex, depthTest: false, transparent: true }));
sp.position.set(x, y, z); sp.scale.set(0.95, 0.95, 1); sp.renderOrder = 20;
badgeGroup.add(sp);
}
badge(1, -4.55, 6.55, -11.6); // symbols on fascia
badge(2, 4.25, 6.55, -11.6); // text panel
badge(3, -1.35, 0.45, 3.0); // tactile guide strip
badge(4, 1.75, 0.45, -9.6); // tactile warning field
badge(5, 2.45, 0.35, 0.5); // contrast band
badge(6, -5.15, 3.35, 0.35); // shape-coded arrows
badge(7, 0.95, 5.85, -10.45); // beacon
badge(8, 10.15, 3.75, -6.6); // consistent sign family
/* ------------------------------------------------------------------ *
* Build the layers
* ------------------------------------------------------------------ */
const lambert = (c) => new THREE.MeshLambertMaterial({ color: c });
const emissive = (c) => new THREE.MeshStandardMaterial({
color: c, emissive: c, emissiveIntensity: 1.0, roughness: 0.6
});
L.base.build(scene, lambert);
L.contrast.build(scene, lambert);
L.guide.build(scene, lambert);
L.warn.build(scene, lambert);
L.symbols.build(scene, lambert);
L.lamps.build(scene, emissive);
L.beacon.build(scene, (c) => {
const m = emissive(c);
m.userData.animated = true;
return m;
});
const beaconMat = L.beacon.animatedMat;
/* ------------------------------------------------------------------ *
* Hand-written camera controls (orbit / zoom / pan, mouse + touch)
* ------------------------------------------------------------------ */
const ctrl = {
target: new THREE.Vector3(0, 2.5, -2),
tTarget: new THREE.Vector3(0, 2.5, -2),
dist: 36, tDist: 36,
theta: 0.30, tTheta: 0.30,
phi: 1.05, tPhi: 1.05
};
const clamp = (v, a, b) => Math.min(b, Math.max(a, v));
const VIEWS = {
overview: { t: [0, 2.5, -2], d: 36, th: 0.30, ph: 1.05 },
entrance: { t: [0, 3.0, -10], d: 15, th: 0.04, ph: 1.16 },
junction: { t: [1.0, 1.7, -0.5], d: 17, th: 0.16, ph: 1.20 },
walk: { t: [0, 1.6, 4], d: 8.5, th: 0.00, ph: 1.38 },
plan: { t: [0, 0.5, -2], d: 42, th: 0.00, ph: 0.22 }
};
function setView(name) {
const v = VIEWS[name]; if (!v) return;
ctrl.tTarget.set(v.t[0], v.t[1], v.t[2]);
ctrl.tDist = v.d; ctrl.tTheta = v.th; ctrl.tPhi = v.ph;
}
const pointers = new Map();
let dragMode = null, lastX = 0, lastY = 0, pinchDist = 0;
const el = renderer.domElement;
el.addEventListener('contextmenu', e => e.preventDefault());
el.addEventListener('pointerdown', e => {
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
el.setPointerCapture(e.pointerId);
if (pointers.size === 1) {
dragMode = (e.button === 2 || e.shiftKey) ? 'pan' : 'rotate';
lastX = e.clientX; lastY = e.clientY;
} else if (pointers.size === 2) {
const [a, b] = [...pointers.values()];
pinchDist = Math.hypot(a.x - b.x, a.y - b.y);
}
});
el.addEventListener('pointermove', e => {
if (!pointers.has(e.pointerId)) return;
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
if (pointers.size === 1 && dragMode) {
const dx = e.clientX - lastX, dy = e.clientY - lastY;
lastX = e.clientX; lastY = e.clientY;
if (dragMode === 'rotate') {
ctrl.tTheta -= dx * 0.006;
ctrl.tPhi = clamp(ctrl.tPhi - dy * 0.005, 0.12, 1.48);
} else {
const s = ctrl.dist * 0.0016;
const right = new THREE.Vector3(Math.cos(ctrl.theta), 0, -Math.sin(ctrl.theta));
ctrl.tTarget.addScaledVector(right, -dx * s);
ctrl.tTarget.y = clamp(ctrl.tTarget.y + dy * s, -2, 16);
}
} else if (pointers.size === 2) {
const [a, b] = [...pointers.values()];
const d = Math.hypot(a.x - b.x, a.y - b.y);
if (pinchDist) ctrl.tDist = clamp(ctrl.tDist * (pinchDist / d), 4, 95);
pinchDist = d;
}
});
const endPointer = e => { pointers.delete(e.pointerId); if (pointers.size < 2) pinchDist = 0; if (!pointers.size) dragMode = null; };
el.addEventListener('pointerup', endPointer);
el.addEventListener('pointercancel', endPointer);
el.addEventListener('wheel', e => {
e.preventDefault();
ctrl.tDist = clamp(ctrl.tDist * (1 + e.deltaY * 0.0011), 4, 95);
}, { passive: false });
addEventListener('keydown', e => {
const keys = { '1': 'overview', '2': 'entrance', '3': 'junction', '4': 'walk', '5': 'plan' };
if (keys[e.key]) { setView(keys[e.key]); markView(keys[e.key]); }
if (e.key === 'ArrowLeft') ctrl.tTheta += 0.12;
if (e.key === 'ArrowRight') ctrl.tTheta -= 0.12;
if (e.key === 'ArrowUp') ctrl.tPhi = clamp(ctrl.tPhi - 0.08, 0.12, 1.48);
if (e.key === 'ArrowDown') ctrl.tPhi = clamp(ctrl.tPhi + 0.08, 0.12, 1.48);
if (e.key === 'r' || e.key === 'R') document.getElementById('ui').style.display =
document.getElementById('ui').style.display === 'none' ? 'block' : 'none';
});
/* ------------------------------------------------------------------ *
* UI wiring
* ------------------------------------------------------------------ */
const toggles = {
'l-symbols': L.symbols.group, 'l-guide': L.guide.group, 'l-warn': L.warn.group,
'l-contrast': L.contrast.group, 'l-beacon': L.beacon.group
};
for (const [id, group] of Object.entries(toggles))
document.getElementById(id).addEventListener('change', e => { group.visible = e.target.checked; });
document.getElementById('l-labels').addEventListener('change', e => { labelGroup.visible = e.target.checked; });
document.getElementById('l-badges').addEventListener('change', e => { badgeGroup.visible = e.target.checked; });
document.getElementById('l-gray').addEventListener('change', e => {
el.style.filter = e.target.checked ? 'grayscale(1) contrast(1.05)' : 'none';
});
document.querySelectorAll('.views button').forEach(b => b.addEventListener('click', () => { setView(b.dataset.view); markView(b.dataset.view); }));
function markView(name) {
document.querySelectorAll('.views button').forEach(b => b.classList.toggle('on', b.dataset.view === name));
}
document.getElementById('panelBtn').addEventListener('click', () => {
const ui = document.getElementById('ui');
ui.style.display = ui.style.display === 'none' ? 'block' : 'none';
});
/* ------------------------------------------------------------------ *
* Loop
* ------------------------------------------------------------------ */
const clock = new THREE.Clock();
function tick() {
const dt = Math.min(clock.getDelta(), 0.05);
const k = 1 - Math.pow(0.0015, dt);
ctrl.target.lerp(ctrl.tTarget, k);
ctrl.dist += (ctrl.tDist - ctrl.dist) * k;
ctrl.theta += (ctrl.tTheta - ctrl.theta) * k;
ctrl.phi += (ctrl.tPhi - ctrl.phi) * k;
const sp = Math.sin(ctrl.phi), cp = Math.cos(ctrl.phi);
camera.position.set(
ctrl.target.x + ctrl.dist * sp * Math.sin(ctrl.theta),
ctrl.target.y + ctrl.dist * cp,
ctrl.target.z + ctrl.dist * sp * Math.cos(ctrl.theta)
);
camera.lookAt(ctrl.target);
if (beaconMat) beaconMat.emissiveIntensity = 0.35 + 1.35 * Math.pow(Math.max(0, Math.sin(clock.elapsedTime * 3.2)), 6);
renderer.render(scene, camera);
requestAnimationFrame(tick);
}
tick();
addEventListener('resize', () => {
camera.aspect = innerWidth / innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(innerWidth, innerHeight);
});
</script>
</body>
</html>
```