Prompt specification
Build or customize the Three.js 3D scene "Pottery kiln shelf and clay vessels" 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: Pottery kiln shelf and clay vessels
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/pottery-kiln-shelf-and-clay-vessels-x2329
Scene Description Prompt:
Show spaced fired vessels on a stylized kiln shelf beside distinct unfired clay forms. Make one HTML file with Three.js from cdnjs.
Working Three.js Starter (pottery-kiln-shelf-and-clay-vessels-x2329):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fire & Form — Three.js Kiln Study</title>
<style>
:root {
--ink: #29231f;
--paper: #efe5d7;
--fired: #365b91;
--unfired: #c38f68;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #c8b7a3;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.title-card {
position: fixed;
top: clamp(22px, 4vw, 52px);
left: clamp(22px, 4vw, 58px);
z-index: 10;
pointer-events: none;
}
.eyebrow {
margin: 0 0 10px;
font-size: 10px;
font-weight: 750;
letter-spacing: 0.28em;
text-transform: uppercase;
opacity: 0.62;
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(38px, 5.5vw, 76px);
font-weight: 400;
line-height: 0.94;
letter-spacing: -0.045em;
}
.subtitle {
margin: 14px 0 0;
max-width: 260px;
font-size: 12px;
line-height: 1.6;
opacity: 0.68;
}
.legend {
position: fixed;
left: clamp(22px, 4vw, 58px);
bottom: clamp(22px, 4vw, 45px);
z-index: 10;
display: flex;
gap: 25px;
pointer-events: none;
}
.legend-item {
display: flex;
align-items: center;
gap: 9px;
font-size: 9px;
font-weight: 750;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.swatch {
width: 11px;
height: 11px;
border-radius: 50%;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.swatch.fired {
background: var(--fired);
}
.swatch.unfired {
background: var(--unfired);
}
.controls {
position: fixed;
right: clamp(18px, 3vw, 40px);
bottom: clamp(18px, 3vw, 36px);
z-index: 10;
padding: 10px 14px;
border: 1px solid rgba(45, 35, 27, 0.16);
border-radius: 999px;
background: rgba(244, 235, 223, 0.68);
backdrop-filter: blur(12px);
font-size: 9px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
pointer-events: none;
}
#loading {
position: fixed;
inset: 0;
z-index: 30;
display: grid;
place-items: center;
background: #c8b7a3;
transition: opacity 700ms ease, visibility 700ms ease;
}
#loading span {
font-family: Georgia, "Times New Roman", serif;
font-size: 30px;
font-style: italic;
opacity: 0.7;
}
#loading.ready {
opacity: 0;
visibility: hidden;
}
@media (max-width: 700px) {
.subtitle {
max-width: 190px;
}
.legend {
gap: 14px;
}
.controls {
display: none;
}
}
</style>
</head>
<body>
<div class="title-card">
<p class="eyebrow">Studio study · No. 07</p>
<h1>Fire<br />& Form</h1>
<p class="subtitle">
Glazed vessels emerging from the kiln, beside the quiet forms waiting their turn.
</p>
</div>
<div class="legend" aria-label="Pottery legend">
<div class="legend-item">
<span class="swatch fired"></span>
Fired · 1280°C
</div>
<div class="legend-item">
<span class="swatch unfired"></span>
Unfired · 60°C
</div>
</div>
<div class="controls">Drag to orbit · Scroll to zoom</div>
<div id="loading"><span>warming the kiln…</span></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 renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
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.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xc8b7a3);
scene.fog = new THREE.Fog(0xc8b7a3, 22, 42);
const camera = new THREE.PerspectiveCamera(
38,
window.innerWidth / window.innerHeight,
0.1,
100
);
const target = new THREE.Vector3(-0.25, 1.65, -0.15);
const spherical = new THREE.Spherical(15.4, 1.14, 0.5);
const initialSpherical = spherical.clone();
function updateCamera() {
camera.position.setFromSpherical(spherical).add(target);
camera.lookAt(target);
}
updateCamera();
// -------------------------------------------------------------------------
// Procedural materials and textures
// -------------------------------------------------------------------------
function mulberry32(seed) {
return function () {
let t = (seed += 0x6d2b79f5);
t = Math.imul(t ^ (t >>> 15), t | 1);
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
};
}
function makeClayTextures(baseColor, fleckColor, seed, repeatX = 3, repeatY = 3) {
const size = 512;
const random = mulberry32(seed);
const colorCanvas = document.createElement("canvas");
colorCanvas.width = colorCanvas.height = size;
const colorContext = colorCanvas.getContext("2d");
colorContext.fillStyle = baseColor;
colorContext.fillRect(0, 0, size, size);
for (let i = 0; i < 1500; i++) {
const radius = random() * 1.8 + 0.25;
colorContext.globalAlpha = 0.08 + random() * 0.22;
colorContext.fillStyle = random() > 0.2 ? fleckColor : "#ffffff";
colorContext.beginPath();
colorContext.arc(
random() * size,
random() * size,
radius,
0,
Math.PI * 2
);
colorContext.fill();
}
for (let i = 0; i < 24; i++) {
colorContext.globalAlpha = 0.025;
colorContext.fillStyle = "#5c4638";
colorContext.beginPath();
colorContext.ellipse(
random() * size,
random() * size,
12 + random() * 42,
5 + random() * 22,
random() * Math.PI,
0,
Math.PI * 2
);
colorContext.fill();
}
colorContext.globalAlpha = 1;
const bumpCanvas = document.createElement("canvas");
bumpCanvas.width = bumpCanvas.height = size;
const bumpContext = bumpCanvas.getContext("2d");
bumpContext.fillStyle = "#777777";
bumpContext.fillRect(0, 0, size, size);
for (let i = 0; i < 2200; i++) {
const value = Math.floor(80 + random() * 100);
bumpContext.fillStyle = `rgb(${value},${value},${value})`;
const radius = random() * 2 + 0.3;
bumpContext.beginPath();
bumpContext.arc(
random() * size,
random() * size,
radius,
0,
Math.PI * 2
);
bumpContext.fill();
}
const map = new THREE.CanvasTexture(colorCanvas);
map.colorSpace = THREE.SRGBColorSpace;
map.wrapS = map.wrapT = THREE.RepeatWrapping;
map.repeat.set(repeatX, repeatY);
map.anisotropy = renderer.capabilities.getMaxAnisotropy();
const bumpMap = new THREE.CanvasTexture(bumpCanvas);
bumpMap.wrapS = bumpMap.wrapT = THREE.RepeatWrapping;
bumpMap.repeat.set(repeatX, repeatY);
return { map, bumpMap };
}
function makeShadowTexture() {
const canvas = document.createElement("canvas");
canvas.width = canvas.height = 128;
const context = canvas.getContext("2d");
const gradient = context.createRadialGradient(64, 64, 4, 64, 64, 62);
gradient.addColorStop(0, "rgba(25,18,14,0.58)");
gradient.addColorStop(0.4, "rgba(25,18,14,0.28)");
gradient.addColorStop(1, "rgba(25,18,14,0)");
context.fillStyle = gradient;
context.fillRect(0, 0, 128, 128);
return new THREE.CanvasTexture(canvas);
}
const rawTextures = makeClayTextures("#d5ae87", "#79513b", 31, 3, 3);
const shelfTextures = makeClayTextures("#aaa397", "#625c55", 82, 4, 2);
const tableTextures = makeClayTextures("#c5b8a6", "#82776c", 49, 2, 2);
const shadowTexture = makeShadowTexture();
const rawClay = new THREE.MeshStandardMaterial({
map: rawTextures.map,
bumpMap: rawTextures.bumpMap,
bumpScale: 0.045,
roughness: 0.98,
metalness: 0,
color: 0xffffff
});
const rawClayAccent = new THREE.MeshStandardMaterial({
color: 0xb88763,
roughness: 1,
metalness: 0
});
const shelfMaterial = new THREE.MeshStandardMaterial({
map: shelfTextures.map,
bumpMap: shelfTextures.bumpMap,
bumpScale: 0.035,
roughness: 0.94,
metalness: 0
});
const shelfEdgeMaterial = new THREE.MeshStandardMaterial({
color: 0x817b72,
roughness: 0.98
});
const tableMaterial = new THREE.MeshStandardMaterial({
map: tableTextures.map,
bumpMap: tableTextures.bumpMap,
bumpScale: 0.025,
roughness: 0.92
});
const indigoGlaze = new THREE.MeshPhysicalMaterial({
color: 0x244c86,
roughness: 0.2,
metalness: 0.02,
clearcoat: 1,
clearcoatRoughness: 0.1,
envMapIntensity: 1.25
});
const indigoRim = new THREE.MeshPhysicalMaterial({
color: 0x809dc0,
roughness: 0.24,
clearcoat: 0.9
});
const celadonGlaze = new THREE.MeshPhysicalMaterial({
color: 0x89aa98,
roughness: 0.23,
metalness: 0.01,
clearcoat: 0.9,
clearcoatRoughness: 0.13,
envMapIntensity: 1.15
});
const celadonRim = new THREE.MeshPhysicalMaterial({
color: 0xc1d0bd,
roughness: 0.2,
clearcoat: 1
});
const coralGlaze = new THREE.MeshPhysicalMaterial({
color: 0xb85d47,
roughness: 0.22,
metalness: 0.02,
clearcoat: 1,
clearcoatRoughness: 0.11,
envMapIntensity: 1.2
});
const coralRim = new THREE.MeshPhysicalMaterial({
color: 0x492e2a,
roughness: 0.28,
clearcoat: 0.8
});
const ochreGlaze = new THREE.MeshPhysicalMaterial({
color: 0xbc8428,
roughness: 0.25,
metalness: 0.03,
clearcoat: 0.9,
clearcoatRoughness: 0.15,
envMapIntensity: 1.15
});
const ochreRim = new THREE.MeshPhysicalMaterial({
color: 0xe2b85c,
roughness: 0.24,
clearcoat: 1
});
// -------------------------------------------------------------------------
// Custom image-based lighting made only from core Three.js
// -------------------------------------------------------------------------
const environmentScene = new THREE.Scene();
environmentScene.background = new THREE.Color(0x292522);
function environmentPanel(color, position, scale) {
const panel = new THREE.Mesh(
new THREE.BoxGeometry(scale[0], scale[1], scale[2]),
new THREE.MeshBasicMaterial({ color })
);
panel.position.set(...position);
environmentScene.add(panel);
}
environmentPanel(0xffffff, [-4, 4, 4], [4, 5, 0.2]);
environmentPanel(0xffd8b2, [5, 2, 2], [0.2, 4, 5]);
environmentPanel(0xbfd8ff, [0, 7, -1], [5, 0.2, 5]);
environmentPanel(0x806a57, [0, -3, 0], [8, 0.2, 8]);
const pmremGenerator = new THREE.PMREMGenerator(renderer);
const environmentTarget = pmremGenerator.fromScene(environmentScene, 0.04);
scene.environment = environmentTarget.texture;
pmremGenerator.dispose();
// -------------------------------------------------------------------------
// Lighting
// -------------------------------------------------------------------------
scene.add(new THREE.AmbientLight(0xfff1df, 0.38));
scene.add(new THREE.HemisphereLight(0xf7eadb, 0x3b3028, 1.45));
const keyLight = new THREE.DirectionalLight(0xffefd4, 4.2);
keyLight.position.set(-4.5, 10, 7);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -11;
keyLight.shadow.camera.right = 11;
keyLight.shadow.camera.top = 10;
keyLight.shadow.camera.bottom = -5;
keyLight.shadow.camera.near = 1;
keyLight.shadow.camera.far = 30;
keyLight.shadow.bias = -0.0003;
keyLight.shadow.normalBias = 0.025;
scene.add(keyLight);
const fillLight = new THREE.DirectionalLight(0xbfd8ff, 1.45);
fillLight.position.set(8, 5, 4);
scene.add(fillLight);
const rimLight = new THREE.DirectionalLight(0xff9e67, 1.8);
rimLight.position.set(-4, 5, -5);
scene.add(rimLight);
const tableSpot = new THREE.SpotLight(0xffd9ad, 85, 20, 0.52, 0.85, 1.4);
tableSpot.position.set(4.8, 8, 4.5);
tableSpot.target.position.set(4, 0.8, 0);
tableSpot.castShadow = true;
tableSpot.shadow.mapSize.set(1024, 1024);
tableSpot.shadow.bias = -0.0002;
scene.add(tableSpot, tableSpot.target);
// -------------------------------------------------------------------------
// Architecture: warm gallery, arched kiln recess, shelf and work table
// -------------------------------------------------------------------------
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(50, 50),
new THREE.MeshStandardMaterial({ color: 0xb9aa98, roughness: 0.96 })
);
floor.rotation.x = -Math.PI / 2;
floor.receiveShadow = true;
scene.add(floor);
const wall = new THREE.Mesh(
new THREE.PlaneGeometry(38, 18),
new THREE.MeshStandardMaterial({ color: 0xc8b7a3, roughness: 1 })
);
wall.position.set(0, 6, -3.28);
wall.receiveShadow = true;
scene.add(wall);
function makeArchShape(halfWidth, shoulderHeight, crownHeight) {
const shape = new THREE.Shape();
shape.moveTo(-halfWidth, 0);
shape.lineTo(halfWidth, 0);
shape.lineTo(halfWidth, shoulderHeight);
shape.quadraticCurveTo(halfWidth, crownHeight, 0, crownHeight);
shape.quadraticCurveTo(-halfWidth, crownHeight, -halfWidth, shoulderHeight);
shape.closePath();
return shape;
}
const kilnOuter = new THREE.Mesh(
new THREE.ShapeGeometry(makeArchShape(4.95, 3.7, 5.75)),
new THREE.MeshStandardMaterial({ color: 0xa89c8d, roughness: 0.96 })
);
kilnOuter.position.set(-1.85, 0, -3.2);
kilnOuter.receiveShadow = true;
scene.add(kilnOuter);
const kilnInner = new THREE.Mesh(
new THREE.ShapeGeometry(makeArchShape(4.45, 3.45, 5.22)),
new THREE.MeshStandardMaterial({
color: 0x3d3d3b,
roughness: 0.9,
metalness: 0.03
})
);
kilnInner.position.set(-1.85, 0.08, -3.13);
kilnInner.receiveShadow = true;
scene.add(kilnInner);
const shelf = new THREE.Mesh(
new THREE.BoxGeometry(8, 0.34, 3.05),
shelfMaterial
);
shelf.position.set(-1.8, 1.18, -0.68);
shelf.castShadow = true;
shelf.receiveShadow = true;
scene.add(shelf);
const shelfFront = new THREE.Mesh(
new THREE.BoxGeometry(8.06, 0.15, 0.1),
shelfEdgeMaterial
);
shelfFront.position.set(-1.8, 1.13, 0.87);
shelfFront.castShadow = true;
scene.add(shelfFront);
for (const x of [-5.15, 1.55]) {
const support = new THREE.Mesh(
new THREE.BoxGeometry(0.8, 1.05, 1.45),
shelfMaterial
);
support.position.set(x, 0.52, -0.95);
support.castShadow = true;
support.receiveShadow = true;
scene.add(support);
}
const tableTop = new THREE.Mesh(
new THREE.BoxGeometry(2.9, 0.16, 2.55),
tableMaterial
);
tableTop.position.set(4.05, 0.69, 0.03);
tableTop.castShadow = true;
tableTop.receiveShadow = true;
scene.add(tableTop);
for (const x of [2.88, 5.22]) {
for (const z of [-0.88, 0.94]) {
const leg = new THREE.Mesh(
new THREE.BoxGeometry(0.19, 0.62, 0.19),
new THREE.MeshStandardMaterial({ color: 0x8f7964, roughness: 0.92 })
);
leg.position.set(x, 0.31, z);
leg.castShadow = true;
scene.add(leg);
}
}
// -------------------------------------------------------------------------
// Pottery helpers
// -------------------------------------------------------------------------
function profile(rows) {
return rows.map(([radius, height]) => new THREE.Vector2(radius, height));
}
function handmadeLathe(rows, material, seed = 1, segments = 96) {
const geometry = new THREE.LatheGeometry(profile(rows), segments);
const positions = geometry.attributes.position;
for (let i = 0; i < positions.count; i++) {
const x = positions.getX(i);
const y = positions.getY(i);
const z = positions.getZ(i);
const radius = Math.hypot(x, z);
if (radius > 0.001) {
const angle = Math.atan2(z, x);
const displacement =
Math.cos(angle * 2 + y * 3.1 + seed) * 0.007 +
Math.cos(angle * 4 - y * 2.2 + seed * 1.7) * 0.0035;
const scale = 1 + displacement;
positions.setX(i, x * scale);
positions.setZ(i, z * scale);
}
}
geometry.computeVertexNormals();
const mesh = new THREE.Mesh(geometry, material);
mesh.castShadow = true;
mesh.receiveShadow = true;
return mesh;
}
function addRing(parent, radius, height, tube, material, z = 0) {
const ring = new THREE.Mesh(
new THREE.TorusGeometry(radius, tube, 12, 72),
material
);
ring.rotation.x = Math.PI / 2;
ring.position.set(0, height, z);
ring.castShadow = true;
parent.add(ring);
return ring;
}
function addHandle(parent, material, side = 1, large = false) {
const curve = new THREE.QuadraticBezierCurve3(
new THREE.Vector3(side * 0.38, large ? 1.35 : 1.13, 0),
new THREE.Vector3(side * (large ? 1.08 : 0.9), large ? 1.06 : 0.91, 0),
new THREE.Vector3(side * 0.47, large ? 0.72 : 0.58, 0)
);
const handle = new THREE.Mesh(
new THREE.TubeGeometry(curve, 40, large ? 0.085 : 0.07, 14, false),
material
);
handle.castShadow = true;
handle.receiveShadow = true;
parent.add(handle);
}
function addContactShadow(parent, x, z, width, depth, y = 0.006) {
const shadow = new THREE.Mesh(
new THREE.PlaneGeometry(width, depth),
new THREE.MeshBasicMaterial({
map: shadowTexture,
transparent: true,
depthWrite: false,
opacity: 0.58
})
);
shadow.rotation.x = -Math.PI / 2;
shadow.position.set(x, y, z);
parent.add(shadow);
}
// -------------------------------------------------------------------------
// Fired vessels, evenly spaced across the kiln shelf
// -------------------------------------------------------------------------
const firedShelf = new THREE.Group();
scene.add(firedShelf);
const indigoBottle = new THREE.Group();
indigoBottle.add(
handmadeLathe(
[
[0, 0], [0.32, 0], [0.45, 0.05], [0.55, 0.22],
[0.58, 0.62], [0.52, 0.95], [0.36, 1.22], [0.24, 1.38],
[0.18, 1.56], [0.18, 1.92], [0.24, 2.02], [0.25, 2.12],
[0.21, 2.17], [0.15, 2.17], [0.12, 2.1], [0.12, 1.92],
[0.13, 1.72], [0.18, 1.56], [0.23, 1.42], [0.34, 1.28],
[0.47, 1.05], [0.5, 0.72], [0.46, 0.35], [0.34, 0.14],
[0, 0.12]
],
indigoGlaze,
2.3
)
);
addRing(indigoBottle, 0.225, 2.105, 0.027, indigoRim);
addRing(indigoBottle, 0.345, 1.25, 0.018, indigoRim);
indigoBottle.position.set(-4.65, 1.36, -0.78);
firedShelf.add(indigoBottle);
addContactShadow(firedShelf, -4.65, -0.78, 1.55, 1.2, 1.366);
const celadonJar = new THREE.Group();
celadonJar.add(
handmadeLathe(
[
[0, 0], [0.4, 0], [0.72, 0.08], [0.92, 0.28],
[1.03, 0.62], [1.04, 0.92], [0.94, 1.17], [0.72, 1.34],
[0.48, 1.43], [0.35, 1.5], [0.31, 1.65], [0.32, 1.72],
[0.27, 1.78], [0.21, 1.77], [0.19, 1.68], [0.22, 1.53],
[0.31, 1.46], [0.44, 1.38], [0.64, 1.25], [0.84, 1.1],
[0.93, 0.88], [0.92, 0.62], [0.8, 0.32], [0.58, 0.15],
[0, 0.1]
],
celadonGlaze,
4.8
)
);
addRing(celadonJar, 0.29, 1.69, 0.025, celadonRim);
addRing(celadonJar, 0.94, 0.88, 0.017, celadonRim);
celadonJar.position.set(-2.55, 1.36, -0.72);
firedShelf.add(celadonJar);
addContactShadow(firedShelf, -2.55, -0.72, 2.35, 1.55, 1.366);
const coralAmphora = new THREE.Group();
coralAmphora.add(
handmadeLathe(
[
[0, 0], [0.36, 0], [0.52, 0.07], [0.66, 0.3],
[0.7, 0.68], [0.64, 1.02], [0.43, 1.28], [0.29, 1.46],
[0.24, 1.64], [0.25, 1.83], [0.31, 1.91], [0.32, 1.99],
[0.27, 2.04], [0.2, 2.04], [0.16, 1.96], [0.16, 1.78],
[0.2, 1.64], [0.25, 1.46], [0.4, 1.22], [0.58, 1],
[0.62, 0.7], [0.56, 0.35], [0.4, 0.12], [0, 0.1]
],
coralGlaze,
6.1
)
);
addHandle(coralAmphora, coralGlaze, 1, true);
addHandle(coralAmphora, coralGlaze, -1, true);
addRing(coralAmphora, 0.275, 1.965, 0.025, coralRim);
coralAmphora.position.set(-0.2, 1.36, -0.72);
firedShelf.add(coralAmphora);
addContactShadow(firedShelf, -0.2, -0.72, 1.7, 1.3, 1.366);
const ochreCup = new THREE.Group();
ochreCup.add(
handmadeLathe(
[
[0, 0], [0.36, 0], [0.5, 0.06], [0.58, 0.2],
[0.61, 0.55], [0.56, 0.9], [0.42, 1.08], [0.33, 1.17],
[0.32, 1.35], [0.35, 1.43], [0.3, 1.5], [0.23, 1.49],
[0.22, 1.39], [0.23, 1.22], [0.33, 1.11], [0.48, 0.95],
[0.52, 0.6], [0.48, 0.28], [0.34, 0.12], [0, 0.1]
],
ochreGlaze,
8.4
)
);
addHandle(ochreCup, ochreGlaze, 1, false);
addRing(ochreCup, 0.29, 1.445, 0.026, ochreRim);
ochreCup.position.set(1.45, 1.36, -0.76);
firedShelf.add(ochreCup);
addContactShadow(firedShelf, 1.45, -0.76, 1.5, 1.2, 1.366);
// -------------------------------------------------------------------------
// Distinct unfired forms on the adjacent work table
// -------------------------------------------------------------------------
const rawTable = new THREE.Group();
scene.add(rawTable);
const rawBottle = new THREE.Group();
rawBottle.add(
handmadeLathe(
[
[0, 0], [0.34, 0], [0.48, 0.06], [0.52, 0.28],
[0.47, 0.6], [0.39, 0.9], [0.26, 1.13], [0.19, 1.34],
[0.18, 1.62], [0.23, 1.72], [0.2, 1.8], [0.13, 1.8],
[0.12, 1.67], [0.13, 1.39], [0.2, 1.17], [0.32, 0.94],
[0.4, 0.61], [0.43, 0.32], [0.33, 0.12], [0, 0.1]
],
rawClay,
10.7
)
);
addRing(rawBottle, 0.505, 0.4, 0.012, rawClayAccent);
addRing(rawBottle, 0.49, 0.56, 0.011, rawClayAccent);
rawBottle.position.set(2.95, 0.78, -0.38);
rawTable.add(rawBottle);
addContactShadow(rawTable, 2.95, -0.38, 1.2, 1.1, 0.786);
const rawBowl = new THREE.Group();
rawBowl.add(
handmadeLathe(
[
[0, 0], [0.37, 0], [0.58, 0.05], [0.76, 0.2],
[0.86, 0.44], [0.88, 0.62], [0.84, 0.69], [0.78, 0.68],
[0.76, 0.56], [0.69, 0.36], [0.54, 0.2], [0.36, 0.13],
[0, 0.11]
],
rawClay,
12.9
)
);
addRing(rawBowl, 0.845, 0.48, 0.011, rawClayAccent);
addRing(rawBowl, 0.79, 0.35, 0.01, rawClayAccent);
rawBowl.position.set(4.03, 0.78, 0.4);
rawTable.add(rawBowl);
addContactShadow(rawTable, 4.03, 0.4, 1.75, 1.35, 0.786);
const rawPinchedForm = new THREE.Group();
rawPinchedForm.add(
handmadeLathe(
[
[0, 0], [0.31, 0], [0.45, 0.09], [0.5, 0.33],
[0.4, 0.57], [0.48, 0.88], [0.45, 1.15], [0.31, 1.37],
[0.21, 1.53], [0.22, 1.67], [0.18, 1.75], [0.12, 1.74],
[0.11, 1.62], [0.15, 1.49], [0.24, 1.31], [0.35, 1.1],
[0.36, 0.86], [0.31, 0.58], [0.38, 0.33], [0.29, 0.12],
[0, 0.1]
],
rawClay,
17.3,
80
)
);
rawPinchedForm.rotation.y = -0.38;
rawPinchedForm.position.set(4.88, 0.78, -0.72);
rawTable.add(rawPinchedForm);
addContactShadow(rawTable, 4.88, -0.72, 1.05, 1.05, 0.786);
// -------------------------------------------------------------------------
// Subtle kiln dust
// -------------------------------------------------------------------------
const dustCount = 85;
const dustPositions = new Float32Array(dustCount * 3);
const dustRandom = mulberry32(2024);
for (let i = 0; i < dustCount; i++) {
dustPositions[i * 3] = -6.1 + dustRandom() * 8.5;
dustPositions[i * 3 + 1] = 0.3 + dustRandom() * 4.8;
dustPositions[i * 3 + 2] = -2.9 + dustRandom() * 2.1;
}
const dustGeometry = new THREE.BufferGeometry();
dustGeometry.setAttribute(
"position",
new THREE.BufferAttribute(dustPositions, 3)
);
const dust = new THREE.Points(
dustGeometry,
new THREE.PointsMaterial({
color: 0xf0d3ae,
size: 0.027,
transparent: true,
opacity: 0.36,
depthWrite: false,
sizeAttenuation: true
})
);
scene.add(dust);
// -------------------------------------------------------------------------
// Camera controls implemented directly without addons
// -------------------------------------------------------------------------
const canvas = renderer.domElement;
let dragging = false;
let previousX = 0;
let previousY = 0;
canvas.addEventListener("pointerdown", (event) => {
dragging = true;
previousX = event.clientX;
previousY = event.clientY;
canvas.setPointerCapture(event.pointerId);
});
canvas.addEventListener("pointermove", (event) => {
if (!dragging) return;
const deltaX = event.clientX - previousX;
const deltaY = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
spherical.theta -= deltaX * 0.005;
spherical.phi -= deltaY * 0.005;
spherical.phi = THREE.MathUtils.clamp(spherical.phi, 0.72, 1.34);
spherical.theta = THREE.MathUtils.clamp(spherical.theta, -0.25, 1.22);
updateCamera();
});
function stopDragging(event) {
dragging = false;
if (event && canvas.hasPointerCapture(event.pointerId)) {
canvas.releasePointerCapture(event.pointerId);
}
}
canvas.addEventListener("pointerup", stopDragging);
canvas.addEventListener("pointercancel", stopDragging);
canvas.addEventListener(
"wheel",
(event) => {
event.preventDefault();
spherical.radius = THREE.MathUtils.clamp(
spherical.radius * Math.exp(event.deltaY * 0.001),
10,
21
);
updateCamera();
},
{ passive: false }
);
canvas.addEventListener("dblclick", () => {
spherical.copy(initialSpherical);
updateCamera();
});
window.addEventListener("keydown", (event) => {
if (event.key === "ArrowLeft") spherical.theta -= 0.08;
if (event.key === "ArrowRight") spherical.theta += 0.08;
if (event.key === "ArrowUp") spherical.phi -= 0.06;
if (event.key === "ArrowDown") spherical.phi += 0.06;
spherical.phi = THREE.MathUtils.clamp(spherical.phi, 0.72, 1.34);
spherical.theta = THREE.MathUtils.clamp(spherical.theta, -0.25, 1.22);
updateCamera();
});
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
});
// -------------------------------------------------------------------------
// Render loop
// -------------------------------------------------------------------------
const clock = new THREE.Clock();
renderer.setAnimationLoop(() => {
const elapsed = clock.getElapsedTime();
dust.rotation.y = Math.sin(elapsed * 0.08) * 0.025;
dust.position.y = Math.sin(elapsed * 0.23) * 0.025;
renderer.render(scene, camera);
});
requestAnimationFrame(() => {
document.getElementById("loading").classList.add("ready");
});
</script>
</body>
</html>
```