Prompt specification
Build or customize the Three.js 3D scene "Arch Sculpture and Its Central Void" 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: Arch Sculpture and Its Central Void
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/arch-sculpture-and-its-central-void-x3345
Scene Description Prompt:
Make a stylized Three.js scene in a self-contained HTML file using cdnjs: arch sculpture and its central void. Model a thick arch with a clear opening on a neutral base. Frame both solid material and negative space so the void has a readable silhouette.
Working Three.js Starter (arch-sculpture-and-its-central-void-x3345):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Arch / Central Void</title>
<style>
:root {
color-scheme: light;
font-family: Inter, ui-sans-serif, system-ui, -apple-system,
BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #cbc9c2;
}
canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.vignette {
position: fixed;
inset: 0;
pointer-events: none;
background:
radial-gradient(
ellipse at 50% 44%,
transparent 42%,
rgba(55, 48, 42, 0.08) 100%
);
}
.caption {
position: fixed;
left: clamp(20px, 4vw, 56px);
bottom: clamp(20px, 4vw, 42px);
color: #4f4942;
pointer-events: none;
user-select: none;
}
.caption strong {
display: block;
margin-bottom: 5px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.22em;
text-transform: uppercase;
}
.caption span {
font-size: 11px;
letter-spacing: 0.06em;
opacity: 0.72;
}
.controls {
position: fixed;
right: clamp(18px, 3vw, 42px);
bottom: clamp(18px, 3vw, 38px);
display: flex;
align-items: center;
gap: 14px;
color: #5e574f;
font-size: 10px;
letter-spacing: 0.12em;
text-transform: uppercase;
}
button {
width: 38px;
height: 38px;
border: 1px solid rgba(74, 67, 60, 0.24);
border-radius: 50%;
background: rgba(244, 241, 234, 0.54);
color: #5e574f;
cursor: pointer;
backdrop-filter: blur(8px);
transition:
background 160ms ease,
transform 160ms ease;
}
button:hover {
background: rgba(255, 253, 248, 0.88);
transform: rotate(-15deg);
}
button:focus-visible {
outline: 2px solid #d85e3d;
outline-offset: 3px;
}
button svg {
width: 17px;
height: 17px;
display: block;
margin: auto;
}
.fallback {
position: fixed;
inset: 0;
display: none;
place-items: center;
padding: 32px;
color: #403a35;
background: #d7d3ca;
text-align: center;
}
@media (max-width: 620px) {
.controls span {
display: none;
}
.caption span {
display: none;
}
}
</style>
</head>
<body>
<div class="vignette" aria-hidden="true"></div>
<div class="caption" aria-hidden="true">
<strong>Arch / Central Void</strong>
<span>Material, mass, and negative space</span>
</div>
<div class="controls">
<span>Drag to orbit · Scroll to zoom</span>
<button id="reset" type="button" aria-label="Reset camera view" title="Reset view">
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path
d="M4.7 9A7.5 7.5 0 1 1 5 15.5M4.7 9V4.5M4.7 9H9.2"
stroke="currentColor"
stroke-width="1.6"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
</div>
<div id="fallback" class="fallback">
This scene requires WebGL and a browser with ES module support.
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const canvas = document.createElement("canvas");
canvas.tabIndex = 0;
canvas.setAttribute(
"aria-label",
"Interactive three-dimensional view of a thick terracotta arch with a central opening"
);
document.body.prepend(canvas);
let renderer;
try {
renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
alpha: false,
powerPreference: "high-performance"
});
} catch (error) {
document.getElementById("fallback").style.display = "grid";
throw error;
}
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
const scene = new THREE.Scene();
scene.background = new THREE.Color("#cbc9c2");
const camera = new THREE.OrthographicCamera(-5, 5, 3, -3, 0.1, 100);
const target = new THREE.Vector3(0, 2.45, 0);
const cameraDistance = 11;
const initialView = {
yaw: 0.23,
pitch: 0.095,
zoom: 1.06
};
const view = {
yaw: initialView.yaw,
pitch: initialView.pitch,
zoom: initialView.zoom,
targetYaw: initialView.yaw,
targetPitch: initialView.pitch,
targetZoom: initialView.zoom
};
function updateCamera() {
const horizontalDistance =
cameraDistance * Math.cos(view.pitch);
camera.position.set(
Math.sin(view.yaw) * horizontalDistance,
target.y + Math.sin(view.pitch) * cameraDistance,
Math.cos(view.yaw) * horizontalDistance
);
camera.lookAt(target);
camera.zoom = view.zoom;
camera.updateProjectionMatrix();
}
function resize() {
const width = window.innerWidth;
const height = window.innerHeight;
const aspect = width / height;
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(width, height);
// Keep both the broad sculpture and the narrow mobile composition framed.
const viewHeight = aspect < 1 ? 6.4 / aspect : 6.15;
const viewWidth = viewHeight * aspect;
camera.left = -viewWidth / 2;
camera.right = viewWidth / 2;
camera.top = viewHeight / 2;
camera.bottom = -viewHeight / 2;
camera.updateProjectionMatrix();
updateCamera();
}
window.addEventListener("resize", resize);
// Lighting: warm key, cool fill, and a narrow rim define the depth.
const hemisphere = new THREE.HemisphereLight(
"#fff8ec",
"#756d64",
1.65
);
scene.add(hemisphere);
const keyLight = new THREE.DirectionalLight("#fff0d5", 3.25);
keyLight.position.set(4.5, 8.5, 6);
keyLight.target.position.copy(target);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -6;
keyLight.shadow.camera.right = 6;
keyLight.shadow.camera.top = 7;
keyLight.shadow.camera.bottom = -4;
keyLight.shadow.camera.near = 1;
keyLight.shadow.camera.far = 25;
keyLight.shadow.bias = -0.00025;
keyLight.shadow.normalBias = 0.025;
scene.add(keyLight, keyLight.target);
const fillLight = new THREE.DirectionalLight("#c9dcff", 1.15);
fillLight.position.set(-5, 3.5, 5);
scene.add(fillLight);
const rimLight = new THREE.DirectionalLight("#fffaf2", 1.7);
rimLight.position.set(2, 6, -5);
scene.add(rimLight);
// Neutral studio floor.
const floorMaterial = new THREE.MeshStandardMaterial({
color: "#e7e3da",
roughness: 0.94,
metalness: 0
});
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(40, 40),
floorMaterial
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.012;
floor.receiveShadow = true;
scene.add(floor);
// A quiet, flat backdrop gives the central opening a readable silhouette.
const backdrop = new THREE.Mesh(
new THREE.PlaneGeometry(30, 20),
new THREE.MeshBasicMaterial({ color: "#cbc9c2" })
);
backdrop.position.set(0, 5, -3.2);
scene.add(backdrop);
function roundedRectangle(width, depth, radius) {
const shape = new THREE.Shape();
const x = -width / 2;
const y = -depth / 2;
shape.moveTo(x + radius, y);
shape.lineTo(x + width - radius, y);
shape.quadraticCurveTo(x + width, y, x + width, y + radius);
shape.lineTo(x + width, y + depth - radius);
shape.quadraticCurveTo(
x + width,
y + depth,
x + width - radius,
y + depth
);
shape.lineTo(x + radius, y + depth);
shape.quadraticCurveTo(x, y + depth, x, y + depth - radius);
shape.lineTo(x, y + radius);
shape.quadraticCurveTo(x, y, x + radius, y);
shape.closePath();
return shape;
}
function createPlinth(width, depth, height, radius, y, material) {
const geometry = new THREE.ExtrudeGeometry(
roundedRectangle(width, depth, radius),
{
depth: height,
steps: 1,
curveSegments: 10,
bevelEnabled: true,
bevelThickness: 0.03,
bevelSize: 0.03,
bevelSegments: 3
}
);
geometry.rotateX(-Math.PI / 2);
geometry.translate(0, y, 0);
const mesh = new THREE.Mesh(geometry, material);
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
return mesh;
}
const lowerPlinthMaterial = new THREE.MeshStandardMaterial({
color: "#d4cec2",
roughness: 0.88
});
const upperPlinthMaterial = new THREE.MeshStandardMaterial({
color: "#eeeae1",
roughness: 0.8
});
createPlinth(
6.15,
3.2,
0.12,
0.16,
0.04,
lowerPlinthMaterial
);
createPlinth(
5.65,
2.85,
0.09,
0.12,
0.17,
upperPlinthMaterial
);
/*
The sculpture is one continuous U-shaped polygon:
outer silhouette, inner arch, and two feet.
Extruding this shape creates a genuinely open central void.
*/
const outerRadius = 2.38;
const innerRadius = 1.43;
const springLine = 2.35;
const archDepth = 1.18;
const archShape = new THREE.Shape();
// Outer left foot and exterior.
archShape.moveTo(-outerRadius, 0);
archShape.lineTo(-outerRadius, springLine);
archShape.absarc(
0,
springLine,
outerRadius,
Math.PI,
0,
true
);
// Right foot and inner edge.
archShape.lineTo(outerRadius, 0);
archShape.lineTo(innerRadius, 0);
archShape.lineTo(innerRadius, springLine);
// Inner arch, traversed in the opposite direction.
archShape.absarc(
0,
springLine,
innerRadius,
0,
Math.PI,
false
);
archShape.lineTo(-innerRadius, 0);
archShape.closePath();
const archGeometry = new THREE.ExtrudeGeometry(archShape, {
depth: archDepth,
steps: 1,
curveSegments: 72,
bevelEnabled: true,
bevelThickness: 0.085,
bevelSize: 0.085,
bevelOffset: 0,
bevelSegments: 4
});
archGeometry.translate(0, 0.275, -archDepth / 2);
archGeometry.computeVertexNormals();
const faceMaterial = new THREE.MeshStandardMaterial({
color: "#d85e3d",
roughness: 0.68,
metalness: 0.02
});
const sideMaterial = new THREE.MeshStandardMaterial({
color: "#ad422f",
roughness: 0.78,
metalness: 0
});
const arch = new THREE.Mesh(archGeometry, [
faceMaterial,
sideMaterial
]);
arch.castShadow = true;
arch.receiveShadow = true;
scene.add(arch);
// Custom camera interaction implemented without external controls.
let pointerActive = false;
let previousX = 0;
let previousY = 0;
canvas.addEventListener("pointerdown", (event) => {
pointerActive = true;
previousX = event.clientX;
previousY = event.clientY;
canvas.setPointerCapture(event.pointerId);
});
canvas.addEventListener("pointermove", (event) => {
if (!pointerActive) return;
const deltaX = event.clientX - previousX;
const deltaY = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
view.targetYaw = THREE.MathUtils.clamp(
view.targetYaw + deltaX * 0.006,
-0.72,
0.72
);
view.targetPitch = THREE.MathUtils.clamp(
view.targetPitch + deltaY * 0.004,
-0.08,
0.34
);
});
function endPointer(event) {
pointerActive = false;
if (canvas.hasPointerCapture(event.pointerId)) {
canvas.releasePointerCapture(event.pointerId);
}
}
canvas.addEventListener("pointerup", endPointer);
canvas.addEventListener("pointercancel", endPointer);
canvas.addEventListener(
"wheel",
(event) => {
event.preventDefault();
view.targetZoom = THREE.MathUtils.clamp(
view.targetZoom * Math.exp(-event.deltaY * 0.001),
0.72,
1.62
);
},
{ passive: false }
);
document.getElementById("reset").addEventListener("click", () => {
view.targetYaw = initialView.yaw;
view.targetPitch = initialView.pitch;
view.targetZoom = initialView.zoom;
});
canvas.addEventListener("keydown", (event) => {
const step = 0.08;
if (event.key === "ArrowLeft") {
view.targetYaw = THREE.MathUtils.clamp(
view.targetYaw - step,
-0.72,
0.72
);
}
if (event.key === "ArrowRight") {
view.targetYaw = THREE.MathUtils.clamp(
view.targetYaw + step,
-0.72,
0.72
);
}
if (event.key === "ArrowUp") {
view.targetPitch = THREE.MathUtils.clamp(
view.targetPitch + step,
-0.08,
0.34
);
}
if (event.key === "ArrowDown") {
view.targetPitch = THREE.MathUtils.clamp(
view.targetPitch - step,
-0.08,
0.34
);
}
if (event.key === "+" || event.key === "=") {
view.targetZoom = Math.min(view.targetZoom + 0.08, 1.62);
}
if (event.key === "-" || event.key === "_") {
view.targetZoom = Math.max(view.targetZoom - 0.08, 0.72);
}
});
function animate() {
const damping = 0.085;
view.yaw += (view.targetYaw - view.yaw) * damping;
view.pitch += (view.targetPitch - view.pitch) * damping;
view.zoom += (view.targetZoom - view.zoom) * damping;
updateCamera();
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
resize();
animate();
</script>
</body>
</html>
```