Prompt specification
Build or customize the Three.js 3D scene "Historic pottery workshop loading a kiln" 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: Historic pottery workshop loading a kiln
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/historic-pottery-workshop-loading-a-kiln-x2330
Scene Description Prompt:
Create a standalone low-poly scene in one HTML file using Three.js from cdnjs. Create a referenced early modern pottery vignette with drying racks, kiln opening, and loading sequence. Keep firing represented schematically rather than providing operating temperatures or instructions.
Working Three.js Starter (historic-pottery-workshop-loading-a-kiln-x2330):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Early Modern Pottery Workshop</title>
<style>
:root {
--ink: #302820;
--paper: rgba(244, 238, 221, 0.92);
--paper-solid: #f4eed d;
--line: rgba(64, 50, 37, 0.22);
--accent: #a8532f;
--gold: #bd8739;
--shadow: rgba(39, 29, 20, 0.18);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #d9d1bf;
color: var(--ink);
font-family: Georgia, "Times New Roman", serif;
}
canvas {
position: fixed;
inset: 0;
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.wash {
position: fixed;
inset: 0;
z-index: 2;
pointer-events: none;
background:
radial-gradient(circle at 50% 44%, transparent 42%, rgba(63, 47, 32, 0.09) 100%),
linear-gradient(180deg, rgba(255,255,255,0.08), transparent 35%);
}
.title-card {
position: fixed;
top: 24px;
left: 24px;
z-index: 10;
width: min(420px, calc(100vw - 48px));
padding: 18px 20px 17px;
border: 1px solid var(--line);
border-radius: 3px;
background: var(--paper);
box-shadow: 0 12px 34px var(--shadow);
backdrop-filter: blur(8px);
}
.eyebrow {
display: flex;
align-items: center;
gap: 9px;
margin-bottom: 8px;
font: 700 10px/1.2 Arial, sans-serif;
letter-spacing: 0.19em;
text-transform: uppercase;
color: #78533b;
}
.eyebrow::before {
content: "";
width: 22px;
height: 2px;
background: var(--accent);
}
h1 {
margin: 0;
font-size: clamp(25px, 3.3vw, 38px);
line-height: 0.98;
font-weight: 500;
letter-spacing: -0.025em;
}
.subtitle {
margin: 10px 0 0;
max-width: 360px;
font: 12px/1.55 Arial, sans-serif;
color: #62564a;
}
.interpretation {
display: flex;
gap: 8px;
align-items: flex-start;
margin-top: 13px;
padding-top: 12px;
border-top: 1px solid var(--line);
font: 10px/1.45 Arial, sans-serif;
color: #6f6254;
}
.interpretation strong {
color: var(--accent);
letter-spacing: 0.08em;
text-transform: uppercase;
}
.legend {
position: fixed;
top: 24px;
right: 24px;
z-index: 10;
width: 226px;
padding: 14px 16px;
border: 1px solid var(--line);
border-radius: 3px;
background: rgba(244, 238, 221, 0.88);
box-shadow: 0 12px 34px var(--shadow);
backdrop-filter: blur(8px);
font: 11px/1.45 Arial, sans-serif;
}
.legend-title {
margin-bottom: 9px;
color: #78533b;
font-size: 9px;
font-weight: 700;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.legend-row {
display: flex;
align-items: center;
gap: 9px;
margin-top: 7px;
}
.swatch {
width: 11px;
height: 11px;
flex: 0 0 auto;
border: 1px solid rgba(40, 30, 22, 0.18);
border-radius: 2px;
}
.legend-note {
margin-top: 11px;
padding-top: 10px;
border-top: 1px solid var(--line);
color: #786b5e;
font-size: 9px;
line-height: 1.45;
}
.bottom-panel {
position: fixed;
left: 50%;
bottom: 22px;
z-index: 12;
width: min(680px, calc(100vw - 32px));
transform: translateX(-50%);
padding: 13px 15px 12px;
border: 1px solid var(--line);
border-radius: 4px;
background: rgba(244, 238, 221, 0.94);
box-shadow: 0 12px 36px var(--shadow);
backdrop-filter: blur(10px);
}
.sequence-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.sequence-copy {
min-width: 0;
}
.status {
margin: 0;
font: 700 10px/1.2 Arial, sans-serif;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--accent);
}
.phase {
margin-top: 4px;
overflow: hidden;
color: #5f5347;
font: 11px/1.35 Arial, sans-serif;
text-overflow: ellipsis;
white-space: nowrap;
}
.buttons {
display: flex;
flex: 0 0 auto;
gap: 7px;
}
button {
appearance: none;
border: 1px solid rgba(58, 43, 31, 0.25);
border-radius: 3px;
padding: 8px 12px;
background: #f8f3e8;
color: var(--ink);
cursor: pointer;
font: 700 9px/1 Arial, sans-serif;
letter-spacing: 0.1em;
text-transform: uppercase;
transition: background 120ms ease, transform 120ms ease;
}
button:hover {
background: #eadcc9;
}
button:active {
transform: translateY(1px);
}
button.primary {
border-color: #854128;
background: var(--accent);
color: #fff7e8;
}
button.primary:hover {
background: #91472a;
}
.progress-track {
height: 3px;
margin-top: 12px;
overflow: hidden;
border-radius: 10px;
background: rgba(70, 54, 39, 0.14);
}
.progress-fill {
width: 0%;
height: 100%;
background: linear-gradient(90deg, var(--accent), var(--gold));
transition: width 80ms linear;
}
.world-label {
position: fixed;
z-index: 5;
padding: 5px 8px;
transform: translate(-50%, -100%);
border: 1px solid rgba(52, 39, 28, 0.2);
border-radius: 2px;
background: rgba(244, 238, 221, 0.82);
box-shadow: 0 4px 12px rgba(45, 32, 22, 0.09);
pointer-events: none;
white-space: nowrap;
font: 700 8px/1 Arial, sans-serif;
letter-spacing: 0.12em;
text-transform: uppercase;
color: #5a4637;
opacity: 0;
transition: opacity 150ms ease;
}
.world-label::after {
content: "";
position: absolute;
left: 50%;
top: 100%;
width: 1px;
height: 13px;
background: rgba(52, 39, 28, 0.38);
}
.world-label.active {
border-color: rgba(168, 83, 47, 0.48);
color: var(--accent);
}
.help {
position: fixed;
right: 25px;
bottom: 26px;
z-index: 10;
color: rgba(49, 40, 32, 0.62);
pointer-events: none;
font: 9px/1.45 Arial, sans-serif;
text-align: right;
}
@media (max-width: 760px) {
.title-card {
top: 12px;
left: 12px;
width: calc(100vw - 24px);
padding: 14px 15px;
}
.subtitle {
max-width: 92%;
}
.legend {
display: none;
}
.bottom-panel {
bottom: 12px;
width: calc(100vw - 24px);
}
.help {
display: none;
}
.phase {
max-width: 46vw;
}
}
</style>
</head>
<body>
<div class="wash"></div>
<header class="title-card">
<div class="eyebrow">Interpretive workshop study</div>
<h1>Early Modern<br>Pottery Workshop</h1>
<p class="subtitle">
A low-poly reconstruction inspired by early-modern European pottery
workshops, drying racks, hand-thrown vessels, and a timber-framed kiln.
</p>
<div class="interpretation">
<strong>Schematic</strong>
<span>
The chamber glow represents firing symbolically. No scale, temperature,
fuel, timing, or operating data is depicted.
</span>
</div>
</header>
<aside class="legend" aria-label="Scene legend">
<div class="legend-title">Visual key</div>
<div class="legend-row">
<span class="swatch" style="background:#b86d48"></span>
<span>Red earthenware</span>
</div>
<div class="legend-row">
<span class="swatch" style="background:#7f593f"></span>
<span>Dark-glazed ware</span>
</div>
<div class="legend-row">
<span class="swatch" style="background:#d4a85b"></span>
<span>Amber chamber indication</span>
</div>
<div class="legend-note">
An interpretive composition rather than a reconstruction of one documented site.
</div>
</aside>
<div id="labels"></div>
<section class="bottom-panel" aria-label="Loading sequence controls">
<div class="sequence-row">
<div class="sequence-copy">
<p id="status" class="status" aria-live="polite">Loading sequence</p>
<div id="phase" class="phase">Four vessels move from the drying rack to the kiln chamber.</div>
</div>
<div class="buttons">
<button id="play" class="primary" type="button">Pause</button>
<button id="replay" type="button">Replay</button>
</div>
</div>
<div class="progress-track" aria-hidden="true">
<div id="progress" class="progress-fill"></div>
</div>
</section>
<div class="help">
Drag to orbit · Scroll to zoom<br>
Double-click to reset view
</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xd9d1bf);
scene.fog = new THREE.Fog(0xd9d1bf, 18, 34);
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.08;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
document.body.prepend(renderer.domElement);
const camera = new THREE.PerspectiveCamera(
37,
window.innerWidth / window.innerHeight,
0.1,
80
);
const target = new THREE.Vector3(0, 1.55, -1.2);
const initialView = {
theta: 0.62,
phi: 1.02,
distance: 18.2
};
const view = {
theta: initialView.theta,
phi: initialView.phi,
distance: initialView.distance,
desiredTheta: initialView.theta,
desiredPhi: initialView.phi,
desiredDistance: initialView.distance
};
function updateCamera() {
const sinPhi = Math.sin(view.phi);
camera.position.set(
target.x + view.distance * sinPhi * Math.sin(view.theta),
target.y + view.distance * Math.cos(view.phi),
target.z + view.distance * sinPhi * Math.cos(view.theta)
);
camera.lookAt(target);
}
updateCamera();
const hemi = new THREE.HemisphereLight(0xf6ead1, 0x665344, 1.9);
scene.add(hemi);
const sun = new THREE.DirectionalLight(0xfff1d5, 3.1);
sun.position.set(8, 12, 9);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -12;
sun.shadow.camera.right = 12;
sun.shadow.camera.top = 11;
sun.shadow.camera.bottom = -9;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 35;
sun.shadow.bias = -0.0004;
scene.add(sun);
const fill = new THREE.DirectionalLight(0x8fa7b3, 0.75);
fill.position.set(-8, 6, 2);
scene.add(fill);
const kilnLight = new THREE.PointLight(0xffa73b, 14, 7, 2);
kilnLight.position.set(3.6, 1.05, -2.65);
scene.add(kilnLight);
const mat = {
plaster: new THREE.MeshStandardMaterial({
color: 0xc9bea7, roughness: 0.96, flatShading: true
}),
plasterLight: new THREE.MeshStandardMaterial({
color: 0xd8cdb7, roughness: 1, flatShading: true
}),
timber: new THREE.MeshStandardMaterial({
color: 0x60412d, roughness: 0.93, flatShading: true
}),
timberLight: new THREE.MeshStandardMaterial({
color: 0x876044, roughness: 0.9, flatShading: true
}),
darkWood: new THREE.MeshStandardMaterial({
color: 0x38281f, roughness: 1, flatShading: true
}),
clayRed: new THREE.MeshStandardMaterial({
color: 0xb86843, roughness: 0.93, flatShading: true
}),
clayOchre: new THREE.MeshStandardMaterial({
color: 0xc48652, roughness: 0.93, flatShading: true
}),
clayPale: new THREE.MeshStandardMaterial({
color: 0xd1aa7c, roughness: 0.96, flatShading: true
}),
clayDark: new THREE.MeshStandardMaterial({
color: 0x704936, roughness: 0.85, flatShading: true
}),
stone: new THREE.MeshStandardMaterial({
color: 0x75695d, roughness: 1, flatShading: true
}),
stoneLight: new THREE.MeshStandardMaterial({
color: 0x92816e, roughness: 1, flatShading: true
}),
soot: new THREE.MeshStandardMaterial({
color: 0x211c19, roughness: 1, flatShading: true
}),
charcoal: new THREE.MeshStandardMaterial({
color: 0x302b27, roughness: 1, flatShading: true
}),
gold: new THREE.MeshStandardMaterial({
color: 0xc69b54, roughness: 0.75, flatShading: true
}),
amber: new THREE.MeshStandardMaterial({
color: 0xf0a13e,
emissive: 0xd66c1e,
emissiveIntensity: 1.5,
roughness: 0.85,
flatShading: true
}),
blue: new THREE.MeshStandardMaterial({
color: 0x8ba9b2,
emissive: 0x607e89,
emissiveIntensity: 0.28,
roughness: 0.75,
flatShading: true
}),
fabricBlue: new THREE.MeshStandardMaterial({
color: 0x586a68, roughness: 1, flatShading: true
}),
fabricCream: new THREE.MeshStandardMaterial({
color: 0xc9b995, roughness: 1, flatShading: true
}),
skin: new THREE.MeshStandardMaterial({
color: 0xb98763, roughness: 1, flatShading: true
})
};
function addBox(parent, w, h, d, material, x, y, z, cast = true) {
const mesh = new THREE.Mesh(new THREE.BoxGeometry(w, h, d), material);
mesh.position.set(x, y, z);
mesh.castShadow = cast;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function addCylinder(
parent, rt, rb, h, segments, material,
x, y, z, cast = true
) {
const mesh = new THREE.Mesh(
new THREE.CylinderGeometry(rt, rb, h, segments),
material
);
mesh.position.set(x, y, z);
mesh.castShadow = cast;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
let seed = 173;
function random() {
seed = (seed * 16807) % 2147483647;
return (seed - 1) / 2147483646;
}
// Foundation and irregular, low-poly floor slabs.
addBox(scene, 18, 0.34, 12, mat.stone, 0, -0.22, -0.2, false);
const tileMaterials = [
new THREE.MeshStandardMaterial({
color: 0xa79b88, roughness: 1, flatShading: true
}),
new THREE.MeshStandardMaterial({
color: 0xb3a691, roughness: 1, flatShading: true
}),
new THREE.MeshStandardMaterial({
color: 0x9d927f, roughness: 1, flatShading: true
}),
new THREE.MeshStandardMaterial({
color: 0xbcad98, roughness: 1, flatShading: true
})
];
for (let ix = 0; ix < 12; ix++) {
for (let iz = 0; iz < 8; iz++) {
const tile = addBox(
scene,
1.38 + random() * 0.08,
0.055,
1.35 + random() * 0.08,
tileMaterials[Math.floor(random() * tileMaterials.length)],
-7.55 + ix * 1.42,
-0.015 + random() * 0.012,
-4.95 + iz * 1.43,
false
);
tile.rotation.y = (random() - 0.5) * 0.018;
}
}
// Cutaway workshop shell.
addBox(scene, 16.4, 5.2, 0.36, mat.plaster, 0, 2.5, -4.95, false);
addBox(scene, 0.36, 4.8, 8.3, mat.plasterLight, -8.05, 2.3, -1.2, false);
addBox(scene, 16.1, 0.22, 0.22, mat.timber, 0, 4.78, -4.68);
[-7.25, -2.55, 1.25, 6.85].forEach((x) => {
addBox(scene, 0.25, 4.7, 0.28, mat.timber, x, 2.35, -4.64);
});
addBox(scene, 0.32, 0.32, 8.1, mat.timber, -7.78, 4.55, -1.25);
addBox(scene, 15.8, 0.26, 0.3, mat.timber, 0, 4.46, -4.64);
// Small leaded window, rendered as simple colored panels.
addBox(scene, 2.05, 1.72, 0.06, mat.darkWood, -3.65, 3.25, -4.71);
addBox(scene, 1.72, 1.39, 0.075, mat.blue, -3.65, 3.25, -4.64, false);
addBox(scene, 0.08, 1.42, 0.1, mat.darkWood, -3.65, 3.25, -4.57);
addBox(scene, 1.76, 0.08, 0.1, mat.darkWood, -3.65, 3.25, -4.57);
function makePot(kind = "jar", material = mat.clayRed, scale = 1) {
const group = new THREE.Group();
const profiles = {
bowl: [
[0.00, 0.00], [0.30, 0.02], [0.48, 0.10],
[0.66, 0.29], [0.70, 0.42], [0.61, 0.43],
[0.53, 0.25], [0.34, 0.09], [0.00, 0.07]
],
jug: [
[0.00, 0.00], [0.30, 0.02], [0.47, 0.16],
[0.59, 0.49], [0.52, 0.85], [0.27, 1.12],
[0.29, 1.31], [0.23, 1.34], [0.21, 1.13],
[0.43, 0.84], [0.50, 0.48], [0.39, 0.17],
[0.00, 0.12]
],
jar: [
[0.00, 0.00], [0.36, 0.02], [0.57, 0.17],
[0.68, 0.49], [0.61, 0.78], [0.43, 0.97],
[0.27, 1.06], [0.30, 1.17], [0.23, 1.18],
[0.21, 1.06], [0.39, 0.93], [0.56, 0.75],
[0.59, 0.47], [0.48, 0.19], [0.00, 0.12]
],
bottle: [
[0.00, 0.00], [0.30, 0.02], [0.48, 0.17],
[0.56, 0.48], [0.38, 0.81], [0.20, 1.04],
[0.16, 1.39], [0.21, 1.51], [0.15, 1.54],
[0.12, 1.37], [0.16, 1.05], [0.32, 0.80],
[0.47, 0.48], [0.39, 0.18], [0.00, 0.12]
]
};
const points = (profiles[kind] || profiles.jar).map(
([x, y]) => new THREE.Vector2(x, y)
);
const geometry = new THREE.LatheGeometry(points, kind === "bowl" ? 12 : 9);
geometry.computeVertexNormals();
const body = new THREE.Mesh(geometry, material);
body.castShadow = true;
body.receiveShadow = true;
group.add(body);
if (kind === "jug") {
const curve = new THREE.CatmullRomCurve3([
new THREE.Vector3(0.42, 0.84, 0),
new THREE.Vector3(0.72, 0.91, 0),
new THREE.Vector3(0.73, 0.48, 0),
new THREE.Vector3(0.40, 0.32, 0)
]);
const handle = new THREE.Mesh(
new THREE.TubeGeometry(curve, 8, 0.035, 4, false),
material
);
handle.castShadow = true;
group.add(handle);
}
group.scale.setScalar(scale);
group.userData.kind = kind;
return group;
}
function makeRack(x, z, width, levels, rotation = 0) {
const rack = new THREE.Group();
rack.position.set(x, 0, z);
rack.rotation.y = rotation;
const half = width / 2;
const depth = 1.08;
[-half, half].forEach((px) => {
[-depth / 2, depth / 2].forEach((pz) => {
addBox(rack, 0.14, 3.2, 0.14, mat.timber, px, 1.6, pz);
});
});
levels.forEach((level) => {
addBox(rack, width + 0.18, 0.14, 0.15, mat.timber, 0, level, -depth / 2);
addBox(rack, width + 0.18, 0.14, 0.15, mat.timber, 0, level, depth / 2);
for (let i = 0; i < 6; i++) {
const px = -half + 0.2 + i * ((width - 0.4) / 5);
addBox(rack, 0.13, 0.07, depth, mat.timberLight, px, level + 0.08, 0);
}
});
addBox(rack, width + 0.2, 0.13, 0.14, mat.timber, 0, 3.08, 0);
scene.add(rack);
return rack;
}
const mainRack = makeRack(-4.72, -1.38, 3.45, [0.55, 1.58, 2.63], 0.035);
const smallRack = makeRack(-1.2, -2.85, 2.35, [0.56, 1.63], -0.035);
const clayMaterials = [
mat.clayRed, mat.clayOchre, mat.clayPale, mat.clayDark
];
const potKinds = ["jar", "bowl", "jug", "bottle"];
function addRackPot(rack, x, shelfY, z, index) {
const pot = makePot(
potKinds[index % potKinds.length],
clayMaterials[index % clayMaterials.length],
0.58 + (index % 3) * 0.07
);
pot.position.set(x, shelfY + 0.13, z);
pot.rotation.y = index * 0.71;
rack.add(pot);
}
[
[-1.1, 0.55, -0.12], [-0.36, 0.55, 0.2], [0.42, 0.55, -0.1],
[-1.08, 1.58, 0.12], [-0.35, 1.58, -0.18], [0.35, 1.58, 0.15],
[1.0, 1.58, -0.1], [1.05, 2.63, 0.05]
].forEach((p, i) => addRackPot(mainRack, p[0], p[1], p[2], i));
[
[-0.72, 0.56, -0.1], [0.03, 0.56, 0.16], [0.72, 0.56, -0.08],
[-0.68, 1.63, 0.08], [0, 1.63, -0.14], [0.68, 1.63, 0.12]
].forEach((p, i) => addRackPot(smallRack, p[0], p[1], p[2], i + 2));
// Workbench with a paddle, clay, and stacked bowls.
const bench = new THREE.Group();
bench.position.set(-1.95, 0, 1.45);
scene.add(bench);
addBox(bench, 2.65, 0.16, 1.22, mat.timberLight, 0, 1.12, 0);
[-1.08, 1.08].forEach((x) => {
[-0.43, 0.43].forEach((z) => {
addBox(bench, 0.13, 1.08, 0.13, mat.timber, x, 0.54, z);
});
});
addBox(bench, 2.3, 0.1, 0.16, mat.timber, 0, 0.36, 0);
const workPot = makePot("bowl", mat.clayOchre, 0.78);
workPot.position.set(0.65, 1.22, 0.15);
bench.add(workPot);
const clayLump = new THREE.Mesh(
new THREE.DodecahedronGeometry(0.22, 0),
mat.clayRed
);
clayLump.scale.set(1.3, 0.7, 1);
clayLump.position.set(-0.7, 1.3, 0.15);
clayLump.castShadow = true;
bench.add(clayLump);
const paddle = addBox(
bench, 0.16, 0.06, 0.75, mat.timberLight, -0.15, 1.23, -0.25
);
paddle.rotation.y = -0.32;
// Low staging platform and a schematic dotted route.
addBox(scene, 2.65, 0.23, 1.15, mat.timber, 0.05, 0.12, 0.82);
for (let i = 0; i < 8; i++) {
const t = i / 7;
const x = -0.75 + t * 3.2;
const z = 0.82 - t * 1.15;
addCylinder(scene, 0.065, 0.065, 0.018, 8, mat.gold, x, 0.035, z, false);
}
// Square masonry kiln.
const kilnX = 3.6;
const kiln = new THREE.Group();
scene.add(kiln);
addBox(kiln, 3.9, 0.34, 3.25, mat.stone, kilnX, 0.16, -2.45);
addBox(kiln, 0.86, 3.25, 3.0, mat.stone, kilnX - 1.47, 1.87, -2.45);
addBox(kiln, 0.86, 3.25, 3.0, mat.stone, kilnX + 1.47, 1.87, -2.45);
addBox(kiln, 3.85, 3.65, 0.45, mat.soot, kilnX, 2.0, -3.75);
addBox(kiln, 4.12, 0.38, 3.25, mat.stoneLight, kilnX, 3.6, -2.45);
// A shallow four-sided kiln hood.
const hood = new THREE.Mesh(
new THREE.ConeGeometry(2.25, 1.0, 4),
mat.stone
);
hood.position.set(kilnX, 4.23, -2.48);
hood.rotation.y = Math.PI / 4;
hood.scale.z = 0.83;
hood.castShadow = true;
hood.receiveShadow = true;
kiln.add(hood);
addBox(kiln, 0.78, 1.4, 0.72, mat.soot, kilnX, 4.85, -2.75);
// Front piers and a low-poly voussoir arch.
const innerRadius = 0.88;
const outerRadius = 1.23;
const archY = 1.43;
const archZ = -1.04;
addBox(kiln, 0.35, archY, 0.45, mat.stoneLight, kilnX - 1.055, archY / 2, archZ);
addBox(kiln, 0.35, archY, 0.45, mat.stoneLight, kilnX + 1.055, archY / 2, archZ);
for (let i = 0; i < 9; i++) {
const a0 = i * Math.PI / 9;
const a1 = (i + 1) * Math.PI / 9;
const shape = new THREE.Shape();
shape.moveTo(Math.cos(a0) * outerRadius, Math.sin(a0) * outerRadius);
shape.lineTo(Math.cos(a1) * outerRadius, Math.sin(a1) * outerRadius);
shape.lineTo(Math.cos(a1) * innerRadius, Math.sin(a1) * innerRadius);
shape.lineTo(Math.cos(a0) * innerRadius, Math.sin(a0) * innerRadius);
shape.closePath();
const stone = new THREE.Mesh(
new THREE.ExtrudeGeometry(shape, {
depth: 0.34,
bevelEnabled: false,
curveSegments: 1
}),
i % 2 === 0 ? mat.stoneLight : mat.stone
);
stone.position.set(kilnX, archY, archZ);
stone.castShadow = true;
stone.receiveShadow = true;
kiln.add(stone);
}
// Recessed chamber and a simple amber firing indication.
const chamberShape = new THREE.Shape();
chamberShape.moveTo(-innerRadius, 0);
chamberShape.lineTo(innerRadius, 0);
chamberShape.lineTo(innerRadius, 1.38);
chamberShape.absarc(0, 1.38, innerRadius, 0, Math.PI, false);
chamberShape.lineTo(-innerRadius, 0);
chamberShape.closePath();
const chamber = new THREE.Mesh(
new THREE.ShapeGeometry(chamberShape),
mat.soot
);
chamber.position.set(kilnX, 0, -3.48);
chamber.receiveShadow = true;
kiln.add(chamber);
const glowShape = new THREE.Shape();
glowShape.moveTo(-0.59, 0);
glowShape.lineTo(0.59, 0);
glowShape.lineTo(0.59, 0.95);
glowShape.absarc(0, 0.95, 0.59, 0, Math.PI, false);
glowShape.lineTo(-0.59, 0);
glowShape.closePath();
const glow = new THREE.Mesh(
new THREE.ShapeGeometry(glowShape),
new THREE.MeshStandardMaterial({
color: 0x8e461f,
emissive: 0xe66f22,
emissiveIntensity: 1.0,
transparent: true,
opacity: 0.56,
roughness: 1,
side: THREE.DoubleSide
})
);
glow.position.set(kilnX, 0.22, -3.43);
kiln.add(glow);
addBox(kiln, 2.0, 0.13, 1.05, mat.darkWood, kilnX, 0.31, -2.17);
const emberGeometry = new THREE.IcosahedronGeometry(0.075, 0);
const embers = [];
for (let i = 0; i < 7; i++) {
const ember = new THREE.Mesh(emberGeometry, mat.amber);
ember.position.set(
kilnX - 0.62 + random() * 1.24,
0.38 + random() * 0.18,
-2.7 - random() * 0.48
);
ember.userData.phase = random() * Math.PI * 2;
kiln.add(ember);
embers.push(ember);
}
// Stacked split wood, shown only as workshop context.
const woodPile = new THREE.Group();
woodPile.position.set(6.25, 0, -1.25);
scene.add(woodPile);
for (let row = 0; row < 3; row++) {
const count = 4 - row;
for (let i = 0; i < count; i++) {
const log = addCylinder(
woodPile, 0.12, 0.14, 1.15, 6,
i % 2 ? mat.timberLight : mat.timber,
-0.37 + i * 0.25,
0.14 + row * 0.23,
0,
true
);
log.rotation.z = Math.PI / 2;
}
}
// A small barrel and a folded cloth.
const barrel = new THREE.Group();
barrel.position.set(-6.55, 0, 0.55);
scene.add(barrel);
addCylinder(barrel, 0.43, 0.49, 1.0, 10, mat.timberLight, 0, 0.5, 0);
addCylinder(barrel, 0.45, 0.45, 0.09, 10, mat.darkWood, 0, 0.15, 0);
addCylinder(barrel, 0.45, 0.45, 0.09, 10, mat.darkWood, 0, 0.83, 0);
addCylinder(barrel, 0.36, 0.36, 0.025, 10, mat.blue, 0, 1.01, 0, false);
// Low-poly workshop figure.
const loader = new THREE.Group();
loader.position.set(1.28, 0, -0.12);
loader.rotation.y = -0.38;
scene.add(loader);
addBox(loader, 0.19, 0.64, 0.22, mat.darkWood, -0.15, 0.36, 0);
addBox(loader, 0.19, 0.64, 0.22, mat.darkWood, 0.15, 0.36, 0);
addBox(loader, 0.22, 0.13, 0.4, mat.darkWood, -0.15, 0.08, 0.06);
addBox(loader, 0.22, 0.13, 0.4, mat.darkWood, 0.15, 0.08, 0.06);
addCylinder(loader, 0.31, 0.24, 0.8, 7, mat.fabricBlue, 0, 1.05, 0);
addBox(loader, 0.39, 0.62, 0.08, mat.fabricCream, 0, 1.0, 0.24);
const head = new THREE.Mesh(
new THREE.DodecahedronGeometry(0.23, 0),
mat.skin
);
head.position.set(0, 1.72, 0);
head.castShadow = true;
loader.add(head);
addCylinder(loader, 0.25, 0.28, 0.16, 8, mat.timber, 0, 1.94, 0);
addCylinder(loader, 0.17, 0.19, 0.21, 8, mat.timber, 0, 2.06, 0);
const leftArm = new THREE.Group();
leftArm.position.set(-0.32, 1.38, 0);
leftArm.rotation.z = -0.18;
addCylinder(leftArm, 0.09, 0.075, 0.66, 6, mat.fabricBlue, 0, -0.3, 0);
loader.add(leftArm);
const loaderArm = new THREE.Group();
loaderArm.position.set(0.32, 1.38, 0);
loaderArm.rotation.z = 0.78;
addCylinder(loaderArm, 0.09, 0.075, 0.66, 6, mat.fabricBlue, 0, -0.3, 0);
loader.add(loaderArm);
// Four vessels used by the animated loading sequence.
const sequencePotKinds = ["jug", "jar", "bottle", "bowl"];
const sequencePotMaterials = [
mat.clayRed, mat.clayOchre, mat.clayDark, mat.clayPale
];
const sequence = [];
const potDuration = 5.4;
const potSpacing = 2.1;
for (let i = 0; i < 4; i++) {
const group = new THREE.Group();
const pot = makePot(
sequencePotKinds[i],
sequencePotMaterials[i],
i === 3 ? 0.72 : 0.68
);
group.add(pot);
const haloMaterial = new THREE.MeshBasicMaterial({
color: 0xdca448,
transparent: true,
opacity: 0.55,
side: THREE.DoubleSide,
depthWrite: false
});
const halo = new THREE.Mesh(
new THREE.RingGeometry(0.31, 0.43, 12),
haloMaterial
);
halo.rotation.x = -Math.PI / 2;
halo.position.y = 0.025;
halo.visible = false;
group.add(halo);
const start = new THREE.Vector3(-5.83 + i * 0.55, 2.78, -1.28);
const lifted = new THREE.Vector3(start.x, 3.67, -0.95);
const staged = new THREE.Vector3(-0.48 + i * 0.5, 0.26, 0.83);
const approach = new THREE.Vector3(
kilnX - 0.22 + (i % 2) * 0.42,
0.52,
-0.58
);
const chamberPosition = new THREE.Vector3(
kilnX - 0.45 + (i % 2) * 0.88,
0.39,
-2.0 - Math.floor(i / 2) * 0.34
);
group.position.copy(start);
scene.add(group);
sequence.push({
group,
halo,
start,
lifted,
staged,
approach,
chamberPosition,
local: 0
});
}
const totalDuration = potSpacing * 3 + potDuration;
function smoothStep(t) {
t = THREE.MathUtils.clamp(t, 0, 1);
return t * t * (3 - 2 * t);
}
function updateSequence(time) {
let activeIndex = -1;
let activeLocal = 0;
sequence.forEach((item, index) => {
const rawLocal = time - index * potSpacing;
const local = THREE.MathUtils.clamp(rawLocal, 0, potDuration);
item.local = local;
if (rawLocal > 0 && rawLocal < potDuration) {
activeIndex = index;
activeLocal = local;
}
const u = local / potDuration;
let position;
if (u < 0.18) {
position = item.start.clone().lerp(item.lifted, smoothStep(u / 0.18));
} else if (u < 0.43) {
position = item.lifted.clone().lerp(
item.staged,
smoothStep((u - 0.18) / 0.25)
);
} else if (u < 0.72) {
position = item.staged.clone().lerp(
item.approach,
smoothStep((u - 0.43) / 0.29)
);
} else {
position = item.approach.clone().lerp(
item.chamberPosition,
smoothStep((u - 0.72) / 0.28)
);
}
item.group.position.copy(position);
item.group.rotation.y = index * 0.8 + Math.sin(time * 0.9 + index) * 0.025;
item.halo.visible = rawLocal > 0 && rawLocal < potDuration;
if (item.halo.visible) {
const pulse = 1 + Math.sin(time * 4 + index) * 0.08;
item.halo.scale.setScalar(pulse);
item.halo.material.opacity = 0.42 + Math.sin(time * 3 + index) * 0.12;
}
});
const status = document.getElementById("status");
const phase = document.getElementById("phase");
const progress = document.getElementById("progress");
progress.style.width = `${Math.min(100, time / totalDuration * 100)}%`;
if (time >= totalDuration) {
status.textContent = "Loading sequence complete";
phase.textContent =
"Four vessels are staged schematically inside the kiln chamber.";
} else if (activeIndex >= 0) {
const number = String(activeIndex + 1).padStart(2, "0");
if (activeLocal / potDuration < 0.18) {
status.textContent = `Vessel ${number} · selected`;
phase.textContent = "A vessel rises from the upper drying-rack shelf.";
} else if (activeLocal / potDuration < 0.43) {
status.textContent = `Vessel ${number} · transferred`;
phase.textContent = "The vessel follows the schematic route to the staging platform.";
} else if (activeLocal / potDuration < 0.72) {
status.textContent = `Vessel ${number} · approaching`;
phase.textContent = "The vessel moves from the staging area toward the kiln opening.";
} else {
status.textContent = `Vessel ${number} · chamber placement`;
phase.textContent = "The vessel is positioned within the visibly recessed chamber.";
}
} else {
const next = Math.min(3, Math.floor(time / potSpacing));
status.textContent = `Vessel ${String(next + 1).padStart(2, "0")} · selected`;
phase.textContent = "A vessel rises from the upper drying-rack shelf.";
}
}
// HTML labels projected from world-space anchors.
const labelContainer = document.getElementById("labels");
const labels = [];
function addWorldLabel(text, position, className = "") {
const element = document.createElement("div");
element.className = `world-label ${className}`;
element.textContent = text;
labelContainer.appendChild(element);
labels.push({
element,
position: position.clone(),
visible: true
});
}
addWorldLabel("Drying racks", new THREE.Vector3(-4.7, 3.55, -1.35));
addWorldLabel("Workbench", new THREE.Vector3(-1.95, 1.68, 1.45));
addWorldLabel("Staging area", new THREE.Vector3(0.1, 0.62, 0.82));
addWorldLabel("Kiln · schematic chamber", new THREE.Vector3(3.6, 4.85, -2.45));
addWorldLabel("Vessel in sequence", new THREE.Vector3(0, 2, 0), "active");
function updateLabels() {
labels.forEach((label) => {
const projected = label.position.clone().project(camera);
const visible =
projected.z > -1 &&
projected.z < 1 &&
projected.x > -1.2 &&
projected.x < 1.2 &&
projected.y > -1.2 &&
projected.y < 1.2;
label.element.style.opacity = visible ? "1" : "0";
if (visible) {
label.element.style.left =
`${(projected.x * 0.5 + 0.5) * window.innerWidth}px`;
label.element.style.top =
`${(-projected.y * 0.5 + 0.5) * window.innerHeight}px`;
}
});
const activeLabel = labels[labels.length - 1];
let movingPot = null;
sequence.forEach((item) => {
if (item.local > 0 && item.local < potDuration) {
movingPot = item;
}
});
if (movingPot) {
activeLabel.visible = true;
activeLabel.position.copy(movingPot.group.position);
activeLabel.position.y += 1.45;
} else {
activeLabel.visible = false;
}
}
// Custom orbit controls: no addon modules are used.
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;
view.desiredTheta -= dx * 0.006;
view.desiredPhi = THREE.MathUtils.clamp(
view.desiredPhi + dy * 0.0045,
0.58,
1.34
);
});
function endDrag(event) {
dragging = false;
if (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();
view.desiredDistance = THREE.MathUtils.clamp(
view.desiredDistance + event.deltaY * 0.012,
11.5,
25
);
}, { passive: false });
function resetView() {
view.desiredTheta = initialView.theta;
view.desiredPhi = initialView.phi;
view.desiredDistance = initialView.distance;
}
renderer.domElement.addEventListener("dblclick", resetView);
window.addEventListener("keydown", (event) => {
if (event.key === "ArrowLeft") view.desiredTheta -= 0.09;
if (event.key === "ArrowRight") view.desiredTheta += 0.09;
if (event.key === "ArrowUp") {
view.desiredPhi = Math.max(0.58, view.desiredPhi - 0.06);
}
if (event.key === "ArrowDown") {
view.desiredPhi = Math.min(1.34, view.desiredPhi + 0.06);
}
if (event.key === "+" || event.key === "=") {
view.desiredDistance = Math.max(11.5, view.desiredDistance - 0.7);
}
if (event.key === "-") {
view.desiredDistance = Math.min(25, view.desiredDistance + 0.7);
}
if (event.key.toLowerCase() === "r") replaySequence();
});
let sequenceTime = 0;
let playing = true;
function playPauseSequence() {
playing = !playing;
document.getElementById("play").textContent = playing ? "Pause" : "Play";
}
function replaySequence() {
sequenceTime = 0;
playing = true;
document.getElementById("play").textContent = "Pause";
updateSequence(0);
}
document.getElementById("play").addEventListener("click", playPauseSequence);
document.getElementById("replay").addEventListener("click", replaySequence);
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
});
const clock = new THREE.Clock();
let elapsed = 0;
function animate() {
requestAnimationFrame(animate);
const delta = Math.min(clock.getDelta(), 0.05);
elapsed += delta;
if (playing && sequenceTime < totalDuration) {
sequenceTime = Math.min(totalDuration, sequenceTime + delta);
}
updateSequence(sequenceTime);
view.theta += (view.desiredTheta - view.theta) * 0.075;
view.phi += (view.desiredPhi - view.phi) * 0.075;
view.distance += (view.desiredDistance - view.distance) * 0.075;
updateCamera();
glow.material.emissiveIntensity =
0.88 + Math.sin(elapsed * 1.7) * 0.16 + Math.sin(elapsed * 3.1) * 0.06;
kilnLight.intensity =
12.5 + Math.sin(elapsed * 1.9) * 2.0 + Math.sin(elapsed * 4.3) * 0.7;
embers.forEach((ember, index) => {
const phase = ember.userData.phase;
const pulse = 0.82 + Math.sin(elapsed * 2.6 + phase) * 0.22;
ember.scale.setScalar(pulse);
ember.position.y += Math.sin(elapsed * 1.4 + index) * 0.0008;
});
loaderArm.rotation.z =
0.73 + Math.sin(elapsed * 1.4) * 0.09 + Math.sin(elapsed * 3.0) * 0.025;
updateLabels();
renderer.render(scene, camera);
}
updateSequence(0);
animate();
</script>
</body>
</html>
```