Prompt specification
Build or customize the Three.js 3D scene "Movable Bench Planning Kit" 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: Movable Bench Planning Kit
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/movable-bench-planning-kit-x3241
Scene Description Prompt:
Please create one self-contained HTML file with Three.js from cdnjs showing participatory design informed by different users. Display a scale bench, planter, stroller proxy, and doorway on a small board. Let viewers see clearances and conflicting footprints before any layout is chosen. Low-poly.
Working Three.js Starter (movable-bench-planning-kit-x3241):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Common Ground — Participatory Design Study</title>
<style>
:root {
--ink: #18313b;
--muted: #637177;
--paper: #f7f5ef;
--line: rgba(24, 49, 59, 0.14);
--access: #167f80;
--care: #df6c57;
--rest: #d19a2f;
--green: #5d8b54;
--danger: #c94d45;
--shadow: 0 18px 50px rgba(30, 45, 48, 0.12);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #ebeae4;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button {
font: inherit;
}
canvas {
position: fixed;
inset: 0;
display: block;
outline: none;
touch-action: none;
}
.brand {
position: fixed;
z-index: 10;
top: 24px;
left: 26px;
width: 330px;
pointer-events: none;
}
.brand-mark {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
color: var(--muted);
font-size: 11px;
font-weight: 800;
letter-spacing: 0.17em;
text-transform: uppercase;
}
.brand-mark::before {
content: "";
width: 28px;
height: 3px;
border-radius: 4px;
background: var(--ink);
}
.brand h1 {
margin: 0;
max-width: 320px;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(30px, 3.2vw, 46px);
font-weight: 500;
line-height: 0.98;
letter-spacing: -0.045em;
}
.brand p {
margin: 12px 0 0;
color: var(--muted);
font-size: 13px;
line-height: 1.5;
}
.study-pill {
display: inline-flex;
align-items: center;
gap: 8px;
margin-top: 14px;
padding: 8px 11px;
border: 1px solid rgba(24, 49, 59, 0.12);
border-radius: 999px;
background: rgba(247, 245, 239, 0.72);
color: var(--ink);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.11em;
text-transform: uppercase;
backdrop-filter: blur(8px);
}
.study-pill::before {
content: "";
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--danger);
box-shadow: 0 0 0 4px rgba(201, 77, 69, 0.12);
}
.panel {
position: fixed;
z-index: 12;
top: 210px;
left: 26px;
width: 330px;
max-height: calc(100vh - 286px);
padding: 18px;
overflow: auto;
border: 1px solid rgba(24, 49, 59, 0.12);
border-radius: 18px;
background: rgba(247, 245, 239, 0.91);
box-shadow: var(--shadow);
backdrop-filter: blur(16px);
scrollbar-width: thin;
}
.section-kicker {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
color: var(--muted);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.section-kicker span:last-child {
color: var(--access);
}
.lens-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 7px;
}
.lens-button {
min-height: 43px;
padding: 9px 10px;
border: 1px solid var(--line);
border-radius: 10px;
background: rgba(255, 255, 255, 0.42);
color: var(--ink);
cursor: pointer;
font-size: 12px;
font-weight: 700;
text-align: left;
transition: 150ms ease;
}
.lens-button:hover {
transform: translateY(-1px);
border-color: rgba(24, 49, 59, 0.3);
background: #fff;
}
.lens-button.active {
color: white;
border-color: var(--ink);
background: var(--ink);
box-shadow: 0 6px 18px rgba(24, 49, 59, 0.16);
}
.lens-button.all {
grid-column: 1 / -1;
display: flex;
justify-content: space-between;
align-items: center;
}
.lens-button small {
display: block;
margin-top: 2px;
color: var(--muted);
font-size: 10px;
font-weight: 500;
}
.lens-button.active small {
color: rgba(255, 255, 255, 0.68);
}
.lens-note {
min-height: 43px;
margin: 10px 0 0;
padding: 10px 11px;
border-left: 3px solid var(--access);
border-radius: 0 8px 8px 0;
background: rgba(22, 127, 128, 0.07);
color: var(--muted);
font-size: 11px;
line-height: 1.45;
}
.divider {
height: 1px;
margin: 16px 0;
background: var(--line);
}
.conflict-count {
display: inline-grid;
place-items: center;
min-width: 24px;
height: 24px;
margin-right: 6px;
border-radius: 7px;
background: rgba(201, 77, 69, 0.12);
color: var(--danger);
font-size: 12px;
}
.conflict-list {
display: grid;
gap: 7px;
margin-top: 11px;
}
.conflict-item {
width: 100%;
padding: 10px;
border: 1px solid rgba(201, 77, 69, 0.16);
border-radius: 10px;
background: rgba(201, 77, 69, 0.055);
color: var(--ink);
cursor: pointer;
text-align: left;
transition: 150ms ease;
}
.conflict-item:hover {
border-color: rgba(201, 77, 69, 0.45);
background: rgba(201, 77, 69, 0.1);
transform: translateX(2px);
}
.conflict-item strong {
display: block;
margin-bottom: 4px;
font-size: 11px;
line-height: 1.25;
}
.conflict-item span {
display: block;
color: var(--muted);
font-size: 10px;
line-height: 1.4;
}
.no-conflicts {
padding: 12px;
border-radius: 10px;
background: rgba(93, 139, 84, 0.1);
color: #436a3d;
font-size: 11px;
line-height: 1.45;
}
.selected-card {
padding: 12px;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.45);
}
.selected-title {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 6px;
}
.selected-title strong {
font-family: Georgia, "Times New Roman", serif;
font-size: 20px;
font-weight: 500;
}
.dimensions {
padding: 4px 7px;
border-radius: 6px;
background: rgba(24, 49, 59, 0.07);
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
white-space: nowrap;
}
.selected-card p {
margin: 0;
color: var(--muted);
font-size: 11px;
line-height: 1.5;
}
.selected-status {
margin-top: 9px;
padding-top: 9px;
border-top: 1px solid var(--line);
color: var(--danger);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.03em;
}
.selected-status.clear {
color: var(--green);
}
.legend {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 7px 12px;
margin-top: 13px;
color: var(--muted);
font-size: 10px;
}
.legend-item {
display: flex;
align-items: center;
gap: 7px;
}
.swatch {
width: 11px;
height: 11px;
border-radius: 3px;
background: var(--swatch);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.toolbar {
position: fixed;
z-index: 15;
right: 24px;
bottom: 24px;
display: flex;
gap: 8px;
padding: 7px;
border: 1px solid rgba(24, 49, 59, 0.13);
border-radius: 13px;
background: rgba(247, 245, 239, 0.9);
box-shadow: var(--shadow);
backdrop-filter: blur(12px);
}
.toolbar button {
padding: 9px 12px;
border: 0;
border-radius: 8px;
background: transparent;
color: var(--ink);
cursor: pointer;
font-size: 11px;
font-weight: 750;
}
.toolbar button:hover {
background: rgba(24, 49, 59, 0.08);
}
.hint {
position: fixed;
z-index: 8;
right: 24px;
bottom: 85px;
padding: 7px 10px;
border-radius: 8px;
background: rgba(247, 245, 239, 0.74);
color: var(--muted);
font-size: 10px;
pointer-events: none;
backdrop-filter: blur(8px);
}
.top-status {
position: fixed;
z-index: 10;
top: 25px;
right: 26px;
display: flex;
align-items: center;
gap: 10px;
padding: 9px 12px;
border: 1px solid rgba(24, 49, 59, 0.12);
border-radius: 999px;
background: rgba(247, 245, 239, 0.72);
color: var(--muted);
font-size: 10px;
font-weight: 700;
backdrop-filter: blur(10px);
}
.top-status strong {
color: var(--ink);
}
.status-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--green);
}
#labelLayer {
position: fixed;
z-index: 5;
inset: 0;
overflow: hidden;
pointer-events: none;
}
.object-label,
.conflict-pin {
position: absolute;
transform: translate(-50%, -100%);
white-space: nowrap;
}
.object-label {
padding: 5px 8px;
border: 1px solid rgba(24, 49, 59, 0.12);
border-radius: 7px;
background: rgba(247, 245, 239, 0.88);
color: var(--ink);
box-shadow: 0 6px 18px rgba(24, 49, 59, 0.08);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.06em;
text-transform: uppercase;
backdrop-filter: blur(6px);
}
.conflict-pin {
display: flex;
align-items: center;
gap: 5px;
padding: 5px 7px;
border: 1px solid rgba(201, 77, 69, 0.35);
border-radius: 7px;
background: rgba(255, 244, 240, 0.94);
color: #9f342e;
box-shadow: 0 7px 18px rgba(110, 40, 35, 0.12);
font-size: 8px;
font-weight: 900;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.conflict-pin span {
display: grid;
place-items: center;
width: 14px;
height: 14px;
border-radius: 50%;
background: var(--danger);
color: white;
font-size: 9px;
}
@media (max-width: 820px) {
.brand {
top: 16px;
left: 16px;
width: 270px;
}
.brand h1 {
font-size: 31px;
}
.brand p {
display: none;
}
.study-pill {
margin-top: 9px;
}
.panel {
top: auto;
bottom: 14px;
left: 14px;
width: min(330px, calc(100vw - 28px));
max-height: 42vh;
padding: 14px;
}
.top-status {
top: 16px;
right: 16px;
}
.top-status span:last-child {
display: none;
}
.toolbar {
right: 14px;
bottom: 14px;
}
.hint {
display: none;
}
}
@media (max-width: 520px) {
.brand h1 {
font-size: 27px;
}
.brand-mark {
margin-bottom: 8px;
}
.study-pill {
font-size: 8px;
}
.panel {
max-height: 39vh;
}
.toolbar {
bottom: auto;
top: 112px;
}
}
</style>
</head>
<body>
<header class="brand">
<div class="brand-mark">Common Ground / Design Study 01</div>
<h1>A shared<br />threshold.</h1>
<p>
Compare the needs of people using the space before committing to a layout.
Every color represents a different participant perspective.
</p>
<div class="study-pill">No layout selected</div>
</header>
<aside class="panel" aria-label="Study controls">
<div class="section-kicker">
<span>View through a perspective</span>
<span id="perspectiveStatus">All needs</span>
</div>
<div class="lens-grid" id="lensButtons">
<button class="lens-button all active" data-lens="all">
All perspectives <small>Shared comparison</small>
</button>
<button class="lens-button" data-lens="access">
Step-free access <small>Mobility</small>
</button>
<button class="lens-button" data-lens="care">
Caregiver / stroller <small>Care</small>
</button>
<button class="lens-button" data-lens="rest">
Seated rest <small>Comfort</small>
</button>
<button class="lens-button" data-lens="green">
Green care <small>Maintenance</small>
</button>
</div>
<p class="lens-note" id="lensNote">
All participant clearances are visible. Red areas identify overlaps that need discussion.
</p>
<div class="divider"></div>
<div class="section-kicker">
<span><span class="conflict-count" id="conflictCount">0</span> live conflicts</span>
<span>Before layout</span>
</div>
<div class="conflict-list" id="conflictList" aria-live="polite"></div>
<div class="divider"></div>
<div class="section-kicker">
<span>Selected study piece</span>
<span id="selectedType">Care proxy</span>
</div>
<div class="selected-card">
<div class="selected-title">
<strong id="selectedName">Stroller proxy</strong>
<span class="dimensions" id="selectedDimensions">0.65 × 0.95 m</span>
</div>
<p id="selectedDescription">
A movable proxy for a caregiver moving with a child.
</p>
<div class="selected-status" id="selectedStatus">
Participates in 2 clearance conflicts
</div>
</div>
<div class="legend">
<div class="legend-item">
<span class="swatch" style="--swatch:#167f80"></span> Access
</div>
<div class="legend-item">
<span class="swatch" style="--swatch:#df6c57"></span> Care
</div>
<div class="legend-item">
<span class="swatch" style="--swatch:#d19a2f"></span> Rest
</div>
<div class="legend-item">
<span class="swatch" style="--swatch:#5d8b54"></span> Green care
</div>
</div>
</aside>
<div class="top-status">
<span class="status-dot"></span>
<strong>Live field mockup</strong>
<span>5.2 × 3.6 m study board</span>
</div>
<div class="hint">Drag a piece to test it · drag background to orbit · scroll to zoom</div>
<div class="toolbar" aria-label="Camera controls">
<button id="resetView">Reset view</button>
<button id="topView">Plan view</button>
</div>
<div id="labelLayer"></div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const COLORS = {
ink: 0x18313b,
paper: 0xf7f5ef,
board: 0xd8c9ad,
boardEdge: 0xa9906e,
wood: 0xb77946,
woodLight: 0xd0a06a,
access: 0x167f80,
care: 0xdf6c57,
rest: 0xd19a2f,
green: 0x5d8b54,
danger: 0xc94d45,
soil: 0x514338,
wheel: 0x26343a
};
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xebeae4);
scene.fog = new THREE.Fog(0xebeae4, 12, 22);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.08;
document.body.prepend(renderer.domElement);
const camera = new THREE.PerspectiveCamera(
41,
window.innerWidth / window.innerHeight,
0.1,
60
);
const view = {
theta: 0.58,
phi: 0.72,
distance: 8.1,
target: new THREE.Vector3(0, 0.05, 0)
};
const goal = {
theta: view.theta,
phi: view.phi,
distance: view.distance,
target: view.target.clone()
};
function updateCamera(dt) {
const easing = 1 - Math.pow(0.0008, dt);
view.theta += (goal.theta - view.theta) * easing;
view.phi += (goal.phi - view.phi) * easing;
view.distance += (goal.distance - view.distance) * easing;
view.target.lerp(goal.target, easing);
const sinPhi = Math.sin(view.phi);
camera.position.set(
view.target.x + view.distance * sinPhi * Math.sin(view.theta),
view.target.y + view.distance * Math.cos(view.phi),
view.target.z + view.distance * sinPhi * Math.cos(view.theta)
);
camera.lookAt(view.target);
}
updateCamera(1);
scene.add(new THREE.HemisphereLight(0xfff8ea, 0x68747a, 2.1));
const keyLight = new THREE.DirectionalLight(0xfff4df, 3.4);
keyLight.position.set(-4, 8, 5);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -6;
keyLight.shadow.camera.right = 6;
keyLight.shadow.camera.top = 6;
keyLight.shadow.camera.bottom = -6;
keyLight.shadow.camera.near = 0.5;
keyLight.shadow.camera.far = 20;
keyLight.shadow.bias = -0.0004;
scene.add(keyLight);
const fillLight = new THREE.DirectionalLight(0xaed7dc, 0.85);
fillLight.position.set(5, 3, -4);
scene.add(fillLight);
function material(color, options = {}) {
return new THREE.MeshStandardMaterial({
color,
roughness: 0.82,
metalness: 0,
flatShading: true,
...options
});
}
function addMesh(parent, geometry, mat, position = [0, 0, 0], rotation = [0, 0, 0]) {
const mesh = new THREE.Mesh(geometry, mat);
mesh.position.set(...position);
mesh.rotation.set(...rotation);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function addBox(parent, size, position, color, options = {}) {
return addMesh(
parent,
new THREE.BoxGeometry(...size),
material(color, options),
position
);
}
function addCylinderBetween(parent, a, b, radius, color) {
const start = new THREE.Vector3(...a);
const end = new THREE.Vector3(...b);
const direction = end.clone().sub(start);
const mesh = addMesh(
parent,
new THREE.CylinderGeometry(radius, radius, direction.length(), 6),
material(color),
start.clone().add(end).multiplyScalar(0.5).toArray()
);
mesh.quaternion.setFromUnitVectors(
new THREE.Vector3(0, 1, 0),
direction.normalize()
);
return mesh;
}
const ground = addMesh(
scene,
new THREE.PlaneGeometry(40, 40),
material(0xe8e6df),
[0, -0.31, 0],
[-Math.PI / 2, 0, 0]
);
ground.castShadow = false;
const board = addBox(scene, [5.2, 0.28, 3.6], [0, -0.14, 0], COLORS.board);
board.receiveShadow = true;
addBox(scene, [5.24, 0.12, 0.09], [0, -0.25, 1.79], COLORS.boardEdge);
addBox(scene, [5.24, 0.12, 0.09], [0, -0.25, -1.79], COLORS.boardEdge);
addBox(scene, [0.09, 0.12, 3.62], [-2.59, -0.25, 0], COLORS.boardEdge);
addBox(scene, [0.09, 0.12, 3.62], [2.59, -0.25, 0], COLORS.boardEdge);
const gridPoints = [];
for (let x = -2.25; x <= 2.26; x += 0.25) {
gridPoints.push(x, 0.006, -1.6, x, 0.006, 1.6);
}
for (let z = -1.5; z <= 1.51; z += 0.25) {
gridPoints.push(-2.4, 0.006, z, 2.4, 0.006, z);
}
const gridGeometry = new THREE.BufferGeometry();
gridGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(gridPoints, 3)
);
scene.add(
new THREE.LineSegments(
gridGeometry,
new THREE.LineBasicMaterial({
color: COLORS.ink,
transparent: true,
opacity: 0.09
})
)
);
const objects = {};
const pickables = [];
function addFootprint(root, width, depth, color) {
const points = [
new THREE.Vector3(-width / 2, 0.019, -depth / 2),
new THREE.Vector3(width / 2, 0.019, -depth / 2),
new THREE.Vector3(width / 2, 0.019, depth / 2),
new THREE.Vector3(-width / 2, 0.019, depth / 2)
];
const line = new THREE.LineLoop(
new THREE.BufferGeometry().setFromPoints(points),
new THREE.LineBasicMaterial({
color,
transparent: true,
opacity: 0.85
})
);
root.add(line);
}
function registerPickable(root) {
root.traverse((child) => {
if (child.isMesh) {
child.userData.pickRoot = root;
pickables.push(child);
}
});
}
// Bench
const bench = new THREE.Group();
bench.position.set(-1.5, 0, -1.12);
bench.userData = {
kind: "bench",
footprint: { width: 1.65, depth: 0.55 },
movable: true
};
const benchWood = material(COLORS.wood);
const benchWoodLight = material(COLORS.woodLight);
[-0.2, 0, 0.2].forEach((z) => {
addBox(bench, [1.65, 0.09, 0.16], [0, 0.47, z], COLORS.woodLight);
});
[-0.68, 0.68].forEach((x) => {
addBox(bench, [0.09, 0.43, 0.09], [x, 0.22, -0.18], COLORS.ink);
addBox(bench, [0.09, 0.43, 0.09], [x, 0.22, 0.18], COLORS.ink);
addBox(bench, [0.08, 0.76, 0.08], [x, 0.39, -0.25], COLORS.ink);
});
addBox(bench, [1.55, 0.13, 0.07], [0, 0.72, -0.25], COLORS.wood);
addBox(bench, [1.55, 0.13, 0.07], [0, 0.91, -0.25], COLORS.woodLight);
addBox(bench, [0.07, 0.07, 0.5], [-0.78, 0.69, -0.02], COLORS.ink);
addBox(bench, [0.07, 0.07, 0.5], [0.78, 0.69, -0.02], COLORS.ink);
addFootprint(bench, 1.65, 0.55, COLORS.rest);
scene.add(bench);
objects.bench = bench;
registerPickable(bench);
// Planter
const planter = new THREE.Group();
planter.position.set(0.88, 0, -1.05);
planter.userData = {
kind: "planter",
footprint: { width: 0.75, depth: 0.45 },
movable: true
};
addBox(planter, [0.75, 0.43, 0.45], [0, 0.215, 0], 0xb16e46);
addBox(planter, [0.82, 0.07, 0.52], [0, 0.46, 0], 0xd39a68);
addBox(planter, [0.68, 0.04, 0.38], [0, 0.505, 0], COLORS.soil);
const plantLocations = [
[-0.2, 0.69, -0.04],
[0.05, 0.82, 0.02],
[0.23, 0.66, -0.03]
];
plantLocations.forEach((position, index) => {
const height = position[1] - 0.5;
addCylinderBetween(
planter,
[position[0], 0.5, position[2]],
position,
0.025,
0x466d3b
);
const leaf = addMesh(
planter,
new THREE.IcosahedronGeometry(0.19 + index * 0.012, 0),
material(index === 1 ? 0x6f9a52 : 0x527e45),
position
);
leaf.scale.set(1, 0.72, 0.85);
leaf.rotation.set(index * 0.3, index * 0.7, 0.2);
});
addFootprint(planter, 0.75, 0.45, COLORS.green);
scene.add(planter);
objects.planter = planter;
registerPickable(planter);
// Stroller proxy
const stroller = new THREE.Group();
stroller.position.set(0.1, 0, -0.45);
stroller.userData = {
kind: "stroller",
footprint: { width: 0.65, depth: 0.95 },
movable: true
};
const frameColor = 0x50646c;
const fabricColor = COLORS.care;
[-0.31, 0.31].forEach((x) => {
[-0.32, 0.32].forEach((z) => {
addMesh(
stroller,
new THREE.CylinderGeometry(0.14, 0.14, 0.09, 10),
material(COLORS.wheel),
[x, 0.15, z],
[0, 0, Math.PI / 2]
);
addMesh(
stroller,
new THREE.CylinderGeometry(0.055, 0.055, 0.095, 8),
material(0xaab1b1),
[x, 0.15, z],
[0, 0, Math.PI / 2]
);
});
});
addCylinderBetween(stroller, [-0.3, 0.2, -0.3], [-0.22, 0.79, 0.02], 0.028, frameColor);
addCylinderBetween(stroller, [0.3, 0.2, -0.3], [0.22, 0.79, 0.02], 0.028, frameColor);
addCylinderBetween(stroller, [-0.26, 0.2, 0.3], [-0.2, 0.63, 0.22], 0.028, frameColor);
addCylinderBetween(stroller, [0.26, 0.2, 0.3], [0.2, 0.63, 0.22], 0.028, frameColor);
addBox(stroller, [0.47, 0.11, 0.44], [0, 0.48, 0.02], fabricColor);
addBox(stroller, [0.47, 0.43, 0.1], [0, 0.69, -0.23], fabricColor, {
roughness: 0.9
});
const canopy = addBox(
stroller,
[0.53, 0.25, 0.36],
[0, 0.91, -0.1],
0xe17b65
);
canopy.rotation.x = 0.22;
addCylinderBetween(stroller, [-0.2, 0.57, 0.25], [-0.25, 1.03, 0.36], 0.025, frameColor);
addCylinderBetween(stroller, [0.2, 0.57, 0.25], [0.25, 1.03, 0.36], 0.025, frameColor);
addCylinderBetween(stroller, [-0.25, 1.03, 0.36], [0.25, 1.03, 0.36], 0.035, 0x27383f);
addBox(stroller, [0.4, 0.07, 0.22], [0, 0.16, 0.37], 0x394b52);
addFootprint(stroller, 0.65, 0.95, COLORS.care);
scene.add(stroller);
objects.stroller = stroller;
registerPickable(stroller);
// Doorway and door
const door = new THREE.Group();
door.position.set(-0.05, 0, -1.48);
door.userData = {
kind: "door",
footprint: { width: 0.9, depth: 0.14 },
movable: false
};
addBox(door, [0.12, 1.72, 0.14], [0, 0.86, 0], COLORS.ink);
addBox(door, [0.12, 1.72, 0.14], [0.9, 0.86, 0], COLORS.ink);
addBox(door, [1.02, 0.13, 0.14], [0.45, 1.72, 0], COLORS.ink);
addBox(door, [0.88, 0.025, 0.16], [0.45, 0.014, 0], 0x8a7965);
const leaf = new THREE.Group();
leaf.rotation.y = -1.12;
door.add(leaf);
addBox(leaf, [0.86, 1.56, 0.055], [0.43, 0.8, 0], 0xc4915f);
addBox(leaf, [0.68, 1.18, 0.065], [0.43, 0.82, 0], 0xd4aa76);
addMesh(
leaf,
new THREE.CylinderGeometry(0.035, 0.035, 0.12, 8),
material(COLORS.ink),
[0.75, 0.75, -0.06],
[Math.PI / 2, 0, 0]
);
scene.add(door);
objects.door = door;
registerPickable(door);
const zoneGroups = {
access: new THREE.Group(),
care: new THREE.Group(),
rest: new THREE.Group(),
green: new THREE.Group()
};
Object.values(zoneGroups).forEach((group) => scene.add(group));
const conflictGroup = new THREE.Group();
scene.add(conflictGroup);
function rectPolygon(cx, cz, width, depth) {
return [
{ x: cx - width / 2, z: cz - depth / 2 },
{ x: cx + width / 2, z: cz - depth / 2 },
{ x: cx + width / 2, z: cz + depth / 2 },
{ x: cx - width / 2, z: cz + depth / 2 }
];
}
function circlePolygon(cx, cz, radius, segments = 32) {
const points = [];
for (let i = 0; i < segments; i++) {
const angle = (i / segments) * Math.PI * 2;
points.push({
x: cx + Math.cos(angle) * radius,
z: cz + Math.sin(angle) * radius
});
}
return points;
}
function sectorPolygon(cx, cz, radius, segments = 24) {
const points = [{ x: cx, z: cz }];
for (let i = 0; i <= segments; i++) {
const angle = (i / segments) * Math.PI * 2 * 0.5;
points.push({
x: cx + Math.cos(angle) * radius,
z: cz + Math.sin(angle) * radius
});
}
return points;
}
function signedArea(polygon) {
let area = 0;
for (let i = 0; i < polygon.length; i++) {
const current = polygon[i];
const next = polygon[(i + 1) % polygon.length];
area += current.x * next.z - next.x * current.z;
}
return area / 2;
}
function ensureCounterClockwise(polygon) {
return signedArea(polygon) < 0 ? [...polygon].reverse() : polygon;
}
function cross(ax, az, bx, bz) {
return ax * bz - az * bx;
}
function clipPolygon(subject, clip) {
let output = ensureCounterClockwise(subject);
for (let i = 0; i < clip.length; i++) {
if (!output.length) break;
const clipPoint = clip[i];
const nextPoint = clip[(i + 1) % clip.length];
const edgeX = nextPoint.x - clipPoint.x;
const edgeZ = nextPoint.z - clipPoint.z;
const input = output;
output = [];
for (let j = 0; j < input.length; j++) {
const current = input[j];
const previous = input[(j + input.length - 1) % input.length];
const currentSide = cross(
edgeX,
edgeZ,
current.x - clipPoint.x,
current.z - clipPoint.z
);
const previousSide = cross(
edgeX,
edgeZ,
previous.x - clipPoint.x,
previous.z - clipPoint.z
);
const currentInside = currentSide >= -0.00001;
const previousInside = previousSide >= -0.00001;
if (currentInside !== previousInside) {
const denominator = previousSide - currentSide;
const t = Math.abs(denominator) < 0.000001 ? 0 : previousSide / denominator;
output.push({
x: previous.x + (current.x - previous.x) * t,
z: previous.z + (current.z - previous.z) * t
});
}
if (currentInside) output.push(current);
}
}
return output;
}
function polygonIntersection(a, b) {
const first = clipPolygon(a, b);
const second = clipPolygon(b, a);
const firstArea = Math.abs(signedArea(first));
const secondArea = Math.abs(signedArea(second));
if (firstArea >= secondArea && firstArea > 0.0001) return first;
if (secondArea > 0.0001) return second;
return [];
}
function polygonCentroid(polygon) {
if (!polygon.length) return new THREE.Vector3();
const center = polygon.reduce(
(sum, point) => ({ x: sum.x + point.x, z: sum.z + point.z }),
{ x: 0, z: 0 }
);
return new THREE.Vector3(
center.x / polygon.length,
0.08,
center.z / polygon.length
);
}
function clearGroup(group) {
while (group.children.length) {
const child = group.children.pop();
child.traverse((node) => {
if (node.geometry) node.geometry.dispose();
if (node.material) {
if (Array.isArray(node.material)) {
node.material.forEach((mat) => mat.dispose());
} else {
node.material.dispose();
}
}
});
}
}
function polygonVisual(polygon, color, opacity, parent, dashed = true, y = 0.025) {
const shape = new THREE.Shape(
polygon.map((point) => new THREE.Vector2(point.x, point.z))
);
const geometry = new THREE.ShapeGeometry(shape);
geometry.rotateX(Math.PI / 2);
const fill = new THREE.Mesh(
geometry,
new THREE.MeshBasicMaterial({
color,
transparent: true,
opacity,
depthWrite: false,
side: THREE.DoubleSide
})
);
fill.position.y = y;
fill.renderOrder = 2;
parent.add(fill);
const linePoints = polygon.map(
(point) => new THREE.Vector3(point.x, y + 0.006, point.z)
);
linePoints.push(linePoints[0].clone());
const lineMaterial = dashed
? new THREE.LineDashedMaterial({
color,
dashSize: 0.08,
gapSize: 0.055,
transparent: true,
opacity: 0.9,
depthWrite: false
})
: new THREE.LineBasicMaterial({
color,
transparent: true,
opacity: 0.9,
depthWrite: false
});
const line = new THREE.Line(
new THREE.BufferGeometry().setFromPoints(linePoints),
lineMaterial
);
if (dashed) line.computeLineDistances();
line.renderOrder = 3;
parent.add(line);
}
function shapeFor(id) {
const benchPos = objects.bench.position;
const planterPos = objects.planter.position;
const strollerPos = objects.stroller.position;
switch (id) {
case "bench":
return rectPolygon(benchPos.x, benchPos.z, 1.65, 0.55);
case "planter":
return rectPolygon(planterPos.x, planterPos.z, 0.75, 0.45);
case "stroller":
return rectPolygon(strollerPos.x, strollerPos.z, 0.65, 0.95);
case "door":
return sectorPolygon(-0.05, -1.48, 0.92);
case "route":
return rectPolygon(0.4, -0.25, 0.9, 2.35);
case "turn":
return circlePolygon(-0.75, 0.15, 0.78);
case "benchAccess":
return rectPolygon(benchPos.x, benchPos.z + 0.575, 1.65, 0.6);
case "strollerLane":
return rectPolygon(strollerPos.x, strollerPos.z, 0.85, 1.25);
case "planterService":
return rectPolygon(planterPos.x, planterPos.z, 1.19, 0.89);
default:
return [];
}
}
function rebuildZones() {
Object.values(zoneGroups).forEach(clearGroup);
polygonVisual(
shapeFor("door"),
COLORS.danger,
0.12,
zoneGroups.access
);
polygonVisual(
shapeFor("route"),
COLORS.access,
0.12,
zoneGroups.access
);
polygonVisual(
shapeFor("turn"),
COLORS.access,
0.1,
zoneGroups.access
);
polygonVisual(
shapeFor("strollerLane"),
COLORS.care,
0.12,
zoneGroups.care
);
polygonVisual(
shapeFor("benchAccess"),
COLORS.rest,
0.14,
zoneGroups.rest
);
polygonVisual(
shapeFor("planterService"),
COLORS.green,
0.13,
zoneGroups.green
);
}
const conflictDefinitions = [
{
a: "door",
b: "bench",
title: "Door swing / Bench",
detail: "The open leaf crosses the bench footprint.",
lenses: ["access", "rest"]
},
{
a: "door",
b: "planter",
title: "Door swing / Planter",
detail: "The open leaf crosses the planter footprint.",
lenses: ["access", "green"]
},
{
a: "door",
b: "stroller",
title: "Door swing / Stroller",
detail: "The door leaf cuts through the stroller envelope.",
lenses: ["access", "care"]
},
{
a: "route",
b: "bench",
title: "Step-free route / Bench",
detail: "The continuous access route is interrupted.",
lenses: ["access", "rest"]
},
{
a: "route",
b: "planter",
title: "Step-free route / Planter",
detail: "The continuous access route is interrupted.",
lenses: ["access", "green"]
},
{
a: "route",
b: "stroller",
title: "Step-free route / Stroller",
detail: "A continuous step-free route is interrupted.",
lenses: ["access", "care"]
},
{
a: "turn",
b: "benchAccess",
title: "Turning space / Bench approach",
detail: "Maneuvering space competes with the bench approach.",
lenses: ["access", "rest"]
},
{
a: "turn",
b: "planterService",
title: "Turning space / Plant care",
detail: "Maneuvering space competes with maintenance access.",
lenses: ["access", "green"]
},
{
a: "turn",
b: "strollerLane",
title: "Turning space / Stroller lane",
detail: "Maneuvering space competes with caregiver circulation.",
lenses: ["access", "care"]
},
{
a: "planterService",
b: "strollerLane",
title: "Plant care / Stroller lane",
detail: "Care space and the stroller passing envelope overlap.",
lenses: ["green", "care"]
},
{
a: "benchAccess",
b: "strollerLane",
title: "Bench approach / Stroller lane",
detail: "Resting and caregiver circulation compete for the same space.",
lenses: ["rest", "care"]
},
{
a: "bench",
b: "planter",
title: "Bench / Planter",
detail: "The two solid footprints physically overlap.",
lenses: ["rest", "green"]
},
{
a: "bench",
b: "stroller",
title: "Bench / Stroller",
detail: "The two solid footprints physically overlap.",
lenses: ["rest", "care"]
},
{
a: "planter",
b: "stroller",
title: "Planter / Stroller",
detail: "The two solid footprints physically overlap.",
lenses: ["green", "care"]
}
];
let conflicts = [];
function clearConflictGroup() {
while (conflictGroup.children.length) {
const child = conflictGroup.children.pop();
child.traverse((node) => {
if (node.geometry) node.geometry.dispose();
if (node.material) node.material.dispose();
});
}
}
function recomputeConflicts() {
rebuildZones();
clearConflictGroup();
conflicts = [];
conflictDefinitions.forEach((definition) => {
const a = shapeFor(definition.a);
const b = shapeFor(definition.b);
const intersection = polygonIntersection(a, b);
const area = Math.abs(signedArea(intersection));
if (area < 0.0025 || intersection.length < 3) return;
const conflict = {
...definition,
area,
intersection,
anchor: polygonCentroid(intersection)
};
conflicts.push(conflict);
const patch = new THREE.Shape(
intersection.map((point) => new THREE.Vector2(point.x, point.z))
);
const geometry = new THREE.ShapeGeometry(patch);
geometry.rotateX(Math.PI / 2);
const mesh = new THREE.Mesh(
geometry,
new THREE.MeshBasicMaterial({
color: COLORS.danger,
transparent: true,
opacity: 0.38,
depthWrite: false,
side: THREE.DoubleSide
})
);
mesh.position.y = 0.047;
mesh.renderOrder = 5;
conflictGroup.add(mesh);
const edgePoints = intersection.map(
(point) => new THREE.Vector3(point.x, 0.054, point.z)
);
edgePoints.push(edgePoints[0].clone());
const edge = new THREE.Line(
new THREE.BufferGeometry().setFromPoints(edgePoints),
new THREE.LineBasicMaterial({
color: COLORS.danger,
transparent: true,
opacity: 0.95,
depthWrite: false
})
);
edge.renderOrder = 6;
conflictGroup.add(edge);
});
conflicts.sort((a, b) => b.area - a.area);
updateConflictUI();
}
const selectionRing = new THREE.LineLoop(
new THREE.BufferGeometry(),
new THREE.LineBasicMaterial({
color: COLORS.ink,
transparent: true,
opacity: 0.9
})
);
selectionRing.renderOrder = 7;
scene.add(selectionRing);
let selected = objects.stroller;
const objectDetails = {
bench: {
name: "Scale bench",
type: "Rest",
dimensions: "1.65 × 0.55 m",
description:
"A resting place with an adjacent 0.60 m approach zone for sitting, standing, or a support person."
},
planter: {
name: "Planter",
type: "Green care",
dimensions: "0.75 × 0.45 m",
description:
"A low planter that still needs a surrounding service zone for watering, pruning, and soil checks."
},
stroller: {
name: "Stroller proxy",
type: "Care",
dimensions: "0.65 × 0.95 m",
description:
"A movable proxy for a caregiver moving with a child. Its passing lane is wider than its physical footprint."
},
door: {
name: "Doorway",
type: "Access",
dimensions: "0.90 m opening",
description:
"A shared entrance. The open-leaf swing is treated as an active clearance zone, not spare space."
}
};
function updateSelectionRing() {
const points = [];
const detail = objectDetails[selected.userData.kind];
if (selected.userData.kind === "door") {
const polygon = sectorPolygon(-0.05, -1.48, 0.92);
polygon.forEach((point) => points.push(new THREE.Vector3(point.x, 0.065, point.z)));
} else {
const { width, depth } = selected.userData.footprint;
const x = selected.position.x;
const z = selected.position.z;
points.push(
new THREE.Vector3(x - width / 2 - 0.035, 0.065, z - depth / 2 - 0.035),
new THREE.Vector3(x + width / 2 + 0.035, 0.065, z - depth / 2 - 0.035),
new THREE.Vector3(x + width / 2 + 0.035, 0.065, z + depth / 2 + 0.035),
new THREE.Vector3(x - width / 2 - 0.035, 0.065, z + depth / 2 + 0.035)
);
}
selectionRing.geometry.dispose();
selectionRing.geometry = new THREE.BufferGeometry().setFromPoints(points);
}
function selectObject(root) {
selected = root;
const detail = objectDetails[root.userData.kind];
document.getElementById("selectedName").textContent = detail.name;
document.getElementById("selectedType").textContent = detail.type;
document.getElementById("selectedDimensions").textContent = detail.dimensions;
document.getElementById("selectedDescription").textContent = detail.description;
updateSelectionRing();
updateConflictUI();
}
const labelLayer = document.getElementById("labelLayer");
const objectLabels = [];
function addObjectLabel(text, root, localPosition) {
const element = document.createElement("div");
element.className = "object-label";
element.textContent = text;
labelLayer.appendChild(element);
objectLabels.push({ element, root, localPosition });
}
addObjectLabel("Scale bench", objects.bench, new THREE.Vector3(0, 1.08, -0.08));
addObjectLabel("Planter", objects.planter, new THREE.Vector3(0, 1.13, 0));
addObjectLabel("Stroller proxy", objects.stroller, new THREE.Vector3(0, 1.18, 0));
addObjectLabel("Shared doorway", objects.door, new THREE.Vector3(0.45, 1.95, 0));
let conflictPins = [];
function updateConflictUI() {
const count = document.getElementById("conflictCount");
const list = document.getElementById("conflictList");
count.textContent = conflicts.length;
list.innerHTML = "";
if (!conflicts.length) {
list.innerHTML =
'<div class="no-conflicts">No current overlaps in this arrangement. Continue testing with participants before choosing a layout.</div>';
} else {
conflicts.forEach((conflict, index) => {
const button = document.createElement("button");
button.className = "conflict-item";
button.innerHTML = `<strong>${conflict.title}</strong><span>${conflict.detail}</span>`;
button.addEventListener("click", () => focusConflict(conflict));
list.appendChild(button);
});
}
const selectedKind = selected.userData.kind;
const selectedConflicts = conflicts.filter(
(conflict) => conflict.a === selectedKind || conflict.b === selectedKind
);
const status = document.getElementById("selectedStatus");
if (selectedConflicts.length) {
status.textContent = `Participates in ${selectedConflicts.length} clearance conflict${
selectedConflicts.length === 1 ? "" : "s"
}`;
status.classList.remove("clear");
} else {
status.textContent = "No current clearance conflicts";
status.classList.add("clear");
}
conflictPins.forEach((pin) => pin.element.remove());
conflictPins = [];
conflicts.slice(0, 4).forEach((conflict) => {
const element = document.createElement("div");
element.className = "conflict-pin";
element.innerHTML = `<span>!</span>${conflict.title}`;
labelLayer.appendChild(element);
conflictPins.push({ element, anchor: conflict.anchor.clone() });
});
}
function focusConflict(conflict) {
goal.target.copy(conflict.anchor);
goal.distance = 4.4;
goal.phi = 0.82;
goal.theta = 0.52;
}
const lensContent = {
all: {
label: "All needs",
note:
"All participant clearances are visible. Red areas identify overlaps that need discussion."
},
access: {
label: "Step-free access",
note:
"The access view tests a continuous route, a turning circle, and the active swing of the shared door."
},
care: {
label: "Caregiver",
note:
"The care view tests the stroller’s physical footprint against the wider passing envelope it needs."
},
rest: {
label: "Seated rest",
note:
"The rest view tests a clear approach and transfer space in front of the bench, not just the bench itself."
},
green: {
label: "Green care",
note:
"The green-care view tests whether staff can reach, water, and maintain the planter without blocking circulation."
}
};
document.getElementById("lensButtons").addEventListener("click", (event) => {
const button = event.target.closest("button[data-lens]");
if (!button) return;
const lens = button.dataset.lens;
document.querySelectorAll(".lens-button").forEach((item) => {
item.classList.toggle("active", item === button);
});
Object.entries(zoneGroups).forEach(([key, group]) => {
group.visible = lens === "all" || lens === key;
});
document.getElementById("perspectiveStatus").textContent = lensContent[lens].label;
document.getElementById("lensNote").textContent = lensContent[lens].note;
});
// Custom camera controls and object dragging
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
const dragPlane = new THREE.Plane(new THREE.Vector3(0, 1, 0), 0);
const planePoint = new THREE.Vector3();
let interaction = null;
let dragOffset = new THREE.Vector3();
let lastPointer = { x: 0, y: 0 };
let pointerMoved = false;
function setPointer(event) {
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);
}
function hitObject(event) {
setPointer(event);
const hits = raycaster.intersectObjects(pickables, false);
return hits.length ? hits[0].object.userData.pickRoot : null;
}
renderer.domElement.addEventListener("pointerdown", (event) => {
renderer.domElement.setPointerCapture(event.pointerId);
lastPointer = { x: event.clientX, y: event.clientY };
pointerMoved = false;
if (event.button === 0) {
const root = hitObject(event);
if (root) {
selectObject(root);
if (root.userData.movable && raycaster.ray.intersectPlane(dragPlane, planePoint)) {
interaction = "object";
dragOffset.set(
root.position.x - planePoint.x,
0,
root.position.z - planePoint.z
);
renderer.domElement.style.cursor = "grabbing";
return;
}
}
interaction = "orbit";
} else if (event.button === 2) {
interaction = "pan";
}
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!interaction) {
renderer.domElement.style.cursor = hitObject(event) ? "grab" : "default";
return;
}
const dx = event.clientX - lastPointer.x;
const dy = event.clientY - lastPointer.y;
if (Math.abs(dx) + Math.abs(dy) > 1) pointerMoved = true;
if (interaction === "orbit") {
goal.theta -= dx * 0.006;
goal.phi = THREE.MathUtils.clamp(goal.phi + dy * 0.005, 0.14, 1.45);
} else if (interaction === "pan") {
const scale = goal.distance * 0.00115;
const right = new THREE.Vector3(Math.cos(goal.theta), 0, -Math.sin(goal.theta));
const forward = new THREE.Vector3(Math.sin(goal.theta), 0, Math.cos(goal.theta));
goal.target.addScaledVector(right, -dx * scale);
goal.target.addScaledVector(forward, -dy * scale);
goal.target.x = THREE.MathUtils.clamp(goal.target.x, -2.1, 2.1);
goal.target.z = THREE.MathUtils.clamp(goal.target.z, -1.3, 1.3);
} else if (interaction === "object") {
setPointer(event);
if (raycaster.ray.intersectPlane(dragPlane, planePoint)) {
const { width, depth } = selected.userData.footprint;
selected.position.x = THREE.MathUtils.clamp(
planePoint.x + dragOffset.x,
-2.4 + width / 2,
2.4 - width / 2
);
selected.position.z = THREE.MathUtils.clamp(
planePoint.z + dragOffset.z,
-1.6 + depth / 2,
1.6 - depth / 2
);
recomputeConflicts();
updateSelectionRing();
}
}
lastPointer = { x: event.clientX, y: event.clientY };
});
function endPointer(event) {
if (interaction === "object" && !pointerMoved) {
selectObject(selected);
}
interaction = null;
renderer.domElement.style.cursor = "default";
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
renderer.domElement.addEventListener("pointerup", endPointer);
renderer.domElement.addEventListener("pointercancel", endPointer);
renderer.domElement.addEventListener("contextmenu", (event) => event.preventDefault());
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
goal.distance = THREE.MathUtils.clamp(
goal.distance * Math.exp(event.deltaY * 0.001),
3.1,
12
);
},
{ passive: false }
);
function resetView() {
goal.theta = 0.58;
goal.phi = 0.72;
goal.distance = 8.1;
goal.target.set(0, 0.05, 0);
}
function topView() {
goal.theta = 0;
goal.phi = 0.13;
goal.distance = 7.4;
goal.target.set(0, 0, 0);
}
document.getElementById("resetView").addEventListener("click", resetView);
document.getElementById("topView").addEventListener("click", topView);
window.addEventListener("keydown", (event) => {
if (event.key.toLowerCase() === "r") resetView();
if (event.key.toLowerCase() === "t") topView();
});
function projectLabel(element, worldPosition) {
const projected = worldPosition.clone().project(camera);
if (projected.z < -1 || projected.z > 1) {
element.style.display = "none";
return;
}
element.style.display = "";
element.style.left = `${(projected.x * 0.5 + 0.5) * window.innerWidth}px`;
element.style.top = `${(-projected.y * 0.5 + 0.5) * window.innerHeight}px`;
}
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
rebuildZones();
recomputeConflicts();
selectObject(objects.stroller);
const clock = new THREE.Clock();
function animate() {
requestAnimationFrame(animate);
const dt = Math.min(clock.getDelta(), 0.05);
updateCamera(dt);
objectLabels.forEach(({ element, root, localPosition }) => {
const world = root.localToWorld(localPosition.clone());
projectLabel(element, world);
});
conflictPins.forEach(({ element, anchor }) => {
projectLabel(element, anchor);
});
renderer.render(scene, camera);
}
animate();
</script>
</body>
</html>
```