Prompt specification
Build or customize the Three.js 3D scene "Brasília at inauguration and construction workers in Candangolândia" 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: Brasília at inauguration and construction workers in Candangolândia
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/bras-lia-at-inauguration-and-construction-workers-in-c-x2423
Scene Description Prompt:
Create a self-contained voxel Three.js teaching scene comparing a Brasília civic space around its 1960 inauguration with an illustrative workers’ living context anchored in the documented NOVACAP camp associated with Candangolândia. Cite the UNESCO Brasília record (https://whc.unesco.org/en/list/445/) for the administrative landscape and the IPHAN Roteiro dos acampamentos pioneiros (https://portal.iphan.gov.br/uploads/publicacao/roteiro_dos_acampamentos_pioneiros_no_distrito_federal.pdf) for the camp. Make the civic and household settings two distinct labeled dioramas. Show varied everyday activity in the camp and identify what is an illustrative reconstruction. Avoid unsupported settlement names, ceremony schedules, demographic specifics and implying a single experience among workers.
Return one complete HTML document, with inline code, procedural meshes, and only the cdnjs Three.js r160 module.
Working Three.js Starter (bras-lia-at-inauguration-and-construction-workers-in-c-x2423):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#0b1220">
<title>Brasília 1960 and an Illustrative NOVACAP Camp — Voxel Comparison</title>
<style>
:root {
color-scheme: dark;
--ink: #f5f7fb;
--muted: #bdc7d8;
--panel: rgba(12, 20, 34, 0.9);
--line: rgba(255, 255, 255, 0.14);
--civic: #79c7e8;
--camp: #f0a45d;
--document: #a9e6bf;
--interpret: #ffd18a;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #0b1220;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button,
a {
font: inherit;
}
button {
color: inherit;
}
#app,
#stage {
position: absolute;
inset: 0;
}
#stage {
overflow: hidden;
}
canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
canvas:focus-visible {
outline: 2px solid var(--civic);
outline-offset: -3px;
}
.overlay {
position: absolute;
inset: 0;
pointer-events: none;
}
.title-block {
position: absolute;
top: 18px;
left: 18px;
width: min(430px, calc(100vw - 36px));
padding: 16px 18px;
border: 1px solid var(--line);
border-radius: 16px;
background: linear-gradient(135deg, rgba(10, 17, 29, 0.94), rgba(10, 17, 29, 0.76));
box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
backdrop-filter: blur(12px);
}
.eyebrow {
margin: 0 0 6px;
color: var(--civic);
font-size: 0.69rem;
font-weight: 800;
letter-spacing: 0.16em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: clamp(1.25rem, 2.4vw, 2rem);
line-height: 1.06;
letter-spacing: -0.035em;
}
.subtitle {
margin: 8px 0 0;
max-width: 390px;
color: var(--muted);
font-size: 0.84rem;
line-height: 1.45;
}
.controls {
position: absolute;
top: 18px;
left: 50%;
display: flex;
gap: 6px;
padding: 6px;
transform: translateX(-50%);
border: 1px solid var(--line);
border-radius: 13px;
background: rgba(10, 17, 29, 0.88);
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
backdrop-filter: blur(12px);
pointer-events: auto;
}
.controls button {
min-width: 74px;
padding: 8px 11px;
border: 0;
border-radius: 9px;
background: transparent;
color: var(--muted);
font-size: 0.76rem;
font-weight: 750;
cursor: pointer;
transition: background 160ms ease, color 160ms ease;
}
.controls button:hover,
.controls button:focus-visible {
background: rgba(255, 255, 255, 0.08);
color: white;
outline: none;
}
.controls button.active {
background: #e9f2fb;
color: #142033;
}
.controls .separator {
width: 1px;
margin: 5px 2px;
background: var(--line);
}
.diorama-label {
position: absolute;
min-width: 250px;
max-width: 330px;
padding: 11px 13px;
transform: translate(-50%, -100%);
border: 1px solid var(--line);
border-top: 3px solid var(--civic);
border-radius: 12px;
background: rgba(10, 17, 29, 0.9);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
backdrop-filter: blur(10px);
transition: opacity 120ms ease;
}
.diorama-label.camp {
border-top-color: var(--camp);
}
.diorama-label strong {
display: block;
font-size: 0.78rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.diorama-label span {
display: block;
margin-top: 4px;
color: var(--muted);
font-size: 0.72rem;
line-height: 1.35;
}
.diorama-label em {
color: var(--interpret);
font-style: normal;
}
.legend {
position: absolute;
bottom: 18px;
left: 18px;
display: flex;
flex-wrap: wrap;
gap: 8px 14px;
max-width: min(600px, calc(100vw - 36px));
padding: 11px 13px;
border: 1px solid var(--line);
border-radius: 13px;
background: rgba(10, 17, 29, 0.88);
color: var(--muted);
font-size: 0.71rem;
line-height: 1.25;
backdrop-filter: blur(10px);
}
.legend-item {
display: flex;
align-items: center;
gap: 7px;
}
.swatch {
width: 10px;
height: 10px;
flex: 0 0 auto;
border-radius: 2px;
}
.swatch.document {
background: var(--document);
}
.swatch.interpret {
background: var(--interpret);
}
.swatch.civic {
background: var(--civic);
}
.swatch.camp {
background: var(--camp);
}
.notes-panel {
position: absolute;
top: 82px;
right: 18px;
width: min(355px, calc(100vw - 36px));
max-height: calc(100vh - 104px);
overflow: auto;
padding: 17px;
border: 1px solid var(--line);
border-radius: 16px;
background: rgba(10, 17, 29, 0.93);
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(14px);
pointer-events: auto;
scrollbar-width: thin;
}
.notes-panel.hidden {
display: none;
}
.notes-panel h2 {
margin: 0 0 10px;
font-size: 1rem;
letter-spacing: -0.015em;
}
.notes-panel h3 {
margin: 15px 0 5px;
color: var(--civic);
font-size: 0.72rem;
letter-spacing: 0.11em;
text-transform: uppercase;
}
.notes-panel h3.camp {
color: var(--camp);
}
.notes-panel p {
margin: 7px 0;
color: #d6deea;
font-size: 0.78rem;
line-height: 1.5;
}
.notice {
margin-top: 13px;
padding: 10px 11px;
border: 1px solid rgba(255, 209, 138, 0.38);
border-radius: 10px;
background: rgba(255, 209, 138, 0.08);
color: #ffe2ae;
font-size: 0.74rem;
line-height: 1.45;
}
.sources {
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid var(--line);
}
.sources ol {
margin: 0;
padding-left: 19px;
}
.sources li {
margin: 7px 0;
color: var(--muted);
font-size: 0.72rem;
line-height: 1.45;
}
.sources a {
color: #b9ddff;
text-decoration-color: rgba(185, 221, 255, 0.45);
text-underline-offset: 2px;
}
.sources a:hover {
text-decoration-color: currentColor;
}
.interaction-note {
position: absolute;
right: 18px;
bottom: 18px;
padding: 8px 11px;
border: 1px solid var(--line);
border-radius: 10px;
background: rgba(10, 17, 29, 0.78);
color: var(--muted);
font-size: 0.68rem;
backdrop-filter: blur(8px);
}
.loading {
position: absolute;
inset: 0;
display: grid;
place-items: center;
background: #0b1220;
color: var(--muted);
font-size: 0.82rem;
letter-spacing: 0.08em;
text-transform: uppercase;
transition: opacity 300ms ease;
}
.loading.done {
opacity: 0;
pointer-events: none;
}
@media (max-width: 900px) {
.controls {
top: auto;
bottom: 62px;
}
.notes-panel {
top: 142px;
max-height: calc(100vh - 220px);
}
.legend {
bottom: 12px;
left: 12px;
max-width: calc(100vw - 24px);
}
.interaction-note {
display: none;
}
.title-block {
top: 12px;
left: 12px;
width: calc(100vw - 24px);
}
.diorama-label {
min-width: 190px;
max-width: 230px;
padding: 8px 10px;
}
.diorama-label span {
font-size: 0.64rem;
}
}
@media (max-width: 560px) {
.subtitle {
font-size: 0.75rem;
}
.controls {
width: calc(100vw - 24px);
justify-content: center;
overflow-x: auto;
}
.controls button {
min-width: 62px;
padding: 7px 8px;
font-size: 0.68rem;
}
.legend {
display: none;
}
.notes-panel {
top: 132px;
right: 12px;
width: calc(100vw - 24px);
max-height: calc(100vh - 205px);
}
.diorama-label {
min-width: 160px;
max-width: 180px;
}
.diorama-label strong {
font-size: 0.65rem;
}
}
@media (prefers-reduced-motion: reduce) {
* {
scroll-behavior: auto !important;
transition: none !important;
}
}
</style>
</head>
<body>
<main id="app">
<div id="stage">
<div id="loading" class="loading">Building the voxel comparison…</div>
<div class="overlay">
<header class="title-block">
<p class="eyebrow">Spatial history · comparative teaching scene</p>
<h1>Brasília 1960 / NOVACAP camp</h1>
<p class="subtitle">
A civic-plan reading beside an illustrative workers’ living context.
The two dioramas deliberately distinguish documentary anchors from reconstructed everyday life.
</p>
</header>
<nav class="controls" aria-label="Camera and information controls">
<button type="button" data-view="both" class="active">Both</button>
<button type="button" data-view="civic">Civic</button>
<button type="button" data-view="camp">Camp</button>
<span class="separator" aria-hidden="true"></span>
<button type="button" id="zoom-in" aria-label="Zoom in">+</button>
<button type="button" id="zoom-out" aria-label="Zoom out">−</button>
<button type="button" id="notes-toggle" aria-expanded="true">Notes</button>
</nav>
<div id="civic-label" class="diorama-label civic">
<strong>Civic Brasília · 1960</strong>
<span>Representative civic massing and a schematic administrative landscape. <em>Not a ceremony reconstruction.</em></span>
</div>
<div id="camp-label" class="diorama-label camp">
<strong>NOVACAP camp · Candangolândia</strong>
<span>Documented association; housing, services and daily routines here are <em>illustrative reconstruction</em>.</span>
</div>
<div class="legend" aria-label="Scene legend">
<span class="legend-item"><i class="swatch document"></i>Documentary anchor</span>
<span class="legend-item"><i class="swatch interpret"></i>Interpretive layer</span>
<span class="legend-item"><i class="swatch civic"></i>Civic diorama</span>
<span class="legend-item"><i class="swatch camp"></i>Camp diorama</span>
</div>
<aside id="notes-panel" class="notes-panel" aria-label="Interpretation notes and sources">
<h2>How to read the comparison</h2>
<h3>1 · Civic landscape</h3>
<p>
The UNESCO record presents Brasília as a deliberately planned capital organized around a
monumental axis, with civic and administrative functions distinguished from residential
sectors. The National Congress and Cathedral act as recognizable anchors in this teaching
model; the remaining massing is schematic rather than survey-level.
</p>
<p>
This diorama explains spatial relationships around the inauguration-era city. It does not
reconstruct an event, prescribe a ceremony schedule, or claim to show every completed
building in 1960.
</p>
<h3 class="camp">2 · Camp context</h3>
<p>
IPHAN’s <em>Roteiro dos acampamentos pioneiros no Distrito Federal</em> is the documentary
anchor for the NOVACAP camp associated with Candangolândia. The barracks-like housing,
shared service points, open yards, and visible routines are a synthesized illustration
of a workers’ living context.
</p>
<p>
These everyday scenes—cooking, queuing, washing, mending, walking, resting and play—are
interpretive examples, not evidence of an exact camp footprint, a complete activity
schedule, or any single resident’s experience.
</p>
<div class="notice">
<strong>Illustrative reconstruction.</strong> No exact room arrangement, population profile,
demographic breakdown, settlement name beyond the cited Candangolândia association, or
ceremony chronology is asserted.
</div>
<div class="sources">
<h3>Sources</h3>
<ol>
<li>
UNESCO World Heritage Centre,
<a href="https://whc.unesco.org/en/list/445/" target="_blank" rel="noopener noreferrer">
“Brasília” (World Heritage List, no. 445)
</a>.
Documentary anchor for the city’s planned administrative and spatial organization.
</li>
<li>
IPHAN,
<a href="https://portal.iphan.gov.br/uploads/publicacao/roteiro_dos_acampamentos_pioneiros_no_distrito_federal.pdf"
target="_blank" rel="noopener noreferrer">
<em>Roteiro dos acampamentos pioneiros no Distrito Federal</em>
</a>.
Documentary anchor for the pioneer-camp network and the NOVACAP camp associated with
Candangolândia.
</li>
</ol>
</div>
</aside>
<div class="interaction-note">Drag to orbit · wheel to zoom · arrow keys to look · 0 resets</div>
</div>
</div>
</main>
<noscript>This teaching scene requires JavaScript and WebGL.</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 loading = document.getElementById("loading");
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0b1220);
scene.fog = new THREE.Fog(0x0b1220, 115, 205);
const camera = new THREE.PerspectiveCamera(
38,
stage.clientWidth / stage.clientHeight,
0.1,
350
);
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(stage.clientWidth, stage.clientHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.15;
renderer.domElement.tabIndex = 0;
renderer.domElement.setAttribute(
"aria-label",
"Interactive voxel comparison of inauguration-era civic Brasília and an illustrative NOVACAP camp"
);
stage.prepend(renderer.domElement);
const ambient = new THREE.HemisphereLight(0xb9d7ff, 0x51412f, 2.25);
scene.add(ambient);
const sun = new THREE.DirectionalLight(0xfff2d8, 3.25);
sun.position.set(-42, 78, 48);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -90;
sun.shadow.camera.right = 90;
sun.shadow.camera.top = 70;
sun.shadow.camera.bottom = -70;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 190;
sun.shadow.bias = -0.00035;
sun.shadow.normalBias = 0.025;
scene.add(sun);
const rim = new THREE.DirectionalLight(0x7abfff, 1.1);
rim.position.set(65, 32, -55);
scene.add(rim);
const unitBox = new THREE.BoxGeometry(1, 1, 1);
const materialCache = new Map();
function material(color) {
if (!materialCache.has(color)) {
materialCache.set(
color,
new THREE.MeshStandardMaterial({
color,
roughness: 0.82,
metalness: 0.03
})
);
}
return materialCache.get(color);
}
const glassMaterial = new THREE.MeshStandardMaterial({
color: 0x587f91,
roughness: 0.28,
metalness: 0.18,
transparent: true,
opacity: 0.88
});
const darkGlassMaterial = new THREE.MeshStandardMaterial({
color: 0x274d61,
roughness: 0.22,
metalness: 0.22
});
function box(parent, width, height, depth, x, y, z, color, castShadow = true) {
const mesh = new THREE.Mesh(
unitBox,
color && color.isMaterial ? color : material(color)
);
mesh.scale.set(width, height, depth);
mesh.position.set(x, y, z);
mesh.castShadow = castShadow && height > 0.28;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function group(parent, x = 0, y = 0, z = 0) {
const g = new THREE.Group();
g.position.set(x, y, z);
parent.add(g);
return g;
}
function addTree(parent, x, z, scale = 1, green = 0x507a45) {
const g = group(parent, x, 0.07, z);
g.scale.setScalar(scale);
box(g, 0.48, 2.6, 0.48, 0, 1.3, 0, 0x70543b);
box(g, 2.7, 1.45, 2.5, 0, 3.05, 0, green);
box(g, 2.1, 1.15, 2.0, 0.35, 3.8, -0.2, green);
box(g, 1.65, 0.85, 1.7, -0.45, 3.65, 0.35, 0x648c50);
return g;
}
function addBush(parent, x, z, scale = 1, color = 0x577647) {
box(parent, 1.4 * scale, 0.75 * scale, 1.2 * scale,
x, 0.37 * scale, z, color);
box(parent, 0.9 * scale, 0.55 * scale, 1.0 * scale,
x + 0.38 * scale, 0.75 * scale, z + 0.08, color);
}
const actors = [];
function addPerson(
parent,
x,
z,
shirt,
options = {}
) {
const {
skin = 0xb87955,
activity = "idle",
phase = 0,
scale = 1,
rotation = 0,
path = 0,
trouser = 0x344354
} = options;
const root = new THREE.Group();
root.position.set(x, 0.09, z);
root.rotation.y = rotation;
root.scale.setScalar(scale);
parent.add(root);
box(root, 0.58, 0.72, 0.36, 0, 1.27, 0, shirt);
box(root, 0.5, 0.2, 0.33, 0, 0.84, 0, trouser);
box(root, 0.17, 0.17, 0.17, 0, 1.69, 0, skin);
box(root, 0.43, 0.43, 0.43, 0, 1.98, 0, skin);
box(root, 0.45, 0.13, 0.45, 0, 2.19, 0, 0x2c2522);
const legs = [];
const arms = [];
for (const side of [-1, 1]) {
const legPivot = new THREE.Group();
legPivot.position.set(side * 0.17, 0.84, 0);
root.add(legPivot);
box(legPivot, 0.22, 0.7, 0.24, 0, -0.35, 0, trouser);
box(legPivot, 0.25, 0.14, 0.4, 0, -0.72, 0.07, 0x24272c, false);
legs.push(legPivot);
const armPivot = new THREE.Group();
armPivot.position.set(side * 0.4, 1.56, 0);
armPivot.rotation.z = side * 0.1;
root.add(armPivot);
box(armPivot, 0.19, 0.61, 0.21, 0, -0.28, 0, shirt);
box(armPivot, 0.2, 0.16, 0.21, 0, -0.65, 0, skin, false);
arms.push(armPivot);
}
if (activity === "carry") {
arms[0].rotation.x = -1.12;
arms[1].rotation.x = -1.12;
box(root, 0.52, 0.34, 0.38, 0, 1.85, 0.28, 0xc08b50);
}
if (activity === "wash") {
arms[0].rotation.x = -1.25;
arms[1].rotation.x = -0.85;
}
if (activity === "cook" || activity === "repair") {
arms[1].rotation.x = -1.35;
}
if (activity === "sit") {
root.position.y = -0.1;
legs[0].rotation.x = -1.35;
legs[1].rotation.x = -1.35;
arms[0].rotation.x = -0.35;
arms[1].rotation.x = -0.35;
}
const actor = {
root,
legs,
arms,
activity,
phase,
baseX: x,
baseZ: z,
path
};
actors.push(actor);
return actor;
}
function addLamp(parent, x, z, color = 0xe9dfc4) {
box(parent, 0.16, 4.2, 0.16, x, 2.1, z, 0x34404c, false);
box(parent, 0.8, 0.16, 0.55, x + 0.28, 4.15, z, 0x34404c, false);
box(parent, 0.48, 0.18, 0.35, x + 0.52, 4.02, z, color, false);
}
function addWindowGrid(parent, width, height, depth, x, y, z, face = "front") {
const columns = Math.max(2, Math.floor(width / 1.15));
const rows = Math.max(1, Math.floor(height / 1.0));
for (let row = 0; row < rows; row++) {
for (let col = 0; col < columns; col++) {
const wx = x - width / 2 + 0.75 + col * ((width - 1.5) / Math.max(1, columns - 1));
const wy = y - height / 2 + 0.75 + row * ((height - 1.2) / Math.max(1, rows - 1));
if (face === "front") {
box(parent, 0.7, 0.52, 0.07, wx, wy, z, darkGlassMaterial, false);
} else {
box(parent, 0.07, 0.52, 0.7, z, wy, wx, darkGlassMaterial, false);
}
}
}
}
// ---------------------------------------------------------------------
// Civic Brasília diorama: representative massing and schematic sectors.
// ---------------------------------------------------------------------
const civic = group(scene, -30, 0, 0);
box(civic, 49, 1.1, 35, 0, -0.58, 0, 0x8e918f);
box(civic, 48, 0.24, 34, 0, 0.01, 0, 0xc9c8bd);
box(civic, 46.8, 0.08, 32.8, 0, 0.17, 0, 0xd8d4c7, false);
// Thin colored edge distinguishes the civic teaching board.
box(civic, 48.6, 0.12, 0.22, 0, 0.25, -17.05, 0x79c7e8, false);
box(civic, 48.6, 0.12, 0.22, 0, 0.25, 17.05, 0x79c7e8, false);
box(civic, 0.22, 0.12, 34, -24.05, 0.25, 0, 0x79c7e8, false);
box(civic, 0.22, 0.12, 34, 24.05, 0.25, 0, 0x79c7e8, false);
// Broad axial paving and cross-axis road.
box(civic, 44, 0.16, 9.2, 0, 0.29, 0, 0x555c61, false);
box(civic, 16.5, 0.18, 7.6, 0, 0.4, 0, 0xebe6d9, false);
box(civic, 3.2, 0.16, 27, 0, 0.39, 0, 0x60666a, false);
for (let x = -21; x <= 21; x += 3) {
box(civic, 0.07, 0.035, 8.8, x, 0.39, 0, 0x8c8d87, false);
}
for (let z = -12; z <= 12; z += 3) {
box(civic, 3.0, 0.035, 0.07, 0, 0.4, z, 0x979994, false);
}
// Schematic green belts and sector edges.
box(civic, 43, 0.16, 3.2, 0, 0.31, -8.5, 0x6f8958, false);
box(civic, 43, 0.16, 3.2, 0, 0.31, 8.5, 0x6f8958, false);
box(civic, 44, 0.13, 1.1, 0, 0.31, -15.9, 0x566b49, false);
box(civic, 44, 0.13, 1.1, 0, 0.31, 15.9, 0x566b49, false);
// National Congress-inspired voxel massing.
const congress = group(civic, -15.2, 0.4, 0);
box(congress, 11.2, 0.8, 9.2, 0, 0.4, 0, 0xe6e2d7);
box(congress, 8.7, 0.7, 7.4, 0, 1.08, 0, 0xd0cec5);
box(congress, 6.7, 2.45, 5.8, 0, 2.35, 0.25, 0xf0ede3);
box(congress, 5.6, 0.45, 6.25, 0, 3.75, 0.2, 0xd4d2c8);
box(congress, 4.6, 0.34, 5.45, 0, 4.12, 0.2, 0xf3f0e7);
for (const side of [-1, 1]) {
const towerX = side * 3.85;
box(congress, 2.55, 9.4, 5.0, towerX, 5.25, -0.2, 0xf1eee5);
box(congress, 1.25, 8.8, 4.72, towerX, 5.35, 0.18, darkGlassMaterial);
box(congress, 0.42, 9.7, 5.18, towerX - 1.04, 5.35, -0.2, 0xfaf8ef);
box(congress, 0.42, 9.7, 5.18, towerX + 1.04, 5.35, -0.2, 0xfaf8ef);
box(congress, 2.85, 0.38, 5.35, towerX, 10.1, -0.2, 0xd5d3c9);
box(congress, 2.25, 0.45, 4.8, towerX, 10.5, -0.2, 0xf4f1e7);
box(congress, 1.4, 0.32, 3.9, towerX, 10.85, -0.2, 0xe0ddd3);
}
// Cathedral-inspired stepped massing, kept intentionally schematic.
const cathedral = group(civic, 15.1, 0.4, 0);
box(cathedral, 9.2, 0.65, 8.1, 0, 0.32, 0, 0xe5e1d6);
box(cathedral, 5.6, 4.5, 5.3, 0, 2.7, 0, glassMaterial);
box(cathedral, 4.7, 0.5, 5.9, 0, 5.05, 0, 0xf7f4e9);
box(cathedral, 3.7, 0.42, 4.9, 0, 5.52, 0, 0xebe8df);
box(cathedral, 2.5, 0.34, 3.8, 0, 5.9, 0, 0xf9f6eb);
for (const z of [-2.68, 2.68]) {
box(cathedral, 0.55, 5.2, 0.55, -3.7, 2.9, z, 0xfbf8ee);
box(cathedral, 0.55, 5.2, 0.55, 3.7, 2.9, z, 0xfbf8ee);
box(cathedral, 7.95, 0.55, 0.55, 0, 5.22, z, 0xfbf8ee);
box(cathedral, 0.7, 5.45, 0.7, 0, 2.98, z, 0xfbf8ee);
}
for (const x of [-2.7, 2.7]) {
box(cathedral, 0.55, 5.2, 0.55, x, 2.9, 0, 0xfbf8ee);
box(cathedral, 6.0, 0.55, 0.55, x, 5.22, 0, 0xfbf8ee);
}
// Schematic administrative blocks along the north side of the civic board.
for (let i = 0; i < 4; i++) {
const x = -14 + i * 9;
const h = 3.3 + (i % 2) * 1.1;
const office = group(civic, x, 0.25, -12.2);
box(office, 6.6, h, 3.7, 0, h / 2, 0, 0xd3d1c7);
box(office, 6.9, 0.26, 4.0, 0, h + 0.12, 0, 0xefede4);
addWindowGrid(office, 5.5, h - 0.8, 0.1, 0, h / 2, 1.9, "front");
}
// Schematic residential slabs along the south side.
for (let i = 0; i < 4; i++) {
const x = -14 + i * 9;
const home = group(civic, x, 0.25, 12.3);
box(home, 6.5, 2.3, 3.4, 0, 1.15, 0, 0xd9d4c7);
box(home, 6.8, 0.24, 3.7, 0, 2.4, 0, 0xf0eee4);
addWindowGrid(home, 5.4, 1.4, 0.1, 0, 1.3, 1.75, "front");
}
// Trees, lamps, and people make the civic space legible at a human scale.
for (const x of [-20, -8, 8, 20]) {
addTree(civic, x, -5.8, 0.72, 0x527548);
addTree(civic, x, 5.8, 0.72, 0x527548);
}
for (const x of [-21, -10, 10, 21]) {
addLamp(civic, x, 3.7);
}
for (const x of [-21, -8, 8, 21]) {
addBush(civic, x, -6.7, 0.75);
addBush(civic, x, 6.7, 0.75);
}
const civicPeople = [
[-10.7, 1.7, 0xd86f52, "walk", 0.2],
[-4.2, -1.5, 0x4d8bb9, "walk", 1.8],
[2.8, 1.9, 0xe0b84f, "walk", 3.1],
[9.2, -1.4, 0x5d9c78, "idle", 0.4],
[5.4, 2.4, 0x926ca6, "carry", 0.1],
[-18.2, 5.6, 0x4c7ea4, "walk", 2.6]
];
civicPeople.forEach(([x, z, color, activity, phase], i) => {
addPerson(civic, x, z, color, {
activity,
phase,
rotation: Math.PI / 2,
path: i === 0 || i === 1 || i === 2 ? 1.2 : 0,
scale: 0.96
});
});
// ---------------------------------------------------------------------
// NOVACAP camp diorama: clearly interpretive living context.
// ---------------------------------------------------------------------
const camp = group(scene, 30, 0, 0);
box(camp, 49, 1.1, 35, 0, -0.58, 0, 0x715e47);
box(camp, 48, 0.24, 34, 0, 0.01, 0, 0x9b8665);
box(camp, 46.8, 0.08, 32.8, 0, 0.17, 0, 0xa8916f, false);
box(camp, 48.6, 0.12, 0.22, 0, 0.25, -17.05, 0xf0a45d, false);
box(camp, 48.6, 0.12, 0.22, 0, 0.25, 17.05, 0xf0a45d, false);
box(camp, 0.22, 0.12, 34, -24.05, 0.25, 0, 0xf0a45d, false);
box(camp, 0.22, 0.12, 34, 24.05, 0.25, 0, 0xf0a45d, false);
// An open central yard and a few worn paths, not a surveyed plan.
box(camp, 32, 0.08, 17.5, -1, 0.27, 0, 0xa78e69, false);
box(camp, 28, 0.06, 2.2, -1, 0.34, 0, 0xbca27a, false);
box(camp, 2.2, 0.06, 25, 1, 0.34, 0, 0xbca27a, false);
box(camp, 12, 0.05, 5.2, -11, 0.34, 3, 0x9d825f, false);
box(camp, 9, 0.05, 4.6, 9, 0.34, 2.8, 0x9d825f, false);
function addBarrack(parent, x, z, color, rotation = 0) {
const g = group(parent, x, 0.29, z);
g.rotation.y = rotation;
box(g, 7.3, 2.55, 3.15, 0, 1.275, 0, color);
box(g, 7.65, 0.28, 3.48, 0, 2.68, 0, 0x6e6a60);
box(g, 0.5, 2.5, 3.35, -3.63, 1.25, 0, 0x817967);
box(g, 0.5, 2.5, 3.35, 3.63, 1.25, 0, 0x817967);
// Doors and small windows face the common yard.
for (const wx of [-2.25, 0, 2.25]) {
box(g, 0.62, 1.25, 0.08, wx, 0.95, 1.61, 0x3b3934, false);
box(g, 0.88, 0.62, 0.07, wx, 2.0, 1.61, 0x455f64, false);
}
for (let i = -2; i <= 2; i++) {
box(g, 0.1, 0.12, 3.5, i * 1.25, 2.87, 0, 0x858077, false);
}
return g;
}
const barrackColors = [0xb8ad91, 0xc0b69d, 0xafa68c, 0xbdb49d];
[-15, -5.5, 4.5, 14.5].forEach((x, i) => {
addBarrack(camp, x, -11.2, barrackColors[i]);
});
[-14.5, -4.5, 5.5, 15].forEach((x, i) => {
addBarrack(camp, x, 11.2, barrackColors[(i + 1) % barrackColors.length]);
});
// Shared kitchen / mess point, clearly interpretive.
const kitchen = group(camp, 16, 0.3, 0);
box(kitchen, 7.4, 2.7, 4.1, 0, 1.35, 0, 0xb6aa8c);
box(kitchen, 7.8, 0.27, 4.5, 0, 2.82, 0, 0x746d60);
box(kitchen, 1.0, 3.8, 1.0, -2.5, 3.4, -1.25, 0x766e62);
box(kitchen, 1.25, 0.28, 1.25, -2.5, 5.38, -1.25, 0x5f5a52);
box(kitchen, 1.0, 0.65, 0.08, 0, 1.2, 2.1, 0x4b453d, false);
box(kitchen, 2.4, 0.24, 1.0, 1.1, 0.8, 2.55, 0x8e7452);
box(kitchen, 0.9, 0.55, 0.65, 0.2, 1.18, 2.5, 0x6d604d);
// Water and washing point.
const wash = group(camp, -16.4, 0.3, 0);
box(wash, 1.75, 3.3, 1.75, -1.5, 1.65, -0.6, 0x7f8d89);
box(wash, 1.95, 0.25, 1.95, -1.5, 3.42, -0.6, 0x66746f);
box(wash, 2.7, 0.85, 1.4, 1.15, 0.43, 0, 0x92998e);
box(wash, 2.45, 0.14, 1.1, 1.15, 0.91, 0, 0x5d777b);
box(wash, 0.18, 1.25, 0.18, 0.05, 1.15, 0.75, 0x59635e);
box(wash, 0.65, 0.13, 0.13, 0.35, 1.72, 0.75, 0x59635e);
// Repair bench and stored materials.
const workshop = group(camp, 0, 0.3, -5.0);
box(workshop, 4.4, 0.25, 1.5, 0, 1.1, 0, 0x745b3e);
for (const x of [-1.8, 1.8]) {
box(workshop, 0.22, 1.0, 1.2, x, 0.55, 0, 0x5c4c39);
}
box(workshop, 1.3, 0.9, 1.15, -1.1, 0.48, 0, 0x7b6a4e);
box(workshop, 0.18, 0.75, 0.18, 1.3, 1.62, 0, 0x4e5350);
box(workshop, 0.75, 0.18, 0.22, 1.3, 1.97, 0, 0x4e5350);
// Shared tables and stools.
function addTable(parent, x, z, rotation = 0) {
const g = group(parent, x, 0.31, z);
g.rotation.y = rotation;
box(g, 3.4, 0.2, 1.2, 0, 1.15, 0, 0x8f704b);
for (const xx of [-1.25, 1.25]) {
box(g, 0.18, 1.1, 0.8, xx, 0.55, 0, 0x66543d);
}
for (const zz of [-0.92, 0.92]) {
box(g, 0.65, 0.16, 0.55, -0.9, 0.58, zz, 0x765a3d);
box(g, 0.65, 0.16, 0.55, 0.9, 0.58, zz, 0x765a3d);
}
}
addTable(camp, 9.0, 4.8, 0);
addTable(camp, -8.7, -4.8, 0);
// Laundry line: posts and small cloth planes.
const laundry = group(camp, -4.2, 0.3, 7.6);
box(laundry, 0.14, 2.8, 0.14, -3.6, 1.4, 0, 0x68553c);
box(laundry, 0.14, 2.8, 0.14, 3.6, 1.4, 0, 0x68553c);
box(laundry, 7.2, 0.055, 0.055, 0, 2.55, 0, 0x554b3c, false);
const clothColors = [0xd6d2b9, 0x759caf, 0xc47d63, 0x789775];
for (let i = 0; i < 4; i++) {
box(laundry, 0.75, 1.05, 0.06, -2.4 + i * 1.6, 1.95, 0, clothColors[i], false);
}
// Trees and shrubs frame the reconstructed camp without asserting a plan.
addTree(camp, -21.2, -5.8, 0.92, 0x5f7a43);
addTree(camp, -21.2, 5.8, 0.9, 0x5f7a43);
addTree(camp, 21.2, -5.8, 0.9, 0x5f7a43);
addTree(camp, 21.2, 6.0, 0.84, 0x5f7a43);
addTree(camp, -1.5, -15.0, 0.74, 0x6d854c);
addTree(camp, 9.0, 15.1, 0.74, 0x6d854c);
for (const [x, z] of [[-20, 14], [-10, 14], [1, 14], [12, -14], [20, -14]]) {
addBush(camp, x, z, 0.8, 0x62784b);
}
// Varied everyday activities: synthesized examples, not a roster.
addPerson(camp, 15.0, 2.65, 0xc05f4f, { activity: "cook", phase: 0.2, rotation: Math.PI });
addPerson(camp, 12.2, 3.8, 0x507e9f, { activity: "idle", phase: 0.7 });
addPerson(camp, 10.9, 4.25, 0xbf8d43, { activity: "idle", phase: 1.4 });
addPerson(camp, -14.7, 1.7, 0x6d8f66, { activity: "wash", phase: 1.3, rotation: Math.PI });
addPerson(camp, -12.8, 2.6, 0x8e6ba0, { activity: "carry", phase: 0.5 });
addPerson(camp, 0.7, -4.1, 0x4f83a7, { activity: "repair", phase: 1.0, rotation: Math.PI });
addPerson(camp, -8.2, -4.3, 0xd17a57, { activity: "sit", phase: 2.2 });
addPerson(camp, -9.6, -4.6, 0x789b6d, { activity: "sit", phase: 2.9 });
addPerson(camp, -2.4, 1.9, 0xd3a448, {
activity: "walk",
phase: 0.2,
rotation: Math.PI / 2,
path: 2.2
});
addPerson(camp, 3.2, -1.1, 0x628ea0, {
activity: "walk",
phase: 1.7,
rotation: Math.PI / 2,
path: 1.8
});
addPerson(camp, -5.8, 5.8, 0xb06056, {
activity: "walk",
phase: 2.8,
rotation: Math.PI / 2,
path: 1.6
});
// Smaller figures and a ball suggest play without labeling a demographic.
addPerson(camp, -6.0, 2.4, 0x5785a8, {
activity: "walk",
phase: 0.5,
scale: 0.72,
rotation: 0.3,
path: 0.8
});
addPerson(camp, -3.6, 3.2, 0xd09548, {
activity: "walk",
phase: 2.0,
scale: 0.7,
rotation: -0.4,
path: 0.7
});
const ball = new THREE.Mesh(
new THREE.IcosahedronGeometry(0.35, 1),
material(0xd9d1b5)
);
ball.position.set(-4.8, 0.46, 2.9);
ball.castShadow = true;
camp.add(ball);
// A small communal notice board and path lights.
box(camp, 2.2, 1.6, 0.18, -0.5, 1.45, -2.4, 0x695841);
box(camp, 1.75, 1.05, 0.08, -0.5, 1.55, -2.54, 0xc4b98d, false);
addLamp(camp, -21.0, 0, 0xf0d8a5);
addLamp(camp, 21.0, 0, 0xf0d8a5);
// A broad, neutral floor visually anchors both separate dioramas.
box(scene, 154, 0.45, 78, 0, -1.35, 0, 0x121d2c);
// ---------------------------------------------------------------------
// Direct camera controls: orbit, zoom, keyboard access, and focus views.
// ---------------------------------------------------------------------
const view = {
target: new THREE.Vector3(0, 1.8, 0),
yaw: 0.63,
pitch: 0.58,
radius: 118
};
const desired = {
target: view.target.clone(),
yaw: view.yaw,
pitch: view.pitch,
radius: view.radius
};
const views = {
both: { target: new THREE.Vector3(0, 1.8, 0), radius: 118 },
civic: { target: new THREE.Vector3(-30, 2.5, 0), radius: 49 },
camp: { target: new THREE.Vector3(30, 1.8, 0), radius: 49 }
};
function updateCamera() {
const horizontal = view.radius * Math.cos(view.pitch);
camera.position.set(
view.target.x + horizontal * Math.sin(view.yaw),
view.target.y + view.radius * Math.sin(view.pitch),
view.target.z + horizontal * Math.cos(view.yaw)
);
camera.lookAt(view.target);
}
function setView(name) {
const selection = views[name];
if (!selection) return;
desired.target.copy(selection.target);
desired.radius = selection.radius;
desired.yaw = view.yaw;
desired.pitch = view.pitch;
document.querySelectorAll("[data-view]").forEach((button) => {
button.classList.toggle("active", button.dataset.view === name);
});
}
document.querySelectorAll("[data-view]").forEach((button) => {
button.addEventListener("click", () => setView(button.dataset.view));
});
document.getElementById("zoom-in").addEventListener("click", () => {
desired.radius = THREE.MathUtils.clamp(desired.radius * 0.83, 22, 150);
});
document.getElementById("zoom-out").addEventListener("click", () => {
desired.radius = THREE.MathUtils.clamp(desired.radius * 1.2, 22, 150);
});
const notesPanel = document.getElementById("notes-panel");
const notesToggle = document.getElementById("notes-toggle");
notesToggle.addEventListener("click", () => {
const hidden = notesPanel.classList.toggle("hidden");
notesToggle.setAttribute("aria-expanded", String(!hidden));
});
let dragging = false;
let pointerX = 0;
let pointerY = 0;
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
pointerX = event.clientX;
pointerY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!dragging) return;
const dx = event.clientX - pointerX;
const dy = event.clientY - pointerY;
pointerX = event.clientX;
pointerY = event.clientY;
desired.yaw = view.yaw = view.yaw - dx * 0.006;
desired.pitch = view.pitch = THREE.MathUtils.clamp(
view.pitch + dy * 0.0045,
0.18,
1.25
);
});
function endDrag(event) {
dragging = false;
if (event.pointerId !== undefined && renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
renderer.domElement.addEventListener("pointerup", endDrag);
renderer.domElement.addEventListener("pointercancel", endDrag);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
const factor = Math.exp(event.deltaY * 0.001);
desired.radius = view.radius = THREE.MathUtils.clamp(
view.radius * factor,
22,
150
);
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", () => setView("both"));
renderer.domElement.addEventListener("keydown", (event) => {
const key = event.key;
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "+", "=", "-", "0"].includes(key)) {
event.preventDefault();
}
if (key === "ArrowLeft") desired.yaw = view.yaw = view.yaw + 0.08;
if (key === "ArrowRight") desired.yaw = view.yaw = view.yaw - 0.08;
if (key === "ArrowUp") {
desired.pitch = view.pitch = THREE.MathUtils.clamp(view.pitch + 0.06, 0.18, 1.25);
}
if (key === "ArrowDown") {
desired.pitch = view.pitch = THREE.MathUtils.clamp(view.pitch - 0.06, 0.18, 1.25);
}
if (key === "+" || key === "=") {
desired.radius = view.radius = THREE.MathUtils.clamp(view.radius * 0.9, 22, 150);
}
if (key === "-") {
desired.radius = view.radius = THREE.MathUtils.clamp(view.radius * 1.1, 22, 150);
}
if (key === "0") setView("both");
});
function resize() {
const width = stage.clientWidth;
const height = stage.clientHeight;
camera.aspect = width / height;
camera.updateProjectionMatrix();
renderer.setSize(width, height);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
}
window.addEventListener("resize", resize);
// Projected HTML labels remain separate from the procedural geometry.
const projectedLabels = [
{
element: document.getElementById("civic-label"),
parent: civic,
local: new THREE.Vector3(0, 12.8, 0)
},
{
element: document.getElementById("camp-label"),
parent: camp,
local: new THREE.Vector3(0, 11.7, 0)
}
];
function updateLabels() {
const width = stage.clientWidth;
const height = stage.clientHeight;
for (const label of projectedLabels) {
const world = label.parent.localToWorld(label.local.clone());
const projected = world.project(camera);
const visible = projected.z > -1 && projected.z < 1 &&
projected.x > -1.18 && projected.x < 1.18 &&
projected.y > -1.18 && projected.y < 1.18;
label.element.style.display = visible ? "block" : "none";
if (visible) {
label.element.style.left = `${(projected.x * 0.5 + 0.5) * width}px`;
label.element.style.top = `${(-projected.y * 0.5 + 0.5) * height}px`;
}
}
}
const clock = new THREE.Clock();
function animate() {
const dt = Math.min(clock.getDelta(), 0.05);
const elapsed = clock.elapsedTime;
if (!reducedMotion) {
const smoothing = 1 - Math.exp(-dt * 5.5);
view.target.lerp(desired.target, smoothing);
view.radius += (desired.radius - view.radius) * smoothing;
view.yaw += (desired.yaw - view.yaw) * smoothing;
view.pitch += (desired.pitch - view.pitch) * smoothing;
for (const actor of actors) {
if (actor.activity === "walk") {
const swing = Math.sin(elapsed * 3.1 + actor.phase) * 0.52;
actor.legs[0].rotation.x = swing;
actor.legs[1].rotation.x = -swing;
actor.arms[0].rotation.x = -swing * 0.72;
actor.arms[1].rotation.x = swing * 0.72;
actor.root.position.x = actor.baseX + Math.sin(elapsed * 0.48 + actor.phase) * actor.path;
} else if (actor.activity === "wash" || actor.activity === "cook") {
actor.arms[1].rotation.x = -1.2 + Math.sin(elapsed * 3.4 + actor.phase) * 0.28;
} else if (actor.activity === "repair") {
actor.arms[1].rotation.x = -1.15 + Math.sin(elapsed * 4.1 + actor.phase) * 0.34;
}
}
ball.position.y = 0.46 + Math.abs(Math.sin(elapsed * 2.4)) * 0.42;
ball.rotation.x += dt * 1.6;
ball.rotation.z += dt * 1.1;
}
updateCamera();
updateLabels();
renderer.render(scene, camera);
}
updateCamera();
renderer.setAnimationLoop(animate);
requestAnimationFrame(() => {
loading.classList.add("done");
setTimeout(() => loading.remove(), 350);
});
</script>
</body>
</html>
```