Prompt specification
Build or customize the Three.js 3D scene "Historical broadcast studio and listening households" 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: Historical broadcast studio and listening households
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/historical-broadcast-studio-and-listening-households-x2523
Scene Description Prompt:
Make a standalone HTML scene with Three.js from cdnjs that depicts a voxel historical radio broadcast reaching two separate households. Build a central studio vignette with a period-referenced microphone, operator's desk, and simple acoustic panels. On either side, place a small domestic listening scene with a radio and a few chairs, using referenced furnishings appropriate to the selected period. Connect the three vignettes with a restrained schematic signal path. When the studio's program indicator pulses, matching indicators on both tuned receivers respond after the same illustrative delay. Keep any program content fictional, and show the households as different locations rather than adjoining rooms in one actual building.
Working Three.js Starter (historical-broadcast-studio-and-listening-households-x2523):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>The Lamplighter's Hour — Voxel Radio Broadcast</title>
<style>
:root {
--ink: #172321;
--paper: #efe4c8;
--muted: #b9b49f;
--amber: #e5b45d;
--red: #e55b43;
--panel: rgba(23, 35, 33, 0.9);
}
* { box-sizing: border-box; }
html, body {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #bdc8c2;
font-family: Georgia, "Times New Roman", serif;
}
canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
}
#hud {
position: fixed;
inset: 0;
pointer-events: none;
color: var(--paper);
}
.panel {
background: var(--panel);
border: 1px solid rgba(229, 180, 93, 0.42);
box-shadow: 0 12px 35px rgba(19, 29, 27, 0.18);
backdrop-filter: blur(8px);
}
#title-card {
position: absolute;
top: 22px;
left: 24px;
width: min(460px, calc(100vw - 48px));
padding: 17px 20px 16px;
border-left: 5px solid var(--amber);
}
.eyebrow {
margin-bottom: 7px;
color: var(--amber);
font: 700 11px/1.2 Arial, sans-serif;
letter-spacing: 0.22em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: clamp(25px, 3vw, 39px);
font-weight: 500;
line-height: 0.98;
letter-spacing: 0.02em;
}
#title-card p {
margin: 10px 0 0;
color: #d3cbb2;
font: 13px/1.45 Arial, sans-serif;
}
#status-card {
position: absolute;
top: 22px;
right: 24px;
width: 286px;
padding: 15px 17px;
}
.status-heading {
color: var(--amber);
font: 700 10px/1 Arial, sans-serif;
letter-spacing: 0.2em;
text-transform: uppercase;
margin-bottom: 12px;
}
.status-row {
display: grid;
grid-template-columns: 12px 1fr;
gap: 10px;
align-items: center;
margin: 9px 0;
color: #c8c2ae;
font: 12px/1.25 Arial, sans-serif;
}
.status-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #5a5d52;
border: 1px solid rgba(255,255,255,.25);
transition: background .12s, box-shadow .12s;
}
.status-dot.studio.active {
background: var(--red);
box-shadow: 0 0 16px rgba(229, 91, 67, .95);
}
.status-dot.home.active {
background: var(--amber);
box-shadow: 0 0 16px rgba(229, 180, 93, .95);
}
#delay-note {
margin-top: 13px;
padding-top: 11px;
border-top: 1px solid rgba(229,180,93,.23);
color: #aaa793;
font: 11px/1.45 Arial, sans-serif;
}
#details {
position: absolute;
left: 24px;
bottom: 24px;
width: min(390px, calc(100vw - 48px));
padding: 14px 17px;
color: #cbc4ae;
font: 12px/1.55 Arial, sans-serif;
}
#details strong {
display: block;
margin-bottom: 5px;
color: var(--amber);
font-size: 10px;
letter-spacing: .18em;
text-transform: uppercase;
}
#controls {
position: absolute;
right: 24px;
bottom: 24px;
display: flex;
align-items: center;
gap: 8px;
pointer-events: auto;
}
button {
border: 1px solid rgba(229, 180, 93, .58);
background: rgba(23, 35, 33, .92);
color: var(--paper);
padding: 11px 14px;
cursor: pointer;
font: 700 10px/1 Arial, sans-serif;
letter-spacing: .12em;
text-transform: uppercase;
transition: background .15s, transform .15s;
}
button:hover {
background: rgba(52, 66, 58, .96);
transform: translateY(-1px);
}
#control-hint {
position: absolute;
right: 24px;
bottom: 77px;
color: rgba(23, 35, 33, .78);
font: 700 10px/1.3 Arial, sans-serif;
letter-spacing: .08em;
text-transform: uppercase;
text-align: right;
text-shadow: 0 1px 1px rgba(255,255,255,.35);
}
@media (max-width: 760px) {
#title-card {
top: 12px;
left: 12px;
width: calc(100vw - 24px);
padding: 12px 14px;
}
#status-card {
top: auto;
right: 12px;
bottom: 66px;
width: 230px;
padding: 11px 13px;
}
#details {
display: none;
}
#controls {
right: 12px;
bottom: 12px;
}
#control-hint {
display: none;
}
button {
padding: 10px 11px;
font-size: 9px;
}
}
</style>
</head>
<body>
<div id="hud">
<section id="title-card" class="panel">
<div class="eyebrow">1937 · North American broadcast</div>
<h1>The Lamplighter’s Hour</h1>
<p>
A fictional program carried from a period studio to two households
at separate addresses.
</p>
</section>
<section id="status-card" class="panel">
<div class="status-heading">Program transmission</div>
<div class="status-row">
<span id="studio-dot" class="status-dot studio"></span>
<span id="studio-state">Studio standing by</span>
</div>
<div class="status-row">
<span id="home-dot" class="status-dot home"></span>
<span id="home-state">Receivers ready</span>
</div>
<div id="delay-note">
Both tuned receiver indicators respond after the same illustrative
<strong>1.25-second</strong> relay delay.
</div>
</section>
<section id="details" class="panel">
<strong>Period references</strong>
RCA 44–style ribbon microphone, 1930s acoustic treatment, walnut
cathedral radio, Bakelite table set, bentwood and cane seating,
wingback upholstery, oak side tables, period curtains and fringed rugs.
The dashed route is schematic—not physical wiring.
</section>
<div id="control-hint">Drag to orbit · Scroll to zoom · R to reset</div>
<div id="controls">
<button id="pulse-button" type="button">Send pulse</button>
<button id="pause-button" type="button">Pause</button>
</div>
</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// -----------------------------------------------------------------------
// Renderer, scene and lighting
// -----------------------------------------------------------------------
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xbdc8c2);
scene.fog = new THREE.Fog(0xbdc8c2, 48, 92);
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.appendChild(renderer.domElement);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
150
);
const target = new THREE.Vector3(0, 0.9, 0);
let yaw = 0.035;
let pitch = 0.91;
let userRadius = 31;
let viewScale = 1;
function updateCamera() {
const radius = userRadius * viewScale;
camera.position.set(
target.x + radius * Math.sin(pitch) * Math.sin(yaw),
target.y + radius * Math.cos(pitch),
target.z + radius * Math.sin(pitch) * Math.cos(yaw)
);
camera.lookAt(target);
}
function resize() {
const aspect = window.innerWidth / window.innerHeight;
camera.aspect = aspect;
camera.updateProjectionMatrix();
viewScale = aspect < 0.8 ? 2.15 : aspect < 1.2 ? 1.55 : 1;
renderer.setSize(window.innerWidth, window.innerHeight);
updateCamera();
}
window.addEventListener("resize", resize);
resize();
scene.add(new THREE.HemisphereLight(0xf4ead0, 0x52625c, 2.05));
const sun = new THREE.DirectionalLight(0xffe5b7, 3.2);
sun.position.set(-15, 28, 18);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -28;
sun.shadow.camera.right = 28;
sun.shadow.camera.top = 22;
sun.shadow.camera.bottom = -18;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 70;
sun.shadow.bias = -0.0005;
scene.add(sun);
const fill = new THREE.DirectionalLight(0xa7c9d1, 1.0);
fill.position.set(18, 10, -12);
scene.add(fill);
// -----------------------------------------------------------------------
// Geometry and material helpers
// -----------------------------------------------------------------------
const material = (color, roughness = 0.78, metalness = 0) =>
new THREE.MeshStandardMaterial({
color,
roughness,
metalness,
flatShading: true
});
const M = {
ground: material(0xaab6ae),
studioBase: material(0x65726b),
studioFloor: material(0x7d7766),
cream: material(0xd6c8a9),
creamLight: material(0xe4d8ba),
wood: material(0x533426),
woodMid: material(0x765039),
woodLight: material(0xa47c55),
darkWood: material(0x2f211c),
metal: material(0x777b74, 0.38, 0.58),
brass: material(0xb99249, 0.34, 0.62),
black: material(0x222523),
grille: material(0xa8976d),
paper: material(0xe9e0c7),
teal: material(0x42615c),
tealDark: material(0x2d4946),
rust: material(0x86483b),
rustDark: material(0x53312d),
green: material(0x5d7952),
grass: material(0x70845e),
brick: material(0x985d48),
creamLight: material(0xe4d8ba),
glass: material(0x9ebfc0, 0.32),
skin: material(0xc88f68),
shirt: material(0x4f626a),
pants: material(0x343a3d),
leaf: material(0x526c49),
lampShade: new THREE.MeshStandardMaterial({
color: 0xd7b574,
roughness: 0.85,
emissive: 0x8e5c20,
emissiveIntensity: 0.2
})
};
function box(parent, size, position, mat, rotation = [0, 0, 0]) {
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(size[0], size[1], size[2]),
mat
);
mesh.position.set(...position);
mesh.rotation.set(...rotation);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function cylinder(
parent, top, bottom, height, position, mat,
radialSegments = 12, rotation = [0, 0, 0]
) {
const mesh = new THREE.Mesh(
new THREE.CylinderGeometry(top, bottom, height, radialSegments),
mat
);
mesh.position.set(...position);
mesh.rotation.set(...rotation);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function torus(parent, radius, tube, position, mat) {
const mesh = new THREE.Mesh(
new THREE.TorusGeometry(radius, tube, 6, 18),
mat
);
mesh.position.set(...position);
mesh.castShadow = true;
parent.add(mesh);
return mesh;
}
function makePanel(
parent, title, subtitle, width, height, position,
accent = "#e5b45d"
) {
const canvas = document.createElement("canvas");
canvas.width = 1024;
canvas.height = 256;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "#1c2926";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = accent;
ctx.fillRect(0, 0, 18, canvas.height);
ctx.strokeStyle = accent;
ctx.lineWidth = 4;
ctx.strokeRect(12, 12, canvas.width - 24, canvas.height - 24);
ctx.fillStyle = "#f0e5c9";
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.font = "600 55px Georgia";
ctx.fillText(title, canvas.width / 2, 100);
ctx.fillStyle = accent;
ctx.font = "700 25px Arial";
ctx.fillText(subtitle, canvas.width / 2, 177);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();
const mesh = new THREE.Mesh(
new THREE.PlaneGeometry(width, height),
new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
depthWrite: false
})
);
mesh.position.set(...position);
parent.add(mesh);
return mesh;
}
function makeWorldLabel(
parent, title, subtitle, position,
accent = "#e5b45d", scale = 5.4
) {
const canvas = document.createElement("canvas");
canvas.width = 1024;
canvas.height = 256;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "rgba(23, 35, 33, .94)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = accent;
ctx.fillRect(0, 0, canvas.width, 11);
ctx.fillRect(0, canvas.height - 11, canvas.width, 11);
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.fillStyle = "#f0e5c9";
ctx.font = "600 57px Georgia";
ctx.fillText(title, canvas.width / 2, 104);
ctx.fillStyle = accent;
ctx.font = "700 26px Arial";
ctx.fillText(subtitle, canvas.width / 2, 182);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
const sprite = new THREE.Sprite(
new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthTest: false,
depthWrite: false
})
);
sprite.position.set(...position);
sprite.scale.set(scale, scale / 4, 1);
sprite.renderOrder = 30;
parent.add(sprite);
return sprite;
}
function makeWindow(parent, x, y, z, width = 1.45, height = 1.5) {
box(parent, [width + .24, height + .24, .12], [x, y, z], M.woodMid);
box(parent, [width, height, .08], [x, y, z + .08], M.glass);
box(parent, [.07, height, .1], [x, y, z + .13], M.creamLight);
box(parent, [width, .07, .1], [x, y, z + .13], M.creamLight);
box(parent, [.21, height + .38, .16], [x - width / 2 - .12, y, z + .15], M.rust);
box(parent, [.21, height + .38, .16], [x + width / 2 + .12, y, z + .15], M.rust);
box(parent, [width + .72, .18, .22], [x, y + height / 2 + .24, z + .15], M.rust);
}
function makePicture(parent, x, y, z, color = M.teal) {
box(parent, [1.05, .82, .1], [x, y, z], M.wood);
box(parent, [.86, .63, .06], [x, y, z + .07], color);
box(parent, [.12, .47, .07], [x - .16, y, z + .11], M.creamLight);
box(parent, [.55, .08, .07], [x + .06, y - .2, z + .11], M.woodMid);
}
function makeLamp(parent, x, z) {
cylinder(parent, .22, .25, .08, [x, .12, z], M.brass);
cylinder(parent, .035, .035, 1.1, [x, .62, z], M.brass);
cylinder(parent, .16, .32, .42, [x, 1.3, z], M.lampShade);
}
function makePlant(parent, x, z) {
cylinder(parent, .28, .22, .43, [x, .29, z], M.rust, 8);
box(parent, [.06, .85, .06], [x, .83, z], M.leaf);
box(parent, [.52, .12, .23], [x - .19, 1.0, z], M.leaf, [0, .3, .4]);
box(parent, [.48, .12, .22], [x + .18, 1.22, z], M.green, [0, -.2, -.3]);
box(parent, [.4, .12, .2], [x - .08, 1.42, z], M.leaf, [0, .4, -.4]);
}
// -----------------------------------------------------------------------
// Period furnishings
// -----------------------------------------------------------------------
function makeWingChair(parent, x, z, upholstery = M.teal) {
const chair = new THREE.Group();
chair.position.set(x, .1, z);
parent.add(chair);
box(chair, [.95, .22, .9], [0, .53, 0], upholstery);
box(chair, [.94, 1.25, .22], [0, 1.13, -.35], upholstery);
box(chair, [.25, .9, .78], [-.46, .94, -.02], upholstery);
box(chair, [.25, .9, .78], [.46, .94, -.02], upholstery);
box(chair, [.12, .48, .12], [-.33, .23, -.28], M.darkWood);
box(chair, [.12, .48, .12], [.33, .23, -.28], M.darkWood);
box(chair, [.12, .48, .12], [-.33, .23, .28], M.darkWood);
box(chair, [.12, .48, .12], [.33, .23, .28], M.darkWood);
box(chair, [.58, .18, .14], [0, 1.0, -.19], M.tealDark);
return chair;
}
function makeBentChair(parent, x, z, rotation = 0) {
const chair = new THREE.Group();
chair.position.set(x, .1, z);
chair.rotation.y = rotation;
parent.add(chair);
box(chair, [.85, .12, .78], [0, .54, 0], M.woodMid);
box(chair, [.68, .07, .61], [0, .62, .02], M.grille);
for (const sx of [-1, 1]) {
box(chair, [.09, 1.55, .09], [sx * .36, .78, -.3], M.woodMid);
box(chair, [.08, .54, .08], [sx * .36, .28, .27], M.woodMid);
box(chair, [.08, .08, .72], [sx * .36, .53, .02], M.woodMid);
}
box(chair, [.77, .12, .1], [0, 1.49, -.3], M.woodMid);
box(chair, [.61, .09, .09], [0, 1.17, -.3], M.woodLight);
box(chair, [.59, .09, .09], [0, .92, -.3], M.woodLight);
return chair;
}
function makeListener(parent, x, z, shirtMaterial = M.rust) {
const person = new THREE.Group();
person.position.set(x, .1, z);
parent.add(person);
box(person, [.48, .64, .31], [0, .94, -.02], shirtMaterial);
box(person, [.34, .34, .32], [0, 1.48, .01], M.skin);
box(person, [.37, .12, .34], [0, 1.65, .01], M.darkWood);
box(person, [.16, .19, .56], [-.15, .52, .25], M.pants, [0.12, 0, 0]);
box(person, [.16, .19, .56], [.15, .52, .25], M.pants, [0.12, 0, 0]);
box(person, [.14, .42, .15], [-.31, .91, .05], shirtMaterial, [0, 0, -.35]);
box(person, [.14, .42, .15], [.31, .91, .05], shirtMaterial, [0, 0, .35]);
return person;
}
function makeRadio(parent, x, y, z, variant = "walnut") {
const radio = new THREE.Group();
radio.position.set(x, y, z);
parent.add(radio);
const cabinetMaterial = variant === "walnut" ? M.wood : M.rustDark;
const trimMaterial = variant === "walnut" ? M.brass : M.woodMid;
box(radio, [1.38, .82, .66], [0, .43, 0], cabinetMaterial);
box(radio, [1.46, .11, .72], [0, .84, 0], trimMaterial);
box(radio, [1.21, .09, .7], [0, .91, 0], cabinetMaterial);
if (variant === "walnut") {
box(radio, [1.12, .11, .69], [0, .99, 0], M.woodMid);
box(radio, [.78, .08, .68], [0, 1.06, 0], M.wood);
} else {
box(radio, [1.06, .08, .67], [0, .98, 0], M.rust);
}
box(radio, [.76, .57, .055], [-.25, .43, .36], M.grille);
box(radio, [.68, .49, .065], [-.25, .43, .395], M.tealDark);
for (let i = 0; i < 7; i++) {
box(
radio,
[.035, .47, .035],
[-.53 + i * .093, .43, .435],
M.creamLight
);
}
box(radio, [.43, .17, .065], [.35, .61, .365], M.paper);
box(radio, [.025, .1, .04], [.49, .61, .41], M.darkWood);
cylinder(
radio, .095, .095, .075,
[.25, .25, .38], M.brass, 12, [Math.PI / 2, 0, 0]
);
cylinder(
radio, .095, .095, .075,
[.49, .25, .38], M.brass, 12, [Math.PI / 2, 0, 0]
);
const indicatorMaterial = new THREE.MeshStandardMaterial({
color: 0x49371c,
emissive: 0xffb83e,
emissiveIntensity: 0.04,
roughness: 0.35
});
torus(radio, .086, .021, [.53, .69, .38], M.brass);
const indicator = cylinder(
radio, .061, .061, .05,
[.53, .69, .405], indicatorMaterial, 12, [Math.PI / 2, 0, 0]
);
box(radio, [.25, .055, .04], [0, .08, .37], M.brass);
return { radio, indicator, indicatorMaterial };
}
// -----------------------------------------------------------------------
// Central studio
// -----------------------------------------------------------------------
const centralIndicatorMaterial = new THREE.MeshStandardMaterial({
color: 0x5c1e18,
emissive: 0xff3824,
emissiveIntensity: 0.03,
roughness: 0.32
});
const centralIndicatorMeshes = [];
function createStudio() {
const studio = new THREE.Group();
scene.add(studio);
box(studio, [8.2, .7, 5.55], [0, -.36, 0], M.studioBase);
box(studio, [7.85, .09, 5.2], [0, .035, 0], M.studioFloor);
for (let i = 0; i < 9; i++) {
box(
studio,
[.018, .012, 5.12],
[-3.48 + i * .87, .087, 0],
M.woodMid
);
}
box(studio, [7.8, 3.18, .16], [0, 1.65, -2.46], M.cream);
box(studio, [.16, 1.05, 5.1], [-3.82, .58, 0], M.cream);
box(studio, [.16, 1.05, 5.1], [3.82, .58, 0], M.cream);
box(studio, [7.9, .14, .2], [0, .16, -2.38], M.wood);
box(studio, [7.9, .14, .2], [0, 3.2, -2.38], M.woodMid);
// Simple acoustic treatment: framed fabric panels and timber battens.
const panelXs = [-3.0, -2.0, -1.0, 1.0, 2.0, 3.0];
for (const x of panelXs) {
box(studio, [.76, 1.52, .12], [x, 1.83, -2.32], M.woodMid);
box(studio, [.62, 1.36, .08], [x, 1.83, -2.23], M.tealDark);
for (let j = 0; j < 4; j++) {
box(
studio,
[.035, 1.28, .035],
[x - .22 + j * .145, 1.83, -2.17],
M.teal
);
}
}
makePanel(
studio,
"THE LAMPLIGHTER’S HOUR",
"FICTIONAL PROGRAM • NIGHT DESK NETWORK",
3.8, .88,
[0, 2.68, -2.15]
);
// Large studio program lamp.
cylinder(
studio, .22, .22, .13,
[2.72, 2.24, -2.1], M.darkWood, 12, [Math.PI / 2, 0, 0]
);
const wallLamp = cylinder(
studio, .145, .145, .11,
[2.72, 2.24, -1.99], centralIndicatorMaterial, 12, [Math.PI / 2, 0, 0]
);
centralIndicatorMeshes.push(wallLamp);
// Operator's desk.
box(studio, [3.55, .16, 1.25], [.72, 1.02, .1], M.wood);
box(studio, [3.25, .65, .15], [.72, .65, -.15], M.woodMid);
box(studio, [.72, .88, .85], [-.48, .48, .12], M.woodMid);
box(studio, [.72, .88, .85], [1.92, .48, .12], M.woodMid);
box(
studio, [2.25, .43, .2],
[.74, 1.29, .39], M.tealDark, [-0.22, 0, 0]
);
for (let i = 0; i < 8; i++) {
cylinder(
studio, .07, .075, .08,
[-.15 + i * .25, 1.35 + i * .013, .47],
i % 2 ? M.brass : M.black,
10,
[Math.PI / 2, 0, 0]
);
}
for (let i = 0; i < 3; i++) {
box(
studio, [.07, .19, .08],
[.2 + i * .22, 1.4, .49], M.paper, [-.22, 0, 0]
);
}
box(studio, [.7, .025, .48], [.57, 1.115, .12], M.paper, [0, .06, 0]);
box(studio, [.64, .018, .43], [.56, 1.135, .11], M.creamLight, [0, -.09, 0]);
// Script shelf.
box(studio, [1.05, .09, .36], [2.13, 1.16, -.34], M.woodMid);
box(studio, [.76, .025, .3], [2.12, 1.215, -.34], M.paper);
// Operator with headset.
const operator = new THREE.Group();
operator.position.set(.65, .1, -.75);
studio.add(operator);
box(operator, [.54, .67, .35], [0, 1.18, 0], M.shirt);
box(operator, [.36, .36, .35], [0, 1.73, .03], M.skin);
box(operator, [.41, .1, .38], [0, 1.92, .02], M.darkWood);
box(operator, [.15, .43, .15], [-.35, 1.12, .02], M.shirt, [0, 0, -.35]);
box(operator, [.15, .43, .15], [.35, 1.12, .02], M.shirt, [0, 0, .35]);
torus(operator, .25, .035, [0, 1.76, 0], M.metal);
cylinder(
operator, .09, .09, .08,
[-.25, 1.76, 0], M.black, 10, [0, 0, Math.PI / 2]
);
cylinder(
operator, .09, .09, .08,
[.25, 1.76, 0], M.black, 10, [0, 0, Math.PI / 2]
);
// 1930s RCA 44-style floor ribbon microphone.
const mic = new THREE.Group();
mic.position.set(-1.62, .1, .57);
studio.add(mic);
cylinder(mic, .42, .48, .09, [0, .06, 0], M.black, 16);
cylinder(mic, .045, .055, 1.25, [0, .69, 0], M.metal, 10);
box(mic, [.88, .68, .42], [0, 1.56, 0], M.metal);
box(mic, [.72, .54, .08], [0, 1.56, .235], M.black);
for (let i = 0; i < 7; i++) {
box(
mic, [.72, .025, .035],
[0, 1.34 + i * .073, .29], M.metal
);
}
box(mic, [.12, .74, .14], [-.48, 1.55, 0], M.metal);
box(mic, [.12, .74, .14], [.48, 1.55, 0], M.metal);
const micLamp = cylinder(
mic, .065, .065, .045,
[.29, 1.79, .31], centralIndicatorMaterial, 12, [Math.PI / 2, 0, 0]
);
centralIndicatorMeshes.push(micLamp);
makePanel(
studio,
"RIBBON MICROPHONE",
"1930s • PERIOD REFERENCE",
1.72, .43,
[-2.15, 1.0, -.25],
"#8bb3b5"
);
makeWorldLabel(
studio,
"BROADCAST STUDIO",
"CENTRAL DISTRICT • 1937",
[0, 4.02, -.3],
"#e5b45d",
5.55
);
makePanel(
studio,
"CENTRAL DISTRICT",
"NIGHT DESK NETWORK",
2.65, .55,
[0, .34, 2.79]
);
return studio;
}
const studio = createStudio();
// -----------------------------------------------------------------------
// Separate household: Maple Street, North District
// -----------------------------------------------------------------------
const receiverMaterials = [];
const receiverMeshes = [];
function createMapleHome() {
const home = new THREE.Group();
home.position.x = -10.6;
scene.add(home);
box(home, [6.8, .7, 5.35], [0, -.36, 0], M.woodMid);
box(home, [6.55, .09, 5.12], [0, .035, 0], M.grass);
box(home, [6.3, .07, 4.65], [0, .1, -.18], M.woodLight);
box(home, [6.45, 3.0, .14], [0, 1.58, -2.37], M.cream);
for (let i = 0; i < 16; i++) {
box(
home, [.055, 2.86, .025],
[-3.05 + i * .405, 1.58, -2.28],
i % 3 === 0 ? M.rust : M.creamLight
);
}
box(home, [.15, 1.05, 4.85], [-3.22, .61, -.18], M.cream);
box(home, [.15, .55, 4.85], [3.22, .36, -.18], M.cream);
box(home, [6.6, .13, .18], [0, .18, -2.28], M.wood);
box(home, [6.6, .13, .18], [0, 3.02, -2.28], M.woodMid);
makeWindow(home, -2.0, 1.85, -2.23, 1.45, 1.4);
makePicture(home, 1.55, 1.85, -2.24, M.tealDark);
box(home, [3.15, .025, 1.72], [.35, .155, .6], M.tealDark);
box(home, [3.0, .025, .12], [.35, .175, 1.42], M.rust);
// Oak side table and walnut cathedral receiver.
box(home, [1.35, .12, .8], [-1.82, .7, .02], M.woodMid);
for (const sx of [-.48, .48]) {
for (const sz of [-.27, .27]) {
box(home, [.11, .62, .11], [-1.82 + sx, .39, .02 + sz], M.wood);
}
}
const receiver = makeRadio(home, -1.82, .77, .02, "walnut");
receiverMaterials.push(receiver.indicatorMaterial);
receiverMeshes.push(receiver.indicator);
makeWingChair(home, -.05, .7, M.teal);
makeBentChair(home, 1.52, .62, -.18);
makeListener(home, 1.52, .65, M.rust);
box(home, [1.0, .1, .7], [2.45, .68, -1.15], M.woodMid);
box(home, [.12, .62, .12], [2.45, .35, -1.15], M.wood);
makeLamp(home, 2.45, -1.15);
makeWorldLabel(
home,
"MAPLE STREET HOME",
"NORTH DISTRICT • SEPARATE ADDRESS",
[0, 4.02, -.3],
"#8bb3b5",
5.45
);
makePanel(
home,
"MAPLE STREET • NORTH DISTRICT",
"A DISTINCT HOUSEHOLD LOCATION",
3.25, .55,
[0, .34, 2.69],
"#8bb3b5"
);
return home;
}
const mapleHome = createMapleHome();
// -----------------------------------------------------------------------
// Separate household: Orchard Lane, Riverside District
// -----------------------------------------------------------------------
function createOrchardHome() {
const home = new THREE.Group();
home.position.x = 10.6;
scene.add(home);
box(home, [6.8, .7, 5.35], [0, -.36, 0], M.brick);
box(home, [6.55, .09, 5.12], [0, .035, 0], M.grass);
box(home, [6.3, .07, 4.65], [0, .1, -.18], M.woodMid);
box(home, [6.45, 3.0, .14], [0, 1.58, -2.37], M.creamLight);
box(home, [6.55, .11, .17], [0, .17, -2.28], M.wood);
box(home, [6.55, .11, .17], [0, 3.02, -2.28], M.rustDark);
box(home, [.15, 1.05, 4.85], [-3.22, .61, -.18], M.creamLight);
box(home, [.15, .55, 4.85], [3.22, .36, -.18], M.creamLight);
makeWindow(home, 1.95, 1.85, -2.23, 1.42, 1.38);
makePicture(home, -.9, 1.84, -2.24, M.rustDark);
box(home, [2.7, .025, 1.7], [-.25, .155, .65], M.rustDark);
box(home, [2.55, .025, .11], [-.25, .176, 1.46], M.woodMid);
// Radio console.
box(home, [2.0, .62, .82], [1.7, .42, -.02], M.wood);
box(home, [2.12, .12, .92], [1.7, .8, -.02], M.woodMid);
box(home, [1.75, .38, .05], [1.7, .42, .42], M.woodMid);
for (let i = 0; i < 7; i++) {
box(
home, [.12, .3, .035],
[1.02 + i * .225, .42, .46], M.darkWood
);
}
const receiver = makeRadio(home, 1.7, .87, .02, "bakelite");
receiverMaterials.push(receiver.indicatorMaterial);
receiverMeshes.push(receiver.indicator);
makeBentChair(home, -1.3, .62, .12);
makeBentChair(home, .05, .82, -.15);
makeListener(home, .05, .85, M.shirt);
makePlant(home, -2.45, -1.43);
box(home, [.62, .58, .62], [2.42, .4, -1.38], M.woodMid);
makeWorldLabel(
home,
"ORCHARD LANE HOME",
"RIVERSIDE DISTRICT • SEPARATE ADDRESS",
[0, 4.02, -.3],
"#e19a75",
5.45
);
makePanel(
home,
"ORCHARD LANE • RIVERSIDE DISTRICT",
"A DISTINCT HOUSEHOLD LOCATION",
3.25, .55,
[0, .34, 2.69],
"#e19a75"
);
return home;
}
const orchardHome = createOrchardHome();
// -----------------------------------------------------------------------
// Restrained schematic relay path
// -----------------------------------------------------------------------
const signalGroup = new THREE.Group();
scene.add(signalGroup);
const sourcePoint = new THREE.Vector3(0, .46, 1.48);
const junctionPoint = new THREE.Vector3(0, .46, 3.35);
const leftTarget = new THREE.Vector3(-12.42, .46, .06);
const rightTarget = new THREE.Vector3(12.3, .46, .06);
const leftPoints = [
sourcePoint,
junctionPoint,
new THREE.Vector3(-5.4, .46, 3.35),
new THREE.Vector3(-10.6, .46, 3.35),
leftTarget
];
const rightPoints = [
sourcePoint,
junctionPoint,
new THREE.Vector3(5.4, .46, 3.35),
new THREE.Vector3(10.6, .46, 3.35),
rightTarget
];
function makeSignalLine(points) {
const geometry = new THREE.BufferGeometry().setFromPoints(points);
const lineMaterial = new THREE.LineDashedMaterial({
color: 0xb9813e,
dashSize: .28,
gapSize: .21,
transparent: true,
opacity: .65,
depthTest: true
});
const line = new THREE.Line(geometry, lineMaterial);
line.computeLineDistances();
signalGroup.add(line);
return line;
}
const signalLines = [
makeSignalLine(leftPoints),
makeSignalLine(rightPoints)
];
const leftCurve = new THREE.CatmullRomCurve3(leftPoints, false, "catmullrom", .12);
const rightCurve = new THREE.CatmullRomCurve3(rightPoints, false, "catmullrom", .12);
const beadMaterial = new THREE.MeshBasicMaterial({ color: 0xffd27a });
const leftBead = new THREE.Mesh(new THREE.SphereGeometry(.09, 10, 8), beadMaterial);
const rightBead = new THREE.Mesh(new THREE.SphereGeometry(.09, 10, 8), beadMaterial);
signalGroup.add(leftBead, rightBead);
const nodeMaterial = new THREE.MeshBasicMaterial({ color: 0xe5b45d });
const sourceNode = new THREE.Mesh(new THREE.SphereGeometry(.12, 10, 8), nodeMaterial);
sourceNode.position.copy(sourcePoint);
signalGroup.add(sourceNode);
const targetNodes = [leftTarget, rightTarget].map(p => {
const node = new THREE.Mesh(new THREE.SphereGeometry(.1, 10, 8), nodeMaterial);
node.position.copy(p);
signalGroup.add(node);
return node;
});
makeWorldLabel(
signalGroup,
"SCHEMATIC RELAY",
"ILLUSTRATIVE • NOT PHYSICAL WIRING",
[0, .86, 3.35],
"#e5b45d",
3.1
);
// -----------------------------------------------------------------------
// Camera controls implemented directly, without addons
// -----------------------------------------------------------------------
const pointers = new Map();
let lastPointer = { x: 0, y: 0 };
let lastPinchDistance = 0;
renderer.domElement.addEventListener("pointerdown", event => {
renderer.domElement.setPointerCapture(event.pointerId);
pointers.set(event.pointerId, { x: event.clientX, y: event.clientY });
lastPointer = { x: event.clientX, y: event.clientY };
if (pointers.size === 2) {
const [a, b] = [...pointers.values()];
lastPinchDistance = Math.hypot(a.x - b.x, a.y - b.y);
}
});
renderer.domElement.addEventListener("pointermove", event => {
if (!pointers.has(event.pointerId)) return;
pointers.set(event.pointerId, { x: event.clientX, y: event.clientY });
if (pointers.size === 1) {
const dx = event.clientX - lastPointer.x;
const dy = event.clientY - lastPointer.y;
yaw -= dx * .005;
pitch = THREE.MathUtils.clamp(pitch + dy * .004, .34, 1.28);
lastPointer = { x: event.clientX, y: event.clientY };
} else if (pointers.size === 2) {
const [a, b] = [...pointers.values()];
const distance = Math.hypot(a.x - b.x, a.y - b.y);
if (lastPinchDistance > 0) {
userRadius = THREE.MathUtils.clamp(
userRadius * (lastPinchDistance / distance),
20,
50
);
}
lastPinchDistance = distance;
}
updateCamera();
});
function removePointer(event) {
pointers.delete(event.pointerId);
lastPinchDistance = 0;
}
renderer.domElement.addEventListener("pointerup", removePointer);
renderer.domElement.addEventListener("pointercancel", removePointer);
renderer.domElement.addEventListener(
"wheel",
event => {
event.preventDefault();
userRadius = THREE.MathUtils.clamp(
userRadius * Math.exp(event.deltaY * .001),
20,
50
);
updateCamera();
},
{ passive: false }
);
function resetView() {
yaw = .035;
pitch = .91;
userRadius = 31;
updateCamera();
}
window.addEventListener("keydown", event => {
if (event.key.toLowerCase() === "r") resetView();
});
renderer.domElement.addEventListener("dblclick", resetView);
// -----------------------------------------------------------------------
// Synchronized illustrative transmission
// -----------------------------------------------------------------------
const CYCLE = 4.8;
const DELAY = 1.25;
const PULSE_LENGTH = .78;
let timeline = 0;
let running = true;
let previousTime = performance.now();
function envelope(phase, start) {
if (phase < start || phase > start + PULSE_LENGTH) return 0;
const t = (phase - start) / PULSE_LENGTH;
return Math.sin(Math.PI * t);
}
const studioDot = document.getElementById("studio-dot");
const homeDot = document.getElementById("home-dot");
const studioState = document.getElementById("studio-state");
const homeState = document.getElementById("home-state");
const pulseButton = document.getElementById("pulse-button");
const pauseButton = document.getElementById("pause-button");
pulseButton.addEventListener("click", () => {
timeline = 0;
running = true;
pauseButton.textContent = "Pause";
});
pauseButton.addEventListener("click", () => {
running = !running;
pauseButton.textContent = running ? "Pause" : "Resume";
});
function animate(now) {
const dt = Math.min((now - previousTime) / 1000, .1);
previousTime = now;
if (running) timeline += dt;
const phase = ((timeline % CYCLE) + CYCLE) % CYCLE;
const studioLevel = envelope(phase, 0);
const receiverLevel = envelope(phase, DELAY);
// Studio indicators.
centralIndicatorMaterial.emissiveIntensity = .04 + studioLevel * 5.2;
for (const mesh of centralIndicatorMeshes) {
mesh.scale.setScalar(1 + studioLevel * .32);
}
// Both receivers use exactly the same delayed phase.
for (const mat of receiverMaterials) {
mat.emissiveIntensity = .04 + receiverLevel * 4.8;
}
for (const mesh of receiverMeshes) {
mesh.scale.setScalar(1 + receiverLevel * .38);
}
// Schematic traveling pulse: each bead reaches its home at DELAY.
if (phase < DELAY) {
const u = THREE.MathUtils.clamp(phase / DELAY, 0, 1);
leftBead.visible = rightBead.visible = true;
leftBead.position.copy(leftCurve.getPointAt(u));
rightBead.position.copy(rightCurve.getPointAt(u));
} else {
leftBead.visible = rightBead.visible = false;
}
const pathGlow = .48 + Math.max(studioLevel, receiverLevel) * .42;
for (const line of signalLines) line.material.opacity = pathGlow;
studioDot.classList.toggle("active", studioLevel > .18);
homeDot.classList.toggle("active", receiverLevel > .18);
studioState.textContent = studioLevel > .18
? "Program on air"
: "Studio standing by";
homeState.textContent = receiverLevel > .18
? "Both receivers responding"
: "Receivers ready";
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
</script>
</body>
</html>
```