Prompt specification
Build or customize the Three.js 3D scene "Superkilen public seating and paving sample" 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: Superkilen public seating and paving sample
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/superkilen-public-seating-and-paving-sample-x2821
Scene Description Prompt:
Create a standalone voxel Three.js scene as a small exhibit of Superkilen public space in Copenhagen. Show object 68 from the designers’ inventory, the documented round blue bench associated with Brussels (https://superflex.net/files/superkilen_objects_EN.pdf), alongside a separate sample of the Black Square dark paving with curving white lines based on the project photographs (https://js.big.dk/projects/superkilen-1621). Show the bench’s continuous circle, center opening, segmented seat and simple supports. The bench and the sample are displayed together as an exhibit, without claiming exact co-location in the park. Identify the chosen object in the scene and cite the project sources.
Return one complete HTML document. Use procedural geometry and the cdnjs Three.js r160 module; runtime network requests, native form submissions and pointer lock are unavailable in the gallery.
Working Three.js Starter (superkilen-public-seating-and-paving-sample-x2821):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="description" content="A standalone voxel-style Three.js exhibit of Superkilen Object 68 and a separate interpretive study of the Black Square paving.">
<title>Superkilen — Object 68 & Black Square Study</title>
<style>
:root {
color-scheme: light;
--ink: #17212a;
--muted: #5d6468;
--paper: #f3efe6;
--blue: #075fa8;
--line: rgba(23, 33, 42, 0.17);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #d7d0c5;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#stage,
#stage canvas {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
}
#stage canvas {
display: block;
touch-action: none;
outline: none;
}
.masthead {
position: fixed;
z-index: 5;
top: clamp(18px, 3vw, 38px);
left: clamp(18px, 3vw, 42px);
max-width: min(540px, calc(100vw - 420px));
pointer-events: none;
text-shadow: 0 1px 12px rgba(247, 242, 231, 0.5);
}
.eyebrow,
.panel-label,
.source-label,
.pin,
.plaque-kicker {
font-size: 10px;
font-weight: 750;
letter-spacing: 0.18em;
text-transform: uppercase;
}
.eyebrow {
display: inline-flex;
align-items: center;
gap: 9px;
color: var(--blue);
}
.eyebrow::before {
content: "";
width: 28px;
height: 2px;
background: var(--blue);
}
h1 {
margin: 9px 0 7px;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(30px, 4.2vw, 62px);
font-weight: 500;
line-height: 0.98;
letter-spacing: -0.035em;
}
.masthead p {
max-width: 470px;
margin: 0;
color: #485158;
font-size: 13px;
line-height: 1.45;
}
.source-panel {
position: fixed;
z-index: 6;
top: clamp(16px, 2.5vw, 34px);
right: clamp(16px, 2.5vw, 34px);
width: min(350px, calc(100vw - 32px));
padding: 20px 21px 18px;
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: 4px;
background: rgba(247, 243, 234, 0.89);
box-shadow: 0 18px 50px rgba(37, 38, 35, 0.13);
backdrop-filter: blur(12px);
}
.selected-object {
display: grid;
grid-template-columns: 62px 1fr;
gap: 15px;
align-items: start;
}
.object-number {
display: grid;
place-items: center;
width: 62px;
height: 62px;
border-radius: 50%;
background: var(--blue);
color: white;
font-family: Georgia, "Times New Roman", serif;
font-size: 31px;
line-height: 1;
}
.panel-label {
display: block;
margin: 2px 0 4px;
color: var(--blue);
}
.source-panel h2 {
margin: 0 0 6px;
font-family: Georgia, "Times New Roman", serif;
font-size: 23px;
font-weight: 600;
line-height: 1.05;
}
.source-panel p {
margin: 0;
color: #4b555c;
font-size: 11.5px;
line-height: 1.5;
}
.paired-study {
margin-top: 16px;
padding-top: 14px;
border-top: 1px solid var(--line);
}
.paired-study strong {
display: block;
margin-top: 4px;
font-family: Georgia, "Times New Roman", serif;
font-size: 16px;
font-weight: 600;
}
.curatorial-note {
margin-top: 14px;
padding: 10px 11px;
border-left: 3px solid var(--blue);
background: rgba(7, 95, 168, 0.065);
color: #465158;
font-size: 10.5px;
line-height: 1.45;
}
.sources {
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid var(--line);
}
.source-label {
display: block;
margin-bottom: 7px;
color: #747a7d;
}
.sources a {
display: block;
margin: 5px 0;
color: #263844;
font-size: 10.5px;
line-height: 1.35;
text-decoration-color: rgba(7, 95, 168, 0.45);
text-underline-offset: 3px;
}
.sources a:hover {
color: var(--blue);
}
.pin {
position: fixed;
z-index: 4;
left: 0;
top: 0;
padding: 7px 9px;
border: 1px solid rgba(255, 255, 255, 0.75);
border-radius: 2px;
background: rgba(19, 38, 51, 0.84);
color: white;
box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
pointer-events: none;
transform: translate(-50%, -100%);
white-space: nowrap;
}
.pin::after {
content: "";
position: absolute;
left: 50%;
top: 100%;
width: 1px;
height: 19px;
background: rgba(19, 38, 51, 0.65);
}
#pin-bench {
border-color: rgba(7, 95, 168, 0.7);
background: rgba(7, 95, 168, 0.9);
}
.bottom-bar {
position: fixed;
z-index: 5;
right: clamp(18px, 3vw, 42px);
bottom: clamp(18px, 3vw, 34px);
left: clamp(18px, 3vw, 42px);
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 16px;
pointer-events: none;
}
#hover-status {
max-width: 370px;
padding: 8px 11px;
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 2px;
background: rgba(247, 243, 234, 0.78);
color: #4b555c;
font-size: 10px;
letter-spacing: 0.07em;
text-transform: uppercase;
backdrop-filter: blur(8px);
}
.controls-hint {
display: flex;
align-items: center;
gap: 14px;
color: #596166;
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.controls-hint span {
white-space: nowrap;
}
button {
pointer-events: auto;
border: 1px solid rgba(23, 33, 42, 0.2);
border-radius: 2px;
padding: 8px 10px;
background: rgba(247, 243, 234, 0.8);
color: var(--ink);
font: inherit;
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
cursor: pointer;
backdrop-filter: blur(8px);
}
button:hover {
border-color: var(--blue);
color: var(--blue);
}
button:focus-visible,
a:focus-visible {
outline: 2px solid var(--blue);
outline-offset: 3px;
}
@media (max-width: 820px) {
.masthead {
max-width: calc(100vw - 36px);
}
.masthead p {
display: none;
}
.source-panel {
top: auto;
right: 12px;
bottom: 66px;
width: min(330px, calc(100vw - 24px));
padding: 14px;
}
.source-panel p,
.paired-study,
.curatorial-note {
display: none;
}
.source-panel h2 {
font-size: 19px;
}
.selected-object {
grid-template-columns: 48px 1fr;
gap: 11px;
}
.object-number {
width: 48px;
height: 48px;
font-size: 25px;
}
.sources {
margin-top: 10px;
padding-top: 9px;
}
.pin {
display: none;
}
.bottom-bar {
bottom: 14px;
}
#hover-status {
display: none;
}
}
@media (max-height: 620px) and (min-width: 821px) {
.source-panel {
padding: 13px 15px;
}
.source-panel p,
.curatorial-note {
display: none;
}
.paired-study,
.sources {
margin-top: 9px;
padding-top: 9px;
}
}
</style>
</head>
<body>
<main id="stage" aria-label="Interactive three-dimensional exhibit of Superkilen Object 68 and a Black Square paving study"></main>
<header class="masthead">
<div class="eyebrow">Copenhagen · Public Space Archive</div>
<h1>Superkilen,<br>in references</h1>
<p>Two spatial fragments staged together as a small interpretive exhibit.</p>
</header>
<aside class="source-panel" aria-label="Object identification and sources">
<div class="selected-object">
<div class="object-number" aria-hidden="true">68</div>
<div>
<span class="panel-label">Selected object</span>
<h2>Round blue bench</h2>
<p>
The Brussels-associated bench from the designers’ inventory, modeled with a
continuous annular seat, an open center, visible radial segmentation and
simple block supports.
</p>
</div>
</div>
<div class="paired-study">
<span class="panel-label">Separate material study</span>
<strong>Black Square · dark paving with curving white lines</strong>
</div>
<div class="curatorial-note">
Curatorial display only. The bench and paving sample are shown together for
comparison and do <strong>not</strong> imply exact co-location in the park.
</div>
<div class="sources">
<span class="source-label">Project sources</span>
<a href="https://superflex.net/files/superkilen_objects_EN.pdf" target="_blank" rel="noopener noreferrer">
Superflex, <em>Superkilen Objects</em> inventory — Object 68
</a>
<a href="https://js.big.dk/projects/superkilen-1621" target="_blank" rel="noopener noreferrer">
BIG, <em>Superkilen</em> project page and photographic archive
</a>
</div>
</aside>
<div id="pin-bench" class="pin">Object 68 · Brussels round bench</div>
<div id="pin-paving" class="pin">Black Square · paving study</div>
<footer class="bottom-bar">
<div id="hover-status">Object 68 selected · interpretive exhibit, not a site reconstruction</div>
<div class="controls-hint">
<span>Drag to orbit · scroll to zoom</span>
<button id="reset-view" type="button">Reset view</button>
</div>
</footer>
<noscript>This exhibit requires JavaScript.</noscript>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const stage = document.getElementById("stage");
const pinBench = document.getElementById("pin-bench");
const pinPaving = document.getElementById("pin-paving");
const hoverStatus = document.getElementById("hover-status");
const resetButton = document.getElementById("reset-view");
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xd7d0c5);
scene.fog = new THREE.Fog(0xd7d0c5, 12, 24);
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: false,
powerPreference: "high-performance"
});
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.06;
renderer.domElement.setAttribute("aria-label", "Voxel-style model of a circular blue bench beside a square dark paving sample");
renderer.domElement.tabIndex = 0;
stage.appendChild(renderer.domElement);
const camera = new THREE.PerspectiveCamera(
38,
window.innerWidth / window.innerHeight,
0.1,
60
);
const orbit = {
target: new THREE.Vector3(0, 0.45, 0.05),
theta: 0.54,
phi: 1.03,
radius: 8.8,
desiredTheta: 0.54,
desiredPhi: 1.03,
desiredRadius: 8.8
};
function updateCamera(instant = false) {
if (instant) {
orbit.theta = orbit.desiredTheta;
orbit.phi = orbit.desiredPhi;
orbit.radius = orbit.desiredRadius;
}
orbit.theta += (orbit.desiredTheta - orbit.theta) * 0.09;
orbit.phi += (orbit.desiredPhi - orbit.phi) * 0.09;
orbit.radius += (orbit.desiredRadius - orbit.radius) * 0.09;
const sinPhi = Math.sin(orbit.phi);
camera.position.set(
orbit.target.x + orbit.radius * sinPhi * Math.sin(orbit.theta),
orbit.target.y + orbit.radius * Math.cos(orbit.phi),
orbit.target.z + orbit.radius * sinPhi * Math.cos(orbit.theta)
);
camera.lookAt(orbit.target);
}
updateCamera(true);
const hemisphere = new THREE.HemisphereLight(0xf7f1e5, 0x6e7880, 2.1);
scene.add(hemisphere);
const keyLight = new THREE.DirectionalLight(0xfff4df, 3.2);
keyLight.position.set(-3.5, 8, 5.5);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.near = 1;
keyLight.shadow.camera.far = 22;
keyLight.shadow.camera.left = -7;
keyLight.shadow.camera.right = 7;
keyLight.shadow.camera.top = 7;
keyLight.shadow.camera.bottom = -7;
keyLight.shadow.bias = -0.00035;
scene.add(keyLight);
const fillLight = new THREE.DirectionalLight(0xb8d6ef, 1.05);
fillLight.position.set(6, 4, -3);
scene.add(fillLight);
const rimLight = new THREE.DirectionalLight(0xffffff, 0.75);
rimLight.position.set(0, 3, -6);
scene.add(rimLight);
const floorMaterial = new THREE.MeshStandardMaterial({
color: 0xcfc8bd,
roughness: 0.94,
metalness: 0
});
const floor = new THREE.Mesh(new THREE.PlaneGeometry(40, 40), floorMaterial);
floor.rotation.x = -Math.PI / 2;
floor.receiveShadow = true;
scene.add(floor);
const wallMaterial = new THREE.MeshStandardMaterial({
color: 0xded8ce,
roughness: 1
});
const wall = new THREE.Mesh(new THREE.PlaneGeometry(30, 14), wallMaterial);
wall.position.set(0, 6.5, -7);
wall.receiveShadow = true;
scene.add(wall);
const plinthMaterial = new THREE.MeshStandardMaterial({
color: 0xe9e3d8,
roughness: 0.8
});
const darkBlueMaterial = new THREE.MeshStandardMaterial({
color: 0x123f62,
roughness: 0.66,
metalness: 0.03
});
const benchBlueA = new THREE.MeshStandardMaterial({
color: 0x075fa8,
roughness: 0.53,
metalness: 0.02
});
const benchBlueB = new THREE.MeshStandardMaterial({
color: 0x0868b3,
roughness: 0.56,
metalness: 0.02
});
const seamMaterial = new THREE.MeshBasicMaterial({
color: 0x073f70
});
const benchPickables = [];
const pavingPickables = [];
// --- Object 68: continuous, segmented blue annular bench ---
const benchRoot = new THREE.Group();
benchRoot.position.set(-1.55, 0, 0);
scene.add(benchRoot);
const benchPlinth = new THREE.Mesh(
new THREE.CylinderGeometry(1.58, 1.62, 0.1, 48),
plinthMaterial
);
benchPlinth.position.y = 0.05;
benchPlinth.castShadow = true;
benchPlinth.receiveShadow = true;
benchRoot.add(benchPlinth);
const selectionRing = new THREE.Mesh(
new THREE.RingGeometry(1.43, 1.47, 64),
new THREE.MeshBasicMaterial({
color: 0x2b84c4,
transparent: true,
opacity: 0.34,
side: THREE.DoubleSide
})
);
selectionRing.rotation.x = -Math.PI / 2;
selectionRing.position.y = 0.102;
benchRoot.add(selectionRing);
const seatGroup = new THREE.Group();
seatGroup.position.y = 0.5;
benchRoot.add(seatGroup);
const innerRadius = 0.70;
const outerRadius = 1.25;
const seatThickness = 0.16;
const segmentCount = 24;
function annularSectorGeometry(start, end) {
const shape = new THREE.Shape();
shape.moveTo(innerRadius * Math.cos(start), innerRadius * Math.sin(start));
shape.lineTo(outerRadius * Math.cos(start), outerRadius * Math.sin(start));
shape.absarc(0, 0, outerRadius, start, end, false);
shape.lineTo(innerRadius * Math.cos(end), innerRadius * Math.sin(end));
shape.absarc(0, 0, innerRadius, end, start, true);
shape.closePath();
const geometry = new THREE.ExtrudeGeometry(shape, {
depth: seatThickness,
bevelEnabled: false,
curveSegments: 2,
steps: 1
});
geometry.rotateX(Math.PI / 2);
geometry.translate(0, seatThickness / 2, 0);
geometry.computeVertexNormals();
return geometry;
}
for (let i = 0; i < segmentCount; i++) {
const start = (i / segmentCount) * Math.PI * 2;
const end = ((i + 1) / segmentCount) * Math.PI * 2;
const segment = new THREE.Mesh(
annularSectorGeometry(start, end),
i % 2 === 0 ? benchBlueA : benchBlueB
);
segment.castShadow = true;
segment.receiveShadow = true;
segment.userData.label = "Object 68 · Brussels round blue bench";
seatGroup.add(segment);
benchPickables.push(segment);
// A very fine top seam makes the radial seat modules legible while
// the adjoining modules retain an unbroken circular silhouette.
const seam = new THREE.Mesh(
new THREE.BoxGeometry(0.008, 0.005, outerRadius - innerRadius - 0.015),
seamMaterial
);
const seamAngle = start;
const seamRadius = (innerRadius + outerRadius) / 2;
seam.position.set(
seamRadius * Math.cos(seamAngle),
seatThickness / 2 + 0.003,
seamRadius * Math.sin(seamAngle)
);
seam.rotation.y = Math.PI / 2 - seamAngle;
seatGroup.add(seam);
}
// Eight simple, block-like supports under the ring.
const supportGeometry = new THREE.BoxGeometry(0.18, 0.32, 0.18);
for (let i = 0; i < 8; i++) {
const angle = (i / 8) * Math.PI * 2 + Math.PI / 8;
const support = new THREE.Mesh(supportGeometry, darkBlueMaterial);
support.position.set(
0.98 * Math.cos(angle),
0.26,
0.98 * Math.sin(angle)
);
support.rotation.y = -angle;
support.castShadow = true;
support.receiveShadow = true;
support.userData.label = "Object 68 · block support";
benchRoot.add(support);
benchPickables.push(support);
}
// --- Separate interpretive Black Square paving sample ---
const pavingRoot = new THREE.Group();
pavingRoot.position.set(1.7, 0, 0.15);
scene.add(pavingRoot);
const pavingPlinth = new THREE.Mesh(
new THREE.BoxGeometry(2.62, 0.08, 2.62),
plinthMaterial
);
pavingPlinth.position.y = 0.04;
pavingPlinth.castShadow = true;
pavingPlinth.receiveShadow = true;
pavingRoot.add(pavingPlinth);
const darkPavingMaterial = new THREE.MeshStandardMaterial({
color: 0x10151a,
roughness: 0.94,
metalness: 0.02
});
const darkPaving = new THREE.Mesh(
new THREE.BoxGeometry(2.25, 0.1, 2.25),
darkPavingMaterial
);
darkPaving.position.y = 0.13;
darkPaving.castShadow = true;
darkPaving.receiveShadow = true;
darkPaving.userData.label = "Black Square · separate paving study";
pavingRoot.add(darkPaving);
pavingPickables.push(darkPaving);
// Subtle paving joints, kept much quieter than the painted white curves.
const jointMaterial = new THREE.LineBasicMaterial({
color: 0x657078,
transparent: true,
opacity: 0.13
});
const jointPoints = [];
for (let i = -2; i <= 2; i++) {
const p = i * 0.45;
jointPoints.push(
new THREE.Vector3(p, 0.182, -1.125),
new THREE.Vector3(p, 0.182, 1.125),
new THREE.Vector3(-1.125, 0.182, p),
new THREE.Vector3(1.125, 0.182, p)
);
}
const joints = new THREE.LineSegments(
new THREE.BufferGeometry().setFromPoints(jointPoints),
jointMaterial
);
pavingRoot.add(joints);
function ribbonGeometry(curve, width, segments = 70) {
const positions = [];
const indices = [];
const point = new THREE.Vector3();
const tangent = new THREE.Vector3();
const side = new THREE.Vector3();
for (let i = 0; i <= segments; i++) {
const t = i / segments;
curve.getPoint(t, point);
curve.getTangent(t, tangent);
tangent.y = 0;
tangent.normalize();
side.set(-tangent.z, 0, tangent.x).multiplyScalar(width / 2);
positions.push(
point.x + side.x, point.y, point.z + side.z,
point.x - side.x, point.y, point.z - side.z
);
if (i < segments) {
const a = i * 2;
indices.push(a, a + 1, a + 2, a + 1, a + 3, a + 2);
}
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
geometry.setIndex(indices);
geometry.computeVertexNormals();
return geometry;
}
const whiteLineMaterial = new THREE.MeshStandardMaterial({
color: 0xf0eee7,
roughness: 0.82,
metalness: 0,
side: THREE.DoubleSide
});
// The curves are deliberately presented as an interpretive sample based
// on the project's photographic references, not as surveyed park geometry.
const curveDefinitions = [
[
[-1.04, -0.80], [-0.76, -0.50], [-0.82, -0.05],
[-0.38, 0.34], [-0.10, 0.76], [-0.03, 1.05]
],
[
[-0.62, -1.06], [-0.40, -0.73], [-0.12, -0.60],
[0.18, -0.25], [0.20, 0.18], [0.66, 0.38], [0.76, 0.86]
],
[
[0.16, -1.07], [0.48, -0.76], [0.42, -0.29],
[0.62, 0.04], [0.94, 0.24], [1.04, 0.72]
],
[
[-1.04, -0.24], [-0.64, -0.08], [-0.15, -0.18],
[0.22, 0.12], [0.40, 0.63], [0.26, 1.05]
]
];
for (const definition of curveDefinitions) {
const points = definition.map(([x, z]) => new THREE.Vector3(x, 0.185, z));
const curve = new THREE.CatmullRomCurve3(points, false, "centripetal", 0.45);
const line = new THREE.Mesh(ribbonGeometry(curve, 0.042), whiteLineMaterial);
line.receiveShadow = true;
pavingRoot.add(line);
}
// --- Procedural exhibit placards ---
function wrapText(context, text, maxWidth) {
const words = text.split(" ");
const lines = [];
let line = "";
for (const word of words) {
const test = line ? `${line} ${word}` : word;
if (context.measureText(test).width > maxWidth && line) {
lines.push(line);
line = word;
} else {
line = test;
}
}
if (line) lines.push(line);
return lines;
}
function createPlaqueTexture(kicker, title, body, accent) {
const canvas = document.createElement("canvas");
canvas.width = 1200;
canvas.height = 600;
const context = canvas.getContext("2d");
context.fillStyle = "#f3efe6";
context.fillRect(0, 0, canvas.width, canvas.height);
context.fillStyle = accent;
context.fillRect(0, 0, 28, canvas.height);
context.strokeStyle = "rgba(23,33,42,0.16)";
context.lineWidth = 4;
context.strokeRect(2, 2, canvas.width - 4, canvas.height - 4);
context.fillStyle = accent;
context.font = "700 32px Arial, sans-serif";
context.letterSpacing = "5px";
context.fillText(kicker.toUpperCase(), 82, 92);
context.fillStyle = "#17212a";
context.font = "600 66px Georgia, serif";
context.fillText(title, 80, 190);
context.fillStyle = "#566067";
context.font = "400 31px Arial, sans-serif";
context.letterSpacing = "0px";
const lines = wrapText(context, body, 1000);
lines.forEach((line, index) => {
context.fillText(line, 82, 272 + index * 43);
});
context.fillStyle = "#8b8d8d";
context.font = "600 22px Arial, sans-serif";
context.fillText("INTERPRETIVE EXHIBIT · NOT A SITE RECONSTRUCTION", 82, 535);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = Math.min(8, renderer.capabilities.getMaxAnisotropy());
return texture;
}
const plaqueData = [];
function createPlaque(x, z, kicker, title, body, accent) {
const root = new THREE.Group();
root.position.set(x, 0, z);
scene.add(root);
const panelPivot = new THREE.Group();
panelPivot.position.y = 0.94;
root.add(panelPivot);
const texture = createPlaqueTexture(kicker, title, body, accent);
const panel = new THREE.Mesh(
new THREE.PlaneGeometry(1.72, 0.86),
new THREE.MeshStandardMaterial({
map: texture,
roughness: 0.9,
side: THREE.DoubleSide
})
);
panel.castShadow = true;
panelPivot.add(panel);
const postMaterial = new THREE.MeshStandardMaterial({
color: 0x35434b,
roughness: 0.7,
metalness: 0.08
});
const postGeometry = new THREE.BoxGeometry(0.055, 0.72, 0.055);
for (const offset of [-0.58, 0.58]) {
const post = new THREE.Mesh(postGeometry, postMaterial);
post.position.set(offset, 0.42, 0);
post.castShadow = true;
root.add(post);
}
const foot = new THREE.Mesh(
new THREE.BoxGeometry(1.34, 0.045, 0.18),
postMaterial
);
foot.position.y = 0.075;
foot.castShadow = true;
root.add(foot);
plaqueData.push({ root, panelPivot });
}
createPlaque(
-3.25,
0.62,
"Object 68",
"Round blue bench",
"Brussels reference · continuous ring · open center · segmented seat · simple supports",
"#075fa8"
);
createPlaque(
3.38,
0.58,
"Paving study",
"Black Square",
"Separate dark paving sample with curving white lines, based on project photographs.",
"#27323a"
);
// --- Direct camera controls: no addons and no pointer lock ---
let dragging = false;
let activePointer = null;
let previousX = 0;
let previousY = 0;
let moved = false;
renderer.domElement.addEventListener("pointerdown", (event) => {
if (activePointer !== null) return;
activePointer = event.pointerId;
dragging = true;
moved = false;
previousX = event.clientX;
previousY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
renderer.domElement.style.cursor = "grabbing";
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (dragging && event.pointerId === activePointer) {
const dx = event.clientX - previousX;
const dy = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
if (Math.abs(dx) + Math.abs(dy) > 1) moved = true;
orbit.desiredTheta -= dx * 0.006;
orbit.desiredPhi = THREE.MathUtils.clamp(
orbit.desiredPhi - dy * 0.005,
0.52,
1.43
);
return;
}
updateHover(event);
});
function endDrag(event) {
if (event.pointerId !== activePointer) return;
dragging = false;
activePointer = null;
renderer.domElement.style.cursor = "";
}
renderer.domElement.addEventListener("pointerup", endDrag);
renderer.domElement.addEventListener("pointercancel", endDrag);
renderer.domElement.addEventListener("lostpointercapture", endDrag);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
orbit.desiredRadius = THREE.MathUtils.clamp(
orbit.desiredRadius * Math.exp(event.deltaY * 0.001),
5.4,
13.5
);
},
{ passive: false }
);
function resetView() {
orbit.desiredTheta = 0.54;
orbit.desiredPhi = 1.03;
orbit.desiredRadius = 8.8;
}
resetButton.addEventListener("click", resetView);
renderer.domElement.addEventListener("dblclick", resetView);
// --- Lightweight object identification ---
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function updateHover(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);
const benchHits = raycaster.intersectObjects(benchPickables, false);
const pavingHits = raycaster.intersectObjects(pavingPickables, false);
if (benchHits.length) {
hoverStatus.textContent = "Object 68 · Brussels-associated round blue bench";
renderer.domElement.style.cursor = "pointer";
} else if (pavingHits.length) {
hoverStatus.textContent = "Separate study · Black Square dark paving and curving white lines";
renderer.domElement.style.cursor = "pointer";
} else {
hoverStatus.textContent = "Object 68 selected · interpretive exhibit, not a site reconstruction";
renderer.domElement.style.cursor = "";
}
}
// --- Projected scene labels ---
const projected = new THREE.Vector3();
function placePin(element, worldPosition) {
projected.copy(worldPosition).project(camera);
const visible = projected.z > -1 && projected.z < 1;
element.style.display = visible ? "block" : "none";
if (!visible) return;
const x = (projected.x * 0.5 + 0.5) * window.innerWidth;
const y = (-projected.y * 0.5 + 0.5) * window.innerHeight;
element.style.left = `${x}px`;
element.style.top = `${y}px`;
}
const benchPinPosition = new THREE.Vector3(-1.55, 1.18, 0);
const pavingPinPosition = new THREE.Vector3(1.7, 0.74, 0.15);
function updatePlaqueFacing() {
for (const plaque of plaqueData) {
const dx = camera.position.x - plaque.root.position.x;
const dz = camera.position.z - plaque.root.position.z;
plaque.panelPivot.rotation.y = Math.atan2(dx, dz);
}
}
function resize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
}
window.addEventListener("resize", resize);
function animate() {
requestAnimationFrame(animate);
updateCamera();
updatePlaqueFacing();
renderer.render(scene, camera);
placePin(pinBench, benchPinPosition);
placePin(pinPaving, pavingPinPosition);
}
animate();
</script>
</body>
</html>
```