Prompt specification
Build or customize the Three.js 3D scene "Getsemaní doorway and shaded threshold" 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: Getsemaní doorway and shaded threshold
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/getseman-doorway-and-shaded-threshold-x2725
Scene Description Prompt:
Getsemaní doorway and shaded threshold. Build a referenced Cartagena doorway with small step, shutter, and shaded wall. Use original surface decoration and show the threshold as a transition between home and street. Please build this with Three.js from cdnjs in one self-contained HTML file, using visible voxel blocks.
Working Three.js Starter (getseman-doorway-and-shaded-threshold-x2725):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Getsemaní Threshold — Voxel Cartagena</title>
<style>
:root {
color-scheme: dark;
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: #c7d5d3;
}
canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.caption {
position: fixed;
top: 24px;
left: 28px;
z-index: 10;
max-width: min(390px, calc(100vw - 56px));
color: #fff7e9;
text-shadow: 0 2px 18px rgba(32, 24, 29, 0.65);
pointer-events: none;
}
.eyebrow {
margin-bottom: 7px;
font-size: 10px;
font-weight: 750;
letter-spacing: 0.24em;
text-transform: uppercase;
opacity: 0.86;
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(29px, 4vw, 49px);
font-weight: 400;
line-height: 0.98;
letter-spacing: -0.035em;
}
.subtitle {
margin-top: 10px;
font-size: 12px;
line-height: 1.5;
opacity: 0.86;
}
.hint {
position: fixed;
right: 24px;
bottom: 20px;
z-index: 10;
padding: 9px 12px;
border: 1px solid rgba(255, 255, 255, 0.22);
border-radius: 999px;
color: rgba(255, 255, 255, 0.88);
background: rgba(35, 45, 52, 0.42);
backdrop-filter: blur(8px);
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
pointer-events: none;
}
@media (max-width: 600px) {
.caption {
top: 18px;
left: 19px;
}
.subtitle {
max-width: 250px;
}
.hint {
right: 50%;
bottom: 13px;
transform: translateX(50%);
white-space: nowrap;
}
}
</style>
</head>
<body>
<div class="caption">
<div class="eyebrow">Cartagena · Colombia</div>
<h1>Getsemaní<br />Threshold</h1>
<div class="subtitle">
A voxel study of the colorful colonial street, ceramic frame, blue shutter,
and small stone step between home and street.
</div>
</div>
<div class="hint">Drag to orbit · wheel to zoom · double-click to reset</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// -------------------------------------------------------------------------
// Renderer and scene
// -------------------------------------------------------------------------
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xc7d5d3);
scene.fog = new THREE.Fog(0xc7d5d3, 27, 48);
const camera = new THREE.PerspectiveCamera(
38,
innerWidth / innerHeight,
0.1,
100
);
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.setSize(innerWidth, innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
document.body.prepend(renderer.domElement);
const hemi = new THREE.HemisphereLight(0xcfe8ee, 0x655044, 1.65);
scene.add(hemi);
const sun = new THREE.DirectionalLight(0xffd4a0, 3.25);
sun.position.set(-8, 14, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -12;
sun.shadow.camera.right = 12;
sun.shadow.camera.top = 13;
sun.shadow.camera.bottom = -6;
sun.shadow.camera.near = 0.5;
sun.shadow.camera.far = 40;
sun.shadow.bias = -0.00035;
sun.shadow.normalBias = 0.025;
sun.target.position.set(0, 2.6, 0);
scene.add(sun, sun.target);
const interiorLight = new THREE.PointLight(0xff9a4d, 17, 6, 2);
interiorLight.position.set(0.35, 2.45, -0.85);
scene.add(interiorLight);
// -------------------------------------------------------------------------
// Seeded variation
// -------------------------------------------------------------------------
let randomSeed = 82431;
function random() {
randomSeed =
(randomSeed * 1664525 + 1013904223) >>> 0;
return randomSeed / 4294967296;
}
function choose(items) {
return items[Math.floor(random() * items.length)];
}
function vary(color, lightness = 0.045, saturation = 0.025) {
const result = new THREE.Color(color);
result.offsetHSL(
(random() - 0.5) * 0.018,
(random() - 0.5) * saturation,
(random() - 0.5) * lightness
);
return result;
}
// -------------------------------------------------------------------------
// Instanced voxel batches
// -------------------------------------------------------------------------
const unitBox = new THREE.BoxGeometry(1, 1, 1);
function createBatch(name, options = {}) {
return {
name,
options,
matrices: [],
colors: []
};
}
const batches = {
stucco: createBatch("stucco", {
roughness: 0.94,
metalness: 0
}),
stone: createBatch("stone", {
roughness: 0.96,
metalness: 0
}),
tile: createBatch("tile", {
roughness: 0.48,
metalness: 0.02
}),
wood: createBatch("wood", {
roughness: 0.76,
metalness: 0
}),
metal: createBatch("metal", {
roughness: 0.42,
metalness: 0.48
}),
street: createBatch("street", {
roughness: 1,
metalness: 0
}),
interior: createBatch("interior", {
roughness: 0.92,
metalness: 0
}),
glow: createBatch("glow", {
roughness: 0.8,
metalness: 0,
emissive: 0xff7a32,
emissiveIntensity: 1.8
})
};
const tempPosition = new THREE.Vector3();
const tempScale = new THREE.Vector3();
const tempQuaternion = new THREE.Quaternion();
const tempEuler = new THREE.Euler();
const localMatrix = new THREE.Matrix4();
const worldMatrix = new THREE.Matrix4();
function box(
batchName,
size,
position,
color,
rotation = [0, 0, 0],
parentMatrix = null
) {
tempPosition.set(...position);
tempScale.set(...size);
tempEuler.set(...rotation);
tempQuaternion.setFromEuler(tempEuler);
localMatrix.compose(tempPosition, tempQuaternion, tempScale);
if (parentMatrix) {
worldMatrix.multiplyMatrices(parentMatrix, localMatrix);
} else {
worldMatrix.copy(localMatrix);
}
batches[batchName].matrices.push(worldMatrix.clone());
batches[batchName].colors.push(
color instanceof THREE.Color ? color.clone() : new THREE.Color(color)
);
}
function finalizeBatch(batch) {
if (!batch.matrices.length) return;
const material = new THREE.MeshStandardMaterial({
color: 0xffffff,
roughness: batch.options.roughness ?? 0.9,
metalness: batch.options.metalness ?? 0,
emissive: batch.options.emissive ?? 0x000000,
emissiveIntensity: batch.options.emissiveIntensity ?? 1
});
const mesh = new THREE.InstancedMesh(
unitBox,
material,
batch.matrices.length
);
for (let i = 0; i < batch.matrices.length; i++) {
mesh.setMatrixAt(i, batch.matrices[i]);
mesh.setColorAt(i, batch.colors[i]);
}
mesh.instanceMatrix.needsUpdate = true;
if (mesh.instanceColor) mesh.instanceColor.needsUpdate = true;
mesh.castShadow = true;
mesh.receiveShadow = true;
mesh.computeBoundingSphere();
scene.add(mesh);
}
// -------------------------------------------------------------------------
// Voxel street
// -------------------------------------------------------------------------
const streetColors = [
0x59656a,
0x687276,
0x4f5c62,
0x746e68,
0x7b6964,
0x56646b,
0x81776c
];
const streetCell = 0.5;
for (let ix = -17; ix <= 17; ix++) {
for (let iz = 0; iz < 19; iz++) {
const x = ix * streetCell + (random() - 0.5) * 0.025;
const z = 0.18 + iz * streetCell + (random() - 0.5) * 0.025;
const height = 0.105 + random() * 0.035;
box(
"street",
[streetCell - 0.025, height, streetCell - 0.025],
[x, -height / 2, z],
vary(choose(streetColors), 0.055, 0.035)
);
}
}
// Sparse green deposits near the old threshold.
for (let i = 0; i < 17; i++) {
const x = (random() - 0.5) * 4.5;
const z = 0.7 + random() * 2.3;
box(
"street",
[0.12 + random() * 0.12, 0.025, 0.1 + random() * 0.12],
[x, 0.012, z],
choose([0x66705a, 0x59644d, 0x77755b])
);
}
// -------------------------------------------------------------------------
// Main facade: individual visible masonry voxels
// -------------------------------------------------------------------------
const cell = 0.4;
const columns = 29;
const rows = 21;
const warmPlaster = [
0xc66f53,
0xd07a59,
0xc56b56,
0xd28260,
0xb96150,
0xd17b65
];
const shadedPlaster = [
0x976674,
0x8e616e,
0xa06b76,
0x8a5e6b,
0xa9747c
];
const stoneBlue = [
0x455761,
0x4d6069,
0x3f5059,
0x59666c
];
for (let row = 0; row < rows; row++) {
for (let col = 0; col < columns; col++) {
const x = (col - (columns - 1) / 2) * cell;
const y = (row + 0.5) * cell;
// Leave a true opening in the masonry for the recessed doorway.
if (Math.abs(x) < 1.0 && y < 4.4) continue;
let color;
if (row < 2) {
color = vary(choose(stoneBlue), 0.045, 0.03);
} else if (row >= 19) {
color = vary(choose([0xc49459, 0xb9864f, 0xd0a163]), 0.04, 0.03);
} else if (row === 4) {
color = vary(choose([0xd0a66c, 0xc59b61, 0xb78f58]), 0.035, 0.03);
} else if (row === 17) {
color = vary(choose([0x537a80, 0x456d75, 0x60838a]), 0.035, 0.03);
} else if (x > 1.55) {
color = vary(choose(shadedPlaster), 0.038, 0.025);
} else {
color = vary(choose(warmPlaster), 0.045, 0.035);
}
box(
"stucco",
[cell - 0.014, cell - 0.014, 0.5],
[x, y, 0],
color
);
}
}
// A slightly projecting top course gives the wall a substantial silhouette.
for (let col = 0; col < columns; col++) {
const x = (col - (columns - 1) / 2) * cell;
box(
"stucco",
[0.386, 0.22, 0.68],
[x, 8.28, 0.06],
vary(choose([0xb77850, 0xc28155, 0xa96e4d]), 0.04, 0.025)
);
}
// -------------------------------------------------------------------------
// Original surface decoration: tile frame, friezes, and pixel motif
// -------------------------------------------------------------------------
const cobalt = 0x315d78;
const turquoise = 0x3d8790;
const cream = 0xe3cfaa;
const ochre = 0xd39b47;
const coral = 0xc5654d;
const indigo = 0x403e62;
// Ceramic blocks down both sides of the opening.
for (const side of [-1, 1]) {
for (let i = 0; i < 19; i++) {
const y = 0.48 + i * 0.205;
let color;
if (i % 4 === 0) color = ochre;
else if (i % 4 === 2) color = turquoise;
else color = cobalt;
box(
"tile",
[0.185, 0.185, 0.105],
[side * 1.095, y, 0.305],
vary(color, 0.025, 0.02)
);
}
}
// Header mosaic.
for (let i = -6; i <= 6; i++) {
let color;
if (i === 0) color = ochre;
else if (Math.abs(i) % 3 === 0) color = cream;
else if (Math.abs(i) % 2 === 0) color = coral;
else color = cobalt;
box(
"tile",
[0.185, 0.185, 0.105],
[i * 0.205, 4.39, 0.305],
vary(color, 0.025, 0.02)
);
}
// Stepped pixel sun / diamond over the lintel.
const motif = [
[0, 0, ochre],
[-1, 1, coral],
[1, 1, coral],
[-2, 2, turquoise],
[2, 2, turquoise],
[-1, 2, cobalt],
[1, 2, cobalt],
[0, 2, cream]
];
for (const [mx, my, color] of motif) {
box(
"tile",
[0.185, 0.185, 0.13],
[mx * 0.205, 4.68 + my * 0.205, 0.34],
vary(color, 0.025, 0.02)
);
}
// A restrained upper decorative band.
for (let i = -13; i <= 13; i++) {
if (Math.abs(i) % 5 === 0) continue;
box(
"tile",
[0.16, 0.13, 0.075],
[i * 0.38, 5.78, 0.285],
vary(i % 3 === 0 ? turquoise : coral, 0.025, 0.02)
);
}
// Small raised plaster and ceramic fragments create a hand-built surface.
for (let i = 0; i < 38; i++) {
const side = random() > 0.5 ? 1 : -1;
const x = side * (1.7 + random() * 3.4);
const y = 0.9 + random() * 4.8;
if (Math.abs(x) < 1.4) continue;
box(
random() > 0.45 ? "tile" : "stucco",
[0.13 + random() * 0.13, 0.13 + random() * 0.16, 0.06],
[x, y, 0.3],
vary(choose([0xe0c19a, 0xc1845f, 0x3e7180, 0xb75e51]), 0.035, 0.025)
);
}
// -------------------------------------------------------------------------
// Stone jambs, lintel, and shallow shade-producing canopy
// -------------------------------------------------------------------------
for (let i = 0; i < 19; i++) {
const y = 0.47 + i * 0.215;
for (const side of [-1, 1]) {
box(
"stone",
[0.21, 0.202, 0.34],
[side * 1.015, y, 0.18],
vary(choose([0xc6ad87, 0xbda27e, 0xd0b994]), 0.045, 0.03)
);
}
}
for (let i = -5; i <= 5; i++) {
box(
"stone",
[0.205, 0.21, 0.35],
[i * 0.215, 4.43, 0.18],
vary(choose([0xc7ae88, 0xbca17e, 0xd1ba96]), 0.045, 0.03)
);
}
// Projecting voxel cornice. Its real cast shadow shades the wall and entry.
for (let row = 0; row < 2; row++) {
for (let i = -7; i <= 7; i++) {
box(
"stone",
[0.196, 0.18, 0.72 - row * 0.13],
[i * 0.205, 4.79 + row * 0.185, 0.48 - row * 0.05],
vary(
row === 0
? choose([0xd1b993, 0xc3a782, 0xd9c29c])
: choose([0xb69773, 0xc0a27e]),
0.04,
0.03
)
);
}
}
// Underside accent blocks beneath the canopy.
for (let i = -6; i <= 6; i++) {
box(
"tile",
[0.17, 0.09, 0.17],
[i * 0.205, 4.66, 0.76],
vary(i % 2 === 0 ? cobalt : ochre, 0.025, 0.02)
);
}
// -------------------------------------------------------------------------
// Recessed doorway interior
// -------------------------------------------------------------------------
// Warm interior back wall.
for (let row = 0; row < 10; row++) {
for (let col = -2; col <= 2; col++) {
box(
"interior",
[0.36, 0.36, 0.32],
[col * 0.38, 0.58 + row * 0.38, -1.72],
vary(
choose([0xa85d43, 0xb86b49, 0xc07850, 0x99553f]),
0.04,
0.025
)
);
}
}
// Interior side reveals.
for (const side of [-1, 1]) {
for (let i = 0; i < 9; i++) {
box(
"interior",
[0.18, 0.35, 0.36],
[side * 0.91, 0.56 + i * 0.36, -0.18 - i * 0.17],
vary(0x8e5548, 0.04, 0.025)
);
}
}
// Interior floor, slightly raised above the street.
for (let row = 0; row < 5; row++) {
for (let col = -3; col <= 3; col++) {
box(
"tile",
[0.345, 0.12, 0.36],
[col * 0.37, 0.34, 0.09 - row * 0.38],
vary(
choose([0xb9865e, 0xc4956a, 0x9d7355, 0xd0a277]),
0.04,
0.035
)
);
}
}
// A small warm square of light visible behind the open shutter.
box("glow", [0.19, 0.19, 0.1], [0.47, 2.65, -1.52], 0xffa24d);
// -------------------------------------------------------------------------
// Voxel threshold and small step
// -------------------------------------------------------------------------
const stepColors = [
0x536b70,
0x60777b,
0x455c63,
0x718184,
0x64777a
];
// Lower street step.
for (let i = 0; i < 9; i++) {
box(
"stone",
[0.27, 0.17, 0.42],
[(i - 4) * 0.28, 0.085, 1.02],
vary(choose(stepColors), 0.045, 0.03)
);
}
// Upper step / worn sill.
for (let i = 0; i < 8; i++) {
box(
"stone",
[0.275, 0.35, 0.43],
[(i - 3.5) * 0.285, 0.175, 0.65],
vary(choose(stepColors), 0.05, 0.035)
);
}
// Threshold bridge into the home.
for (let i = 0; i < 7; i++) {
box(
"tile",
[0.255, 0.34, 0.29],
[(i - 3) * 0.27, 0.17, 0.33],
vary(choose([0x916b55, 0xa17a5d, 0x805f4d]), 0.04, 0.03)
);
}
// -------------------------------------------------------------------------
// Partly open turquoise wooden shutter
// -------------------------------------------------------------------------
const shutterPivot = new THREE.Matrix4().compose(
new THREE.Vector3(-0.86, 0.43, -0.1),
new THREE.Quaternion().setFromEuler(new THREE.Euler(0, 0.38, 0)),
new THREE.Vector3(1, 1, 1)
);
const shutterColors = [
0x347982,
0x2d6f78,
0x3c858b,
0x28646d,
0x438b90
];
// Stile and rail blocks.
for (const localX of [0.065, 1.675]) {
box(
"wood",
[0.13, 3.74, 0.15],
[localX, 1.87, 0],
vary(0x245861, 0.03, 0.025),
[0, 0, 0],
shutterPivot
);
}
for (const localY of [0.08, 1.12, 2.25, 3.64]) {
box(
"wood",
[1.72, 0.14, 0.16],
[0.87, localY, 0.01],
vary(choose(shutterColors), 0.03, 0.025),
[0, 0, 0],
shutterPivot
);
}
// Horizontal louver slats.
for (let i = 0; i < 13; i++) {
const localY = 0.29 + i * 0.255;
box(
"wood",
[1.47, 0.14, 0.105],
[0.87, localY, 0.025],
vary(choose(shutterColors), 0.04, 0.03),
[-0.12, 0, 0],
shutterPivot
);
// A narrow lower lip makes each slat read clearly.
box(
"wood",
[1.45, 0.035, 0.055],
[0.87, localY - 0.065, 0.083],
vary(choose([0x215963, 0x2b6970]), 0.02, 0.02),
[0, 0, 0],
shutterPivot
);
}
// Central vertical reinforcement and small brass-colored pull.
box(
"wood",
[0.075, 2.78, 0.055],
[0.87, 1.86, 0.105],
vary(0x255d65, 0.02, 0.02),
[0, 0, 0],
shutterPivot
);
box(
"metal",
[0.13, 0.12, 0.1],
[1.48, 1.72, 0.16],
0xd3a451,
[0, 0, 0],
shutterPivot
);
// Voxel hinge blocks.
for (const localY of [0.45, 1.86, 3.28]) {
box(
"metal",
[0.16, 0.19, 0.2],
[0.025, localY, 0],
0x46565b,
[0, 0, 0],
shutterPivot
);
}
// A low interior bench visible through the opening.
for (let i = 0; i < 3; i++) {
box(
"wood",
[0.32, 0.18, 0.72],
[-0.45 + i * 0.34, 0.54, -1.31],
vary(0x79503c, 0.035, 0.025)
);
}
// -------------------------------------------------------------------------
// Finish all instanced batches
// -------------------------------------------------------------------------
Object.values(batches).forEach(finalizeBatch);
// -------------------------------------------------------------------------
// Custom orbit, zoom, touch, and reset controls
// -------------------------------------------------------------------------
const target = new THREE.Vector3(0, 2.85, 0.2);
const controls = {
theta: 0.43,
phi: 1.245,
radius: 17.7,
dragging: false,
pointerX: 0,
pointerY: 0
};
function updateCamera() {
const sinPhi = Math.sin(controls.phi);
const cosPhi = Math.cos(controls.phi);
camera.position.set(
target.x + controls.radius * sinPhi * Math.sin(controls.theta),
target.y + controls.radius * cosPhi,
target.z + controls.radius * sinPhi * Math.cos(controls.theta)
);
camera.lookAt(target);
}
function resetCamera() {
controls.theta = 0.43;
controls.phi = 1.245;
controls.radius = 17.7;
updateCamera();
}
renderer.domElement.addEventListener("pointerdown", (event) => {
controls.dragging = true;
controls.pointerX = event.clientX;
controls.pointerY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!controls.dragging) return;
const dx = event.clientX - controls.pointerX;
const dy = event.clientY - controls.pointerY;
controls.pointerX = event.clientX;
controls.pointerY = event.clientY;
controls.theta -= dx * 0.005;
controls.phi = THREE.MathUtils.clamp(
controls.phi - dy * 0.0045,
0.63,
1.46
);
updateCamera();
});
function releasePointer(event) {
controls.dragging = false;
if (event.pointerId !== undefined &&
renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
renderer.domElement.addEventListener("pointerup", releasePointer);
renderer.domElement.addEventListener("pointercancel", releasePointer);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
controls.radius = THREE.MathUtils.clamp(
controls.radius * Math.exp(event.deltaY * 0.001),
10.5,
27
);
updateCamera();
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", resetCamera);
window.addEventListener("resize", () => {
camera.aspect = innerWidth / innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(innerWidth, innerHeight);
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
});
updateCamera();
renderer.render(scene, camera);
</script>
</body>
</html>
```