Prompt specification
Build or customize the Three.js 3D scene "Memorial Plinth With Multiple Viewpoints" 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: Memorial Plinth With Multiple Viewpoints
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/memorial-plinth-with-multiple-viewpoints-x3337
Scene Description Prompt:
Make a standalone HTML scene with Three.js from cdnjs that depicts an abstract plinth with three distinct viewing positions and empty source panels. Demonstrate how sight lines differ without inventing a real memorial's meaning. Stylized solid forms.
Working Three.js Starter (memorial-plinth-with-multiple-viewpoints-x3337):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Abstract Plinth — Three Viewpoints</title>
<style>
:root {
--ink: #222725;
--muted: #69706d;
--paper: #f1eee7;
--line: rgba(34, 39, 37, 0.2);
--active: #c86f3d;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #d8d5cd;
color: var(--ink);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system,
BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#stage {
position: fixed;
inset: 0;
}
#stage canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
#stage canvas:active {
cursor: grabbing;
}
.intro {
position: fixed;
z-index: 10;
top: 28px;
left: 30px;
max-width: 350px;
pointer-events: none;
}
.eyebrow {
margin: 0 0 9px;
font-size: 10px;
font-weight: 750;
letter-spacing: 0.21em;
text-transform: uppercase;
color: var(--muted);
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(32px, 4vw, 56px);
font-weight: 400;
line-height: 0.98;
letter-spacing: -0.045em;
}
.intro-copy {
max-width: 300px;
margin: 14px 0 0;
font-size: 12px;
line-height: 1.55;
color: var(--muted);
}
.source-rail {
position: fixed;
z-index: 10;
top: 28px;
right: 28px;
width: 226px;
padding: 13px;
border: 1px solid rgba(255, 255, 255, 0.42);
background: rgba(238, 235, 227, 0.68);
box-shadow: 0 12px 40px rgba(42, 45, 43, 0.08);
backdrop-filter: blur(14px);
pointer-events: none;
}
.source-heading {
margin-bottom: 10px;
font-size: 9px;
font-weight: 750;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--muted);
}
.source-panels {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.source-panel {
aspect-ratio: 0.78;
border: 1px solid var(--line);
background:
linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
rgba(255, 255, 255, 0.34);
box-shadow:
inset 0 0 0 3px rgba(255, 255, 255, 0.14),
0 2px 8px rgba(40, 44, 42, 0.03);
}
.view-label {
position: fixed;
z-index: 8;
display: grid;
width: 29px;
height: 29px;
place-items: center;
border: 1px solid currentColor;
border-radius: 50%;
background: rgba(244, 242, 235, 0.88);
box-shadow: 0 4px 14px rgba(34, 39, 37, 0.13);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.06em;
pointer-events: none;
transform: translate(-50%, -50%);
transition: opacity 160ms ease;
}
.view-controls {
position: fixed;
z-index: 20;
left: 50%;
bottom: 25px;
display: flex;
flex-direction: column;
align-items: center;
transform: translateX(-50%);
}
.buttons {
display: flex;
padding: 5px;
border: 1px solid rgba(255, 255, 255, 0.45);
background: rgba(238, 235, 227, 0.84);
box-shadow: 0 14px 45px rgba(35, 39, 37, 0.13);
backdrop-filter: blur(16px);
}
.view-button {
position: relative;
min-width: 142px;
padding: 11px 16px 12px;
border: 0;
border-right: 1px solid rgba(34, 39, 37, 0.11);
background: transparent;
color: var(--ink);
text-align: left;
cursor: pointer;
transition:
background 180ms ease,
color 180ms ease;
}
.view-button:last-child {
border-right: 0;
}
.view-button:hover {
background: rgba(255, 255, 255, 0.45);
}
.view-button:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -3px;
}
.view-button[aria-pressed="true"] {
background: rgba(255, 255, 255, 0.72);
}
.view-button[aria-pressed="true"]::before {
position: absolute;
top: 9px;
bottom: 9px;
left: 0;
width: 3px;
background: var(--accent);
content: "";
}
.button-index {
display: block;
margin-bottom: 3px;
font-size: 8px;
font-weight: 800;
letter-spacing: 0.18em;
color: var(--accent);
}
.button-name {
display: block;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.035em;
}
.hint {
margin-top: 9px;
font-size: 9px;
font-weight: 650;
letter-spacing: 0.12em;
text-transform: uppercase;
color: rgba(34, 39, 37, 0.58);
pointer-events: none;
}
.no-webgl {
position: fixed;
z-index: 100;
inset: 0;
display: grid;
place-items: center;
padding: 30px;
background: #d8d5cd;
text-align: center;
}
@media (max-width: 760px) {
.intro {
top: 18px;
left: 18px;
max-width: 245px;
}
.intro-copy {
display: none;
}
.source-rail {
top: 16px;
right: 14px;
width: 155px;
padding: 9px;
}
.source-panel {
aspect-ratio: 0.9;
}
.view-controls {
right: 12px;
left: 12px;
bottom: 14px;
transform: none;
}
.buttons,
.view-button {
width: 100%;
}
.view-button {
min-width: 0;
padding: 10px 7px;
text-align: center;
}
.button-name {
font-size: 9px;
}
.hint {
font-size: 8px;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
}
}
</style>
</head>
<body>
<main id="stage" aria-label="Interactive abstract plinth with three viewing positions"></main>
<header class="intro">
<p class="eyebrow">Comparative form study</p>
<h1>Abstract<br>plinth</h1>
<p class="intro-copy">
Three fixed viewpoints reveal different overlaps and sight lines.
This is a non-site-specific study; no real monument is represented.
</p>
</header>
<aside class="source-rail" aria-label="Reserved source area">
<div class="source-heading">Source panels</div>
<div class="source-panels">
<div class="source-panel" role="img" aria-label="Empty source panel 1"></div>
<div class="source-panel" role="img" aria-label="Empty source panel 2"></div>
<div class="source-panel" role="img" aria-label="Empty source panel 3"></div>
</div>
</aside>
<div class="view-label" id="label-0" style="color: #c86f3d">01</div>
<div class="view-label" id="label-1" style="color: #277f96">02</div>
<div class="view-label" id="label-2" style="color: #aa526d">03</div>
<nav class="view-controls" aria-label="Viewing positions">
<div class="buttons">
<button
class="view-button"
type="button"
data-view="0"
aria-pressed="true"
style="--accent: #c86f3d"
>
<span class="button-index">01</span>
<span class="button-name">Low right</span>
</button>
<button
class="view-button"
type="button"
data-view="1"
aria-pressed="false"
style="--accent: #277f96"
>
<span class="button-index">02</span>
<span class="button-name">Low left</span>
</button>
<button
class="view-button"
type="button"
data-view="2"
aria-pressed="false"
style="--accent: #aa526d"
>
<span class="button-index">03</span>
<span class="button-name">Elevated rear</span>
</button>
</div>
<div class="hint">Drag to inspect · Scroll to zoom</div>
</nav>
<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.querySelector("#stage");
const buttons = [...document.querySelectorAll(".view-button")];
const labels = [
document.querySelector("#label-0"),
document.querySelector("#label-1"),
document.querySelector("#label-2")
];
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xd8d5cd);
scene.fog = new THREE.Fog(0xd8d5cd, 14, 31);
const camera = new THREE.PerspectiveCamera(
39,
innerWidth / innerHeight,
0.1,
100
);
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setSize(innerWidth, innerHeight);
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
stage.appendChild(renderer.domElement);
renderer.domElement.setAttribute(
"aria-label",
"A stylized abstract sculpture on a plinth, viewed from three positions"
);
const controls = {
target: new THREE.Vector3(0, 2.65, 0),
enabled: true,
dragging: false,
pointerX: 0,
pointerY: 0
};
const reducedMotion = matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
const views = [
{
name: "Low right",
eye: new THREE.Vector3(6.8, 3.05, 7.4),
target: new THREE.Vector3(-0.08, 2.72, 0.02),
color: 0xc86f3d
},
{
name: "Low left",
eye: new THREE.Vector3(-6.8, 2.4, 5.6),
target: new THREE.Vector3(0.02, 2.65, 0.02),
color: 0x277f96
},
{
name: "Elevated rear",
eye: new THREE.Vector3(4.4, 7.4, -6.3),
target: new THREE.Vector3(-0.04, 2.62, 0),
color: 0xaa526d
}
];
camera.position.copy(views[0].eye);
camera.lookAt(controls.target);
const hemi = new THREE.HemisphereLight(0xfffbf1, 0x69706d, 2.25);
scene.add(hemi);
const key = new THREE.DirectionalLight(0xfff2dd, 3.15);
key.position.set(4.5, 10, 6.5);
key.castShadow = true;
key.shadow.mapSize.set(2048, 2048);
key.shadow.camera.near = 0.5;
key.shadow.camera.far = 30;
key.shadow.camera.left = -8;
key.shadow.camera.right = 8;
key.shadow.camera.top = 9;
key.shadow.camera.bottom = -7;
key.shadow.bias = -0.0004;
key.shadow.normalBias = 0.025;
scene.add(key);
const fill = new THREE.DirectionalLight(0xc9e5ef, 1.15);
fill.position.set(-6, 4.5, -5);
scene.add(fill);
const floorMaterial = new THREE.MeshStandardMaterial({
color: 0xcfcac0,
roughness: 0.98,
metalness: 0
});
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(42, 42),
floorMaterial
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.12;
floor.receiveShadow = true;
scene.add(floor);
const daisMaterial = new THREE.MeshStandardMaterial({
color: 0xdad6cd,
roughness: 0.94
});
const dais = new THREE.Mesh(
new THREE.CylinderGeometry(6.15, 6.25, 0.08, 128),
daisMaterial
);
dais.position.y = -0.04;
dais.receiveShadow = true;
scene.add(dais);
const daisEdge = new THREE.Mesh(
new THREE.RingGeometry(6.1, 6.115, 160),
new THREE.MeshBasicMaterial({
color: 0x9f9b92,
transparent: true,
opacity: 0.36,
side: THREE.DoubleSide
})
);
daisEdge.rotation.x = -Math.PI / 2;
daisEdge.position.y = 0.006;
scene.add(daisEdge);
const centerRing = new THREE.Mesh(
new THREE.RingGeometry(2.7, 2.708, 128),
new THREE.MeshBasicMaterial({
color: 0xaaa69e,
transparent: true,
opacity: 0.25,
side: THREE.DoubleSide
})
);
centerRing.rotation.x = -Math.PI / 2;
centerRing.position.y = 0.008;
scene.add(centerRing);
const darkMaterial = new THREE.MeshStandardMaterial({
color: 0x2b302e,
roughness: 0.84,
metalness: 0.02
});
const midMaterial = new THREE.MeshStandardMaterial({
color: 0xaaa79f,
roughness: 0.92
});
const stoneMaterial = new THREE.MeshStandardMaterial({
color: 0xeeeae0,
roughness: 0.79
});
const blueMaterial = new THREE.MeshStandardMaterial({
color: 0x355f73,
roughness: 0.7
});
const goldMaterial = new THREE.MeshStandardMaterial({
color: 0xd0a34d,
roughness: 0.76
});
const redMaterial = new THREE.MeshStandardMaterial({
color: 0xb95642,
roughness: 0.66,
flatShading: true
});
function addBox(size, position, material, rotation = [0, 0, 0]) {
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(...size),
material
);
mesh.position.set(...position);
mesh.rotation.set(...rotation);
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
return mesh;
}
// Stepped abstract plinth.
addBox([2.85, 0.34, 2.35], [0, 0.17, 0], darkMaterial);
addBox([2.38, 1.28, 1.88], [0, 0.98, 0], midMaterial);
addBox([2.58, 0.14, 2.07], [0, 1.69, 0], darkMaterial);
// A non-representational assembly of solid forms.
addBox(
[0.76, 2.72, 0.74],
[-0.28, 3.12, 0.02],
stoneMaterial,
[0, 0.08, 0]
);
addBox(
[0.92, 0.82, 1.0],
[0.48, 2.22, 0.28],
blueMaterial,
[-0.04, -0.12, -0.11]
);
const wedgeShape = new THREE.Shape();
wedgeShape.moveTo(-0.62, -0.82);
wedgeShape.lineTo(0.66, -0.82);
wedgeShape.lineTo(0.05, 1.0);
wedgeShape.closePath();
const wedgeGeometry = new THREE.ExtrudeGeometry(wedgeShape, {
depth: 0.58,
steps: 1,
bevelEnabled: true,
bevelSegments: 2,
bevelSize: 0.035,
bevelThickness: 0.035,
curveSegments: 1
});
wedgeGeometry.center();
const wedge = new THREE.Mesh(wedgeGeometry, goldMaterial);
wedge.position.set(0.57, 3.15, -0.43);
wedge.rotation.set(0.03, -0.16, 0.07);
wedge.castShadow = true;
wedge.receiveShadow = true;
scene.add(wedge);
const sphere = new THREE.Mesh(
new THREE.IcosahedronGeometry(0.43, 2),
redMaterial
);
sphere.position.set(0.43, 3.91, 0.04);
sphere.rotation.set(0.18, 0.4, -0.08);
sphere.castShadow = true;
sphere.receiveShadow = true;
scene.add(sphere);
const viewGraphics = [];
function createViewGraphic(view, index) {
const origin = view.eye.clone();
const center = view.target.clone();
const forward = center.clone().sub(origin).normalize();
const right = new THREE.Vector3()
.crossVectors(forward, new THREE.Vector3(0, 1, 0))
.normalize();
const up = new THREE.Vector3()
.crossVectors(right, forward)
.normalize();
const halfWidth = 1.13;
const halfHeight = 1.36;
const corners = [
center.clone()
.addScaledVector(right, -halfWidth)
.addScaledVector(up, -halfHeight),
center.clone()
.addScaledVector(right, halfWidth)
.addScaledVector(up, -halfHeight),
center.clone()
.addScaledVector(right, halfWidth)
.addScaledVector(up, halfHeight),
center.clone()
.addScaledVector(right, -halfWidth)
.addScaledVector(up, halfHeight)
];
const lineMaterial = new THREE.LineBasicMaterial({
color: view.color,
transparent: true,
opacity: index === 0 ? 0.64 : 0.15,
depthTest: false,
depthWrite: false
});
const group = new THREE.Group();
const rayEnds = [...corners, center];
rayEnds.forEach((end) => {
const geometry = new THREE.BufferGeometry().setFromPoints([
origin,
end
]);
const ray = new THREE.Line(geometry, lineMaterial);
ray.renderOrder = 10;
group.add(ray);
});
const trianglePositions = [];
for (let i = 0; i < corners.length; i++) {
const next = corners[(i + 1) % corners.length];
trianglePositions.push(
origin.x, origin.y, origin.z,
corners[i].x, corners[i].y, corners[i].z,
next.x, next.y, next.z
);
}
const fanGeometry = new THREE.BufferGeometry();
fanGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(trianglePositions, 3)
);
const fanMaterial = new THREE.MeshBasicMaterial({
color: view.color,
transparent: true,
opacity: index === 0 ? 0.045 : 0.008,
side: THREE.DoubleSide,
depthWrite: false
});
const fan = new THREE.Mesh(fanGeometry, fanMaterial);
fan.renderOrder = 5;
group.add(fan);
const targetDot = new THREE.Mesh(
new THREE.SphereGeometry(0.055, 12, 12),
new THREE.MeshBasicMaterial({
color: view.color,
depthTest: false
})
);
targetDot.position.copy(center);
targetDot.renderOrder = 11;
group.add(targetDot);
const floorPoint = new THREE.Vector3(
origin.x,
-0.07,
origin.z
);
const markerMaterial = new THREE.MeshBasicMaterial({
color: view.color,
transparent: true,
opacity: index === 0 ? 0.95 : 0.55,
side: THREE.DoubleSide,
depthWrite: false
});
const markerRing = new THREE.Mesh(
new THREE.RingGeometry(0.31, 0.39, 64),
markerMaterial
);
markerRing.rotation.x = -Math.PI / 2;
markerRing.position.copy(floorPoint);
markerRing.position.y = -0.072;
group.add(markerRing);
const markerCenter = new THREE.Mesh(
new THREE.CircleGeometry(0.075, 32),
markerMaterial
);
markerCenter.rotation.x = -Math.PI / 2;
markerCenter.position.copy(markerRing.position);
markerCenter.position.y += 0.001;
group.add(markerCenter);
const verticalGuide = new THREE.Line(
new THREE.BufferGeometry().setFromPoints([
floorPoint,
origin
]),
lineMaterial
);
verticalGuide.renderOrder = 9;
group.add(verticalGuide);
scene.add(group);
viewGraphics.push({
group,
lineMaterial,
fanMaterial,
markerMaterial,
labelPosition: new THREE.Vector3(
origin.x,
0.12,
origin.z
)
});
}
views.forEach(createViewGraphic);
let activeView = 0;
let transition = null;
function setActiveView(index) {
activeView = index;
buttons.forEach((button, buttonIndex) => {
button.setAttribute(
"aria-pressed",
String(buttonIndex === activeView)
);
});
document.documentElement.style.setProperty(
"--active",
`#${views[activeView].color.toString(16).padStart(6, "0")}`
);
viewGraphics.forEach((graphic, graphicIndex) => {
const active = graphicIndex === activeView;
graphic.lineMaterial.opacity = active ? 0.64 : 0.13;
graphic.fanMaterial.opacity = active ? 0.045 : 0.006;
graphic.markerMaterial.opacity = active ? 0.95 : 0.48;
});
}
function moveToView(index) {
setActiveView(index);
const destination = views[index];
if (reducedMotion) {
camera.position.copy(destination.eye);
controls.target.copy(destination.target);
camera.lookAt(controls.target);
transition = null;
return;
}
transition = {
start: performance.now(),
duration: 1050,
fromPosition: camera.position.clone(),
fromTarget: controls.target.clone(),
toPosition: destination.eye.clone(),
toTarget: destination.target.clone()
};
}
buttons.forEach((button) => {
button.addEventListener("click", () => {
moveToView(Number(button.dataset.view));
});
});
addEventListener("keydown", (event) => {
if (event.key === "1") moveToView(0);
if (event.key === "2") moveToView(1);
if (event.key === "3") moveToView(2);
});
function applyOrbitOffset(offset) {
camera.position.copy(controls.target).add(offset);
camera.lookAt(controls.target);
}
renderer.domElement.addEventListener("pointerdown", (event) => {
if (event.button !== 0) return;
transition = null;
controls.dragging = true;
controls.enabled = true;
controls.pointerX = event.clientX;
controls.pointerY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!controls.dragging || !controls.enabled) return;
const dx = event.clientX - controls.pointerX;
const dy = event.clientY - controls.pointerY;
controls.pointerX = event.clientX;
controls.pointerY = event.clientY;
const offset = camera.position.clone().sub(controls.target);
const spherical = new THREE.Spherical().setFromVector3(offset);
spherical.theta -= dx * 0.0055;
spherical.phi = THREE.MathUtils.clamp(
spherical.phi - dy * 0.0045,
0.2,
Math.PI * 0.49
);
offset.setFromSpherical(spherical);
applyOrbitOffset(offset);
});
function endDrag(event) {
controls.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();
transition = null;
const offset = camera.position.clone().sub(controls.target);
const spherical = new THREE.Spherical().setFromVector3(offset);
spherical.radius = THREE.MathUtils.clamp(
spherical.radius * Math.exp(event.deltaY * 0.001),
4.2,
17
);
offset.setFromSpherical(spherical);
applyOrbitOffset(offset);
},
{ passive: false }
);
function updateLabels() {
const width = innerWidth;
const height = innerHeight;
viewGraphics.forEach((graphic, index) => {
const projected = graphic.labelPosition.clone().project(camera);
const visible =
projected.z > -1 &&
projected.z < 1 &&
Math.abs(projected.x) < 1.08 &&
Math.abs(projected.y) < 1.08;
const label = labels[index];
label.style.opacity = visible ? "1" : "0";
label.style.left = `${(projected.x * 0.5 + 0.5) * width}px`;
label.style.top = `${(-projected.y * 0.5 + 0.5) * height}px`;
});
}
function easeInOutCubic(value) {
return value < 0.5
? 4 * value * value * value
: 1 - Math.pow(-2 * value + 2, 3) / 2;
}
function animate(time) {
requestAnimationFrame(animate);
if (transition) {
const raw = THREE.MathUtils.clamp(
(time - transition.start) / transition.duration,
0,
1
);
const eased = easeInOutCubic(raw);
camera.position.lerpVectors(
transition.fromPosition,
transition.toPosition,
eased
);
controls.target.lerpVectors(
transition.fromTarget,
transition.toTarget,
eased
);
camera.lookAt(controls.target);
if (raw >= 1) {
transition = null;
}
}
updateLabels();
renderer.render(scene, camera);
}
function resize() {
camera.aspect = innerWidth / innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(innerWidth, innerHeight);
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
}
addEventListener("resize", resize);
setActiveView(0);
requestAnimationFrame(animate);
</script>
</body>
</html>
```