Prompt specification
Build or customize the Three.js 3D scene "Pottery and cultivation evidence display" 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 and cultivation evidence display
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/pottery-and-cultivation-evidence-display-x2573
Scene Description Prompt:
Please create one self-contained HTML file with Three.js from cdnjs showing historical Bantu-language expansion. Place a pottery fragment, plant model, and language-family diagram on separate supports. Label them as different evidence types rather than direct proof of one person's migration. Stylized solid forms.
Acceptance criteria: Construct the requested objects and initialize them in the starting view. Clearly distinguish sources from interpretation.
Technical checks: Render all three evidence pieces with their source and interpretation clearly separated. Validate every diagram edge against the defined nodes.
Return one complete HTML document. The file must run in a sandbox allowing inline scripts and the cdnjs Three.js r160 module. Construct procedural assets, use local event handlers and avoid remote assets, runtime network requests besides Three.js, pointer lock and native form submission. Keep the main requested geometry visible in the initial view.
Working Three.js Starter (pottery-and-cultivation-evidence-display-x2573):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bantu-language expansion — an evidence gallery</title>
<link rel="icon" href="data:,">
<style>
:root {
color-scheme: dark;
--ink: #eef1e8;
--muted: #aab9b5;
--panel: rgba(9, 19, 22, 0.91);
--line: rgba(221, 229, 215, 0.16);
--gold: #e5ad58;
--teal: #67b9ae;
--rust: #d87558;
}
* { box-sizing: border-box; }
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #091215;
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;
}
#heading {
position: fixed;
z-index: 4;
top: 18px;
left: 20px;
right: 20px;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 24px;
pointer-events: none;
text-shadow: 0 2px 12px #000;
}
#heading h1 {
margin: 0;
color: var(--ink);
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(24px, 3.2vw, 44px);
font-weight: 500;
letter-spacing: -0.025em;
}
#heading p {
margin: 5px 0 0;
max-width: 760px;
color: #d2dcd7;
font-size: clamp(12px, 1.25vw, 16px);
line-height: 1.45;
}
.period {
display: inline-block;
margin-top: 10px;
padding: 5px 9px;
border: 1px solid rgba(229, 173, 88, 0.42);
border-radius: 999px;
color: #f1c98b;
background: rgba(20, 30, 29, 0.55);
font-size: 10px;
font-weight: 750;
letter-spacing: 0.11em;
text-transform: uppercase;
}
#controls {
display: flex;
gap: 8px;
pointer-events: auto;
}
button {
appearance: none;
border: 1px solid rgba(232, 239, 229, 0.23);
border-radius: 7px;
padding: 9px 12px;
color: #edf2e9;
background: rgba(9, 20, 22, 0.82);
font: inherit;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.03em;
cursor: pointer;
backdrop-filter: blur(8px);
}
button:hover,
button:focus-visible {
border-color: var(--gold);
color: #ffd797;
outline: none;
}
#interpretation {
position: fixed;
z-index: 4;
left: 16px;
right: 16px;
bottom: 14px;
max-width: 1280px;
margin: auto;
display: grid;
grid-template-columns: 1.25fr 1fr 1.25fr;
gap: 0;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 10px;
color: var(--ink);
background: linear-gradient(180deg, rgba(13, 27, 29, 0.94), rgba(7, 15, 17, 0.96));
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
backdrop-filter: blur(10px);
}
#interpretation section {
min-width: 0;
padding: 13px 17px 14px;
border-right: 1px solid var(--line);
}
#interpretation section:last-child {
border-right: 0;
}
#interpretation h2 {
margin: 0 0 5px;
color: var(--gold);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.13em;
text-transform: uppercase;
}
#interpretation p {
margin: 0;
color: #c5d0cb;
font-size: 11.5px;
line-height: 1.42;
}
#interpretation strong {
color: #f0f3ea;
}
#sources-panel {
position: fixed;
z-index: 10;
top: 0;
right: 0;
width: min(460px, 94vw);
height: 100%;
padding: 28px 30px;
overflow: auto;
border-left: 1px solid rgba(255, 255, 255, 0.15);
color: #edf2e9;
background: rgba(7, 15, 17, 0.97);
box-shadow: -20px 0 70px rgba(0, 0, 0, 0.48);
transform: translateX(105%);
transition: transform 220ms ease;
}
#sources-panel.open {
transform: translateX(0);
}
#sources-panel h2 {
margin: 0 0 8px;
font-family: Georgia, "Times New Roman", serif;
font-size: 28px;
font-weight: 500;
}
#sources-panel h3 {
margin: 24px 0 8px;
color: var(--gold);
font-size: 11px;
letter-spacing: 0.12em;
text-transform: uppercase;
}
#sources-panel p,
#sources-panel li {
color: #c8d2cd;
font-size: 13px;
line-height: 1.55;
}
#sources-panel ol {
padding-left: 20px;
}
#sources-panel li {
margin: 0 0 12px;
}
#source-close {
position: absolute;
top: 18px;
right: 18px;
padding: 7px 10px;
}
#loading {
position: fixed;
z-index: 20;
inset: 0;
display: grid;
place-items: center;
color: #e8eee8;
background: #091215;
font-size: 14px;
letter-spacing: 0.08em;
}
#loading div {
padding: 18px 22px;
border: 1px solid var(--line);
border-radius: 8px;
background: #102024;
}
@media (max-width: 900px) {
#heading {
display: block;
}
#controls {
position: fixed;
top: 14px;
right: 14px;
}
#interpretation {
grid-template-columns: 1fr;
max-height: 230px;
overflow: auto;
}
#interpretation section {
border-right: 0;
border-bottom: 1px solid var(--line);
}
}
@media (max-height: 680px) {
#interpretation {
display: none;
}
}
</style>
</head>
<body>
<div id="loading"><div>Building the evidence gallery…</div></div>
<header id="heading">
<div>
<h1>Bantu-language expansion</h1>
<p>An evidence gallery of archaeology, archaeobotany, and historical linguistics—not a portrait of one named migrant.</p>
<span class="period">Broad patterns · c. 3000 BCE–1000 CE · dates and routes remain debated</span>
</div>
<nav id="controls" aria-label="Exhibit controls">
<button id="reset" type="button">Reset view</button>
<button id="show-sources" type="button">Sources & method</button>
</nav>
</header>
<footer id="interpretation" aria-label="Interpretation and source summary">
<section>
<h2>Interpretation</h2>
<p><strong>Parallel evidence, not direct proof of one person’s journey.</strong> Ceramics and crops can move without their bearers; language trees reconstruct relationships, not individual itineraries.</p>
</section>
<section>
<h2>Three evidence types</h2>
<p><strong>Archaeology:</strong> pottery style and context · <strong>Archaeobotany:</strong> cultivated cereals · <strong>Linguistics:</strong> reconstructed family relationships.</p>
</section>
<section>
<h2>Selected sources</h2>
<p>Blench (2010), Maho (2003), Mitchell (2004), Huffman (2007). The colored map routes are schematic hypotheses, not dated individual paths.</p>
</section>
</footer>
<aside id="sources-panel" aria-hidden="true">
<button id="source-close" type="button" aria-label="Close sources">Close</button>
<h2>Sources & method</h2>
<p>The exhibit deliberately keeps three evidentiary scales separate. Their spatial and chronological overlap is compatible with population movement and the spread of ideas, but it does not uniquely identify the people who carried either objects or languages.</p>
<h3>Evidence streams</h3>
<p><strong>Pottery:</strong> a generic stylized fragment used to represent ceramic style, manufacture, chronology, and archaeological context. It is not assigned to a specific culture.</p>
<p><strong>Plant:</strong> a sorghum-like cereal model representing archaeobotanical evidence for cultivation and the movement of domesticated foods.</p>
<p><strong>Language tree:</strong> an illustrative classification of Bantu and several commonly discussed groupings. Higher-level classifications and branch names vary among linguists.</p>
<h3>Selected references</h3>
<ol>
<li>Blench, Roger. 2010. “Bantu Migrations and the African Iron Age.” In <em>The Cambridge History of Africa</em>, vol. 1, edited by John D. Clark and Cynthia J. Martin. Cambridge University Press.</li>
<li>Maho, Thomas F. 2003. “The Proto-Bantu Language and the Proto-Bantu Area.” In <em>Bantu Origins and Early African History</em>, edited by Roger Blench and David Schoen. Cambridge University Press.</li>
<li>Mitchell, Patrick J. 2004. “Why Bantu Is Not a Language.” In <em>Bantu Origins and Early African History</em>, edited by Roger Blench and David Schoen. Cambridge University Press.</li>
<li>Huffman, Kevin. 2007. <em>The African Iron Age</em>. Springer.</li>
</ol>
<h3>Map caveat</h3>
<p>The broad colored bands summarize common scholarly accounts of west-to-east and north-to-south expansion. Their exact paths, dates, number of movements, and relationship to archaeological horizons remain unresolved.</p>
</aside>
<script type="module">
import * as THREE from 'https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js';
const viewport = document.getElementById('loading');
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x091215);
scene.fog = new THREE.Fog(0x091215, 19, 34);
const camera = new THREE.PerspectiveCamera(42, innerWidth / innerHeight, 0.1, 80);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.setSize(innerWidth, innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.12;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.domElement.setAttribute('aria-label', 'Interactive three-dimensional exhibit showing a map and three archaeological, botanical, and linguistic evidence displays');
document.body.prepend(renderer.domElement);
const hemi = new THREE.HemisphereLight(0xc7ddd8, 0x30251e, 2.0);
scene.add(hemi);
const key = new THREE.DirectionalLight(0xffe4bd, 3.2);
key.position.set(7, 12, 10);
key.castShadow = true;
key.shadow.mapSize.set(2048, 2048);
key.shadow.camera.left = -13;
key.shadow.camera.right = 13;
key.shadow.camera.top = 12;
key.shadow.camera.bottom = -8;
key.shadow.camera.near = 1;
key.shadow.camera.far = 35;
key.shadow.bias = -0.0005;
scene.add(key);
const fill = new THREE.DirectionalLight(0x78b9c5, 1.2);
fill.position.set(-9, 7, 5);
scene.add(fill);
const warm = new THREE.PointLight(0xffb55e, 16, 14, 2);
warm.position.set(0, 5, -1);
scene.add(warm);
const materials = {
floor: new THREE.MeshStandardMaterial({ color: 0x102024, roughness: 0.96, metalness: 0.02 }),
stage: new THREE.MeshStandardMaterial({ color: 0x172a2d, roughness: 0.86 }),
dark: new THREE.MeshStandardMaterial({ color: 0x18282a, roughness: 0.7 }),
brass: new THREE.MeshStandardMaterial({ color: 0xa78349, roughness: 0.36, metalness: 0.62 }),
board: new THREE.MeshStandardMaterial({ color: 0x10272b, roughness: 0.86 }),
land: new THREE.MeshStandardMaterial({ color: 0x31594f, roughness: 0.92 }),
coast: new THREE.MeshStandardMaterial({ color: 0x5e8a74, roughness: 0.9 }),
gold: new THREE.MeshStandardMaterial({ color: 0xe3a94f, roughness: 0.42, metalness: 0.18 }),
teal: new THREE.MeshStandardMaterial({ color: 0x5db2a5, roughness: 0.48 }),
rust: new THREE.MeshStandardMaterial({ color: 0xd66f50, roughness: 0.66 })
};
const floor = new THREE.Mesh(new THREE.PlaneGeometry(50, 40), materials.floor);
floor.rotation.x = -Math.PI / 2;
floor.receiveShadow = true;
scene.add(floor);
const stage = new THREE.Mesh(new THREE.CylinderGeometry(9.2, 9.5, 0.16, 72), materials.stage);
stage.position.y = 0.04;
stage.receiveShadow = true;
scene.add(stage);
const grid = new THREE.GridHelper(28, 28, 0x294044, 0x1b3034);
grid.position.y = 0.13;
grid.material.transparent = true;
grid.material.opacity = 0.35;
scene.add(grid);
function roundedRect(ctx, x, y, w, h, r) {
ctx.beginPath();
ctx.moveTo(x + r, y);
ctx.arcTo(x + w, y, x + w, y + h, r);
ctx.arcTo(x + w, y + h, x, y + h, r);
ctx.arcTo(x, y + h, x, y, r);
ctx.arcTo(x, y, x + w, y, r);
ctx.closePath();
}
function makeCanvasTexture(width, height, draw) {
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
draw(ctx, width, height);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();
return texture;
}
function textPlane(lines, worldWidth, worldHeight) {
const texture = makeCanvasTexture(1400, 300, (ctx, w, h) => {
ctx.clearRect(0, 0, w, h);
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
lines.forEach((line, index) => {
ctx.fillStyle = line.color || '#edf0e7';
ctx.font = `${line.bold === false ? 500 : 800} ${line.size || 48}px ${line.font || 'Arial, sans-serif'}`;
ctx.fillText(line.text, w / 2, line.y ?? (75 + index * 82));
});
});
const material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
depthWrite: false,
toneMapped: false
});
const mesh = new THREE.Mesh(new THREE.PlaneGeometry(worldWidth, worldHeight), material);
mesh.renderOrder = 8;
return mesh;
}
function makePlaque(index, kind, title, body, source, accent) {
const texture = makeCanvasTexture(1200, 500, (ctx, w, h) => {
ctx.fillStyle = '#e9e0c8';
roundedRect(ctx, 8, 8, w - 16, h - 16, 18);
ctx.fill();
ctx.fillStyle = accent;
ctx.fillRect(8, 8, 23, h - 16);
ctx.fillStyle = '#172428';
ctx.textAlign = 'left';
ctx.textBaseline = 'middle';
ctx.font = '800 31px Arial, sans-serif';
ctx.fillText(`${index} / ${kind.toUpperCase()}`, 60, 72);
ctx.font = '800 54px Georgia, serif';
ctx.fillText(title, 60, 145);
ctx.fillStyle = '#3b4948';
ctx.font = '500 30px Arial, sans-serif';
ctx.fillText(body, 60, 230);
ctx.font = '700 27px Arial, sans-serif';
ctx.fillStyle = accent;
ctx.fillText(`SOURCE · ${source}`, 60, 340);
ctx.fillStyle = '#65706a';
ctx.font = '500 22px Arial, sans-serif';
ctx.fillText('Evidence stream — not a portrait of a single migrant', 60, 414);
});
const material = new THREE.MeshBasicMaterial({ map: texture, toneMapped: false });
const plaque = new THREE.Mesh(new THREE.PlaneGeometry(2.28, 0.95), material);
plaque.position.set(0, 0.54, 0.704);
plaque.renderOrder = 7;
return plaque;
}
function addPlinth(x, accent) {
const group = new THREE.Group();
group.position.set(x, 0, 1.0);
const base = new THREE.Mesh(
new THREE.CylinderGeometry(1.32, 1.46, 0.19, 48),
materials.dark
);
base.position.y = 0.17;
base.castShadow = true;
base.receiveShadow = true;
group.add(base);
const body = new THREE.Mesh(new THREE.BoxGeometry(1.9, 0.72, 1.35), materials.dark);
body.position.y = 0.62;
body.castShadow = true;
body.receiveShadow = true;
group.add(body);
const stripe = new THREE.Mesh(new THREE.BoxGeometry(1.93, 0.065, 1.38), accent);
stripe.position.y = 0.79;
group.add(stripe);
const top = new THREE.Mesh(new THREE.BoxGeometry(2.55, 0.16, 1.7), materials.dark);
top.position.y = 1.04;
top.castShadow = true;
top.receiveShadow = true;
group.add(top);
const topInset = new THREE.Mesh(
new THREE.BoxGeometry(2.26, 0.025, 1.46),
new THREE.MeshStandardMaterial({ color: 0x263b3b, roughness: 0.9 })
);
topInset.position.y = 1.13;
group.add(topInset);
scene.add(group);
return group;
}
function rodBetween(a, b, radius, material, radialSegments = 10) {
const direction = new THREE.Vector3().subVectors(b, a);
const length = direction.length();
const geometry = new THREE.CylinderGeometry(radius, radius, length, radialSegments);
const mesh = new THREE.Mesh(geometry, material);
mesh.position.copy(a).add(b).multiplyScalar(0.5);
mesh.quaternion.setFromUnitVectors(new THREE.Vector3(0, 1, 0), direction.normalize());
return mesh;
}
function makeCurvedSherd() {
const group = new THREE.Group();
const nu = 28;
const nv = 20;
const arc = 1.55;
const thickness = 0.13;
const vertices = [];
const indices = [];
for (let side = 0; side < 2; side++) {
for (let j = 0; j <= nv; j++) {
const v = j / nv;
const y = -0.72 + v * 1.5;
for (let i = 0; i <= nu; i++) {
const u = i / nu;
const theta = (u - 0.5) * arc + 0.07 * (v - 0.5);
const irregular = 0.025 * Math.sin(v * 11.0 + u * 5.0);
const radius = (side === 0 ? 1.0 : 1.0 - thickness) + irregular;
vertices.push(
Math.sin(theta) * radius,
y + 0.025 * Math.sin(u * 18.0),
Math.cos(theta) * radius
);
}
}
}
const row = nu + 1;
const layer = (nv + 1) * row;
for (let side = 0; side < 2; side++) {
const offset = side * layer;
for (let j = 0; j < nv; j++) {
for (let i = 0; i < nu; i++) {
const a = offset + j * row + i;
const b = a + 1;
const c = a + row;
const d = c + 1;
if (side === 0) indices.push(a, c, b, b, c, d);
else indices.push(a, b, c, b, d, c);
}
}
}
for (let i = 0; i < nu; i++) {
const a = i;
const b = i + 1;
const c = layer + i;
const d = layer + i + 1;
indices.push(a, b, c, b, d, c);
}
for (let j = 0; j < nv; j++) {
const a = j * row;
const b = (j + 1) * row;
const c = layer + j * row;
const d = layer + (j + 1) * row;
indices.push(a, c, b, b, c, d);
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));
geometry.setIndex(indices);
geometry.computeVertexNormals();
const pottery = new THREE.MeshStandardMaterial({
color: 0xad5938,
roughness: 0.88,
metalness: 0.0,
side: THREE.DoubleSide
});
const sherd = new THREE.Mesh(geometry, pottery);
sherd.castShadow = true;
sherd.receiveShadow = true;
group.add(sherd);
function addBand(centerY, bandHeight, color) {
const bandVertices = [];
const bandIndices = [];
const bandNu = 28;
const bandNv = 3;
for (let j = 0; j <= bandNv; j++) {
const v = j / bandNv;
const y = centerY + (v - 0.5) * bandHeight;
for (let i = 0; i <= bandNu; i++) {
const u = i / bandNu;
const theta = (u - 0.5) * arc + 0.07 * ((y + 0.72) / 1.5 - 0.5);
const radius = 1.025 + 0.025 * Math.sin(((y + 0.72) / 1.5) * 11.0 + u * 5.0);
bandVertices.push(Math.sin(theta) * radius, y, Math.cos(theta) * radius);
}
}
for (let j = 0; j < bandNv; j++) {
for (let i = 0; i < bandNu; i++) {
const a = j * (bandNu + 1) + i;
const b = a + 1;
const c = a + bandNu + 1;
const d = c + 1;
bandIndices.push(a, c, b, b, c, d);
}
}
const bandGeometry = new THREE.BufferGeometry();
bandGeometry.setAttribute('position', new THREE.Float32BufferAttribute(bandVertices, 3));
bandGeometry.setIndex(bandIndices);
bandGeometry.computeVertexNormals();
const bandMesh = new THREE.Mesh(
bandGeometry,
new THREE.MeshStandardMaterial({ color, roughness: 0.9, side: THREE.DoubleSide })
);
group.add(bandMesh);
}
addBand(0.24, 0.12, 0x442d29);
addBand(-0.12, 0.055, 0xe1b36e);
addBand(-0.39, 0.06, 0x442d29);
return group;
}
function makeLeaf(material, position, direction, length = 0.8, width = 0.2) {
const leaf = new THREE.Mesh(new THREE.SphereGeometry(1, 12, 8), material);
leaf.scale.set(width, length, 0.045);
leaf.position.copy(position).add(direction.clone().multiplyScalar(length * 0.62));
leaf.quaternion.setFromUnitVectors(new THREE.Vector3(0, 1, 0), direction.normalize());
leaf.castShadow = true;
return leaf;
}
function makePlant() {
const group = new THREE.Group();
const stemMat = new THREE.MeshStandardMaterial({ color: 0x5f813f, roughness: 0.82 });
const leafMat = new THREE.MeshStandardMaterial({ color: 0x78974b, roughness: 0.84 });
const grainMat = new THREE.MeshStandardMaterial({ color: 0xc56d3d, roughness: 0.72 });
const grainLightMat = new THREE.MeshStandardMaterial({ color: 0xd99a52, roughness: 0.74 });
const rootMat = new THREE.MeshStandardMaterial({ color: 0x69452d, roughness: 1.0 });
const points = [
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(0.03, 0.48, 0.01),
new THREE.Vector3(-0.02, 0.95, 0),
new THREE.Vector3(0.06, 1.42, 0.02),
new THREE.Vector3(0.10, 1.90, 0),
new THREE.Vector3(0.08, 2.35, -0.01)
];
for (let i = 0; i < points.length - 1; i++) {
const segment = rodBetween(points[i], points[i + 1], 0.052 - i * 0.005, stemMat, 10);
segment.castShadow = true;
group.add(segment);
}
const root = new THREE.Mesh(new THREE.SphereGeometry(0.32, 16, 10), rootMat);
root.scale.set(1.15, 0.45, 1);
root.position.y = 0.06;
root.castShadow = true;
group.add(root);
const leafSpecs = [
[0.00, 0.45, -0.98, 0.12, 0.88],
[0.02, 0.62, 0.91, -0.14, 0.76],
[-0.01, 0.91, -0.78, 0.34, 0.72],
[0.02, 1.12, 0.72, -0.40, 0.64],
[0.05, 1.38, -0.55, 0.58, 0.52],
[0.08, 1.67, 0.48, -0.65, 0.45]
];
leafSpecs.forEach(([x, y, z, dz, len]) => {
const direction = new THREE.Vector3(x * 0.15, 0.22, z).normalize();
const leaf = makeLeaf(leafMat, new THREE.Vector3(x, y, 0), direction, len, 0.19);
group.add(leaf);
});
const panicle = new THREE.Group();
panicle.position.set(0.08, 2.32, 0);
group.add(panicle);
let seed = 1937;
const random = () => {
seed = (seed * 16807) % 2147483647;
return (seed - 1) / 2147483646;
};
for (let ring = 0; ring < 7; ring++) {
const y = ring * 0.115;
const spread = 0.27 * (1 - ring / 9);
const count = 7 - Math.floor(ring / 2);
for (let i = 0; i < count; i++) {
const angle = (i / count) * Math.PI * 2 + ring * 0.47;
const grain = new THREE.Mesh(
new THREE.SphereGeometry(0.105, 9, 7),
i % 3 === 0 ? grainLightMat : grainMat
);
grain.scale.set(0.82, 1.35, 0.78);
grain.position.set(
Math.cos(angle) * spread + (random() - 0.5) * 0.045,
y + random() * 0.045,
Math.sin(angle) * spread + (random() - 0.5) * 0.045
);
grain.rotation.z = (random() - 0.5) * 0.45;
grain.castShadow = true;
panicle.add(grain);
}
}
return group;
}
function labelSprite(text, width = 1.2) {
const texture = makeCanvasTexture(700, 150, (ctx, w, h) => {
ctx.clearRect(0, 0, w, h);
roundedRect(ctx, 6, 12, w - 12, h - 24, 32);
ctx.fillStyle = 'rgba(7, 18, 20, 0.90)';
ctx.fill();
ctx.strokeStyle = 'rgba(210, 225, 211, 0.30)';
ctx.lineWidth = 3;
ctx.stroke();
ctx.fillStyle = '#edf0e7';
ctx.font = '800 47px Arial, sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(text, w / 2, h / 2 + 2);
});
const material = new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthWrite: false,
depthTest: false,
toneMapped: false
});
const sprite = new THREE.Sprite(material);
sprite.scale.set(width, width * 150 / 700, 1);
sprite.renderOrder = 12;
return sprite;
}
function makeLanguageBoard() {
const group = new THREE.Group();
group.position.set(4.25, 3.30, 0.82);
const board = new THREE.Mesh(new THREE.BoxGeometry(4.35, 4.25, 0.20), materials.board);
board.castShadow = true;
board.receiveShadow = true;
group.add(board);
const frameParts = [
[0, 2.16, 4.58, 0.13, 0.18],
[0, -2.16, 4.58, 0.13, 0.18],
[-2.23, 0, 0.13, 4.45, 0.18],
[2.23, 0, 0.13, 4.45, 0.18]
];
frameParts.forEach(([x, y, w, h, d]) => {
const frame = new THREE.Mesh(new THREE.BoxGeometry(w, h, d), materials.brass);
frame.position.set(x, y, 0.04);
frame.castShadow = true;
group.add(frame);
});
const title = textPlane([
{ text: 'LANGUAGE-FAMILY RELATIONSHIPS', size: 54, color: '#f1eee0', y: 78 },
{ text: 'Comparative reconstruction · illustrative grouping', size: 30, color: '#74c4b9', y: 173, bold: false }
], 4.02, 0.73);
title.position.set(0, 1.84, 0.25);
group.add(title);
const root = new THREE.Vector3(-0.72, 1.18, 0.25);
const bantu = new THREE.Vector3(-0.72, 0.34, 0.25);
const children = [
new THREE.Vector3(-1.53, -0.70, 0.25),
new THREE.Vector3(-0.51, -0.70, 0.25),
new THREE.Vector3(0.51, -0.70, 0.25),
new THREE.Vector3(1.53, -0.70, 0.25)
];
const edgeMat = new THREE.MeshStandardMaterial({ color: 0x8fa49b, roughness: 0.6 });
group.add(rodBetween(root, bantu, 0.034, edgeMat, 8));
children.forEach(child => group.add(rodBetween(bantu, child, 0.027, edgeMat, 8)));
const rootNode = new THREE.Mesh(new THREE.SphereGeometry(0.14, 18, 12), materials.gold);
rootNode.position.copy(root);
rootNode.castShadow = true;
group.add(rootNode);
const bantuNode = new THREE.Mesh(new THREE.SphereGeometry(0.19, 20, 14), materials.teal);
bantuNode.position.copy(bantu);
bantuNode.castShadow = true;
group.add(bantuNode);
children.forEach(child => {
const node = new THREE.Mesh(new THREE.SphereGeometry(0.115, 16, 12), materials.rust);
node.position.copy(child);
node.castShadow = true;
group.add(node);
});
const rootLabel = labelSprite('Niger–Congo*', 1.48);
rootLabel.position.set(0.35, 1.18, 0.33);
group.add(rootLabel);
const bantuLabel = labelSprite('Bantu', 1.02);
bantuLabel.position.set(0.34, 0.34, 0.33);
group.add(bantuLabel);
const names = ['NW group', 'Central', 'East group', 'South group'];
children.forEach((child, index) => {
const label = labelSprite(names[index], 1.12);
label.position.set(child.x, -1.15, 0.33);
group.add(label);
});
const note = textPlane([
{ text: '*Higher-level placement and branch taxonomy vary.', size: 27, color: '#aebdb7', y: 60, bold: false },
{ text: 'A tree shows relationships, not individual migration paths.', size: 27, color: '#e5ad58', y: 135, bold: false },
{ text: 'SOURCES · MAHO 2003 · BLENCH 2010', size: 25, color: '#7f9690', y: 220, bold: false }
], 3.95, 0.82);
note.position.set(0, -1.78, 0.26);
group.add(note);
const strut = new THREE.Mesh(new THREE.BoxGeometry(0.16, 1.10, 0.18), materials.brass);
strut.position.set(0, -2.43, -0.08);
group.add(strut);
return group;
}
function makeMapBoard() {
const group = new THREE.Group();
group.position.set(0, 4.38, -4.18);
const backing = new THREE.Mesh(new THREE.BoxGeometry(13.35, 7.25, 0.28), materials.dark);
backing.castShadow = true;
backing.receiveShadow = true;
group.add(backing);
const inner = new THREE.Mesh(new THREE.BoxGeometry(12.92, 6.82, 0.055), materials.board);
inner.position.z = 0.17;
group.add(inner);
const title = textPlane([
{ text: 'BANTU-LANGUAGE EXPANSION', size: 72, color: '#f0eee2', y: 70 },
{ text: 'schematic west → east and north → south patterns · c. 3000 BCE–1000 CE', size: 31, color: '#e5ad58', y: 168, bold: false }
], 10.8, 1.08);
title.position.set(-0.35, 2.95, 0.43);
group.add(title);
const outline = [
[-4.0, 1.45], [-2.80, 2.18], [-1.05, 2.15], [0.55, 1.80],
[2.00, 1.30], [2.68, 0.48], [2.45, -0.15], [1.78, -0.56],
[1.25, -1.22], [0.82, -2.83], [0.15, -3.18], [-0.43, -2.55],
[-0.65, -1.72], [-1.12, -1.03], [-1.50, -0.34], [-1.60, -1.18],
[-2.34, -1.38], [-3.18, -0.63], [-3.78, 0.42]
];
const shape = new THREE.Shape();
outline.forEach(([x, y], index) => {
if (index === 0) shape.moveTo(x, y);
else shape.lineTo(x, y);
});
shape.closePath();
const landGeometry = new THREE.ExtrudeGeometry(shape, {
depth: 0.10,
bevelEnabled: true,
bevelSegments: 2,
steps: 1,
bevelSize: 0.035,
bevelThickness: 0.035
});
const land = new THREE.Mesh(landGeometry, materials.land);
land.position.set(-0.15, -0.30, 0.20);
land.castShadow = true;
group.add(land);
const madagascar = new THREE.Mesh(new THREE.SphereGeometry(1, 16, 12), materials.land);
madagascar.scale.set(0.16, 0.48, 0.055);
madagascar.position.set(1.67, -2.27, 0.29);
group.add(madagascar);
function route(coords, color, label, labelX, labelY) {
const curve = new THREE.CatmullRomCurve3(
coords.map(([x, y]) => new THREE.Vector3(x, y, 0.43))
);
const tube = new THREE.Mesh(
new THREE.TubeGeometry(curve, 50, 0.045, 8, false),
new THREE.MeshStandardMaterial({ color, roughness: 0.42, emissive: color, emissiveIntensity: 0.12 })
);
group.add(tube);
const tangent = curve.getTangent(1).normalize();
const arrow = new THREE.Mesh(new THREE.ConeGeometry(0.13, 0.34, 12), color);
arrow.position.copy(curve.getPoint(0.985));
arrow.quaternion.setFromUnitVectors(new THREE.Vector3(0, 1, 0), tangent);
group.add(arrow);
const routeLabel = textPlane([
{ text: label, size: 31, color: '#dce5dd', y: 92, bold: false }
], 1.72, 0.31);
routeLabel.position.set(labelX, labelY, 0.49);
group.add(routeLabel);
}
route(
[[-0.48, 1.28], [-1.02, 0.75], [-1.46, 0.15], [-1.58, -0.52], [-1.72, -1.05]],
0xe2a44f,
'western stream',
-2.25, -0.55
);
route(
[[-0.30, 1.31], [0.48, 0.88], [1.05, 0.25], [1.10, -0.55], [0.87, -1.40], [0.39, -2.42]],
0x61b9ac,
'eastern stream',
1.78, -0.15
);
route(
[[-0.48, 1.28], [-0.19, 0.55], [-0.18, -0.25], [-0.10, -1.05], [0.05, -1.88], [0.18, -2.70]],
0xd66e50,
'southern spread',
0.56, -2.55
);
const coreRing = new THREE.Mesh(
new THREE.TorusGeometry(0.29, 0.035, 10, 40),
new THREE.MeshStandardMaterial({ color: 0xf0bf67, emissive: 0xe4a64c, emissiveIntensity: 0.28 })
);
coreRing.position.set(-0.46, 1.32, 0.52);
group.add(coreRing);
group.userData.coreRing = coreRing;
const coreLabel = textPlane([
{ text: 'POSSIBLE CORE REGION', size: 32, color: '#f0c77d', y: 55, bold: false },
{ text: 'exact homeland and chronology debated', size: 25, color: '#c0cbc4', y: 125, bold: false }
], 2.55, 0.62);
coreLabel.position.set(-1.86, 1.79, 0.51);
group.add(coreLabel);
const mapNote = textPlane([
{ text: 'ROUTES ARE BROAD SCHEMATIC HYPOTHESES — NOT ONE PERSON’S ITINERARY', size: 30, color: '#d7dfd8', y: 65, bold: false },
{ text: 'Archaeological horizons, crops and linguistic classifications must be correlated independently.', size: 27, color: '#9fb2aa', y: 135, bold: false }
], 8.8, 0.78);
mapNote.position.set(0.35, -3.08, 0.48);
group.add(mapNote);
const edgeMat = new THREE.MeshStandardMaterial({ color: 0x8a6c40, roughness: 0.45, metalness: 0.45 });
const topEdge = new THREE.Mesh(new THREE.BoxGeometry(13.55, 0.14, 0.36), edgeMat);
topEdge.position.set(0, 3.67, 0);
group.add(topEdge);
return group;
}
const mapBoard = makeMapBoard();
scene.add(mapBoard);
[-5.0, 5.0].forEach(x => {
const leg = new THREE.Mesh(new THREE.BoxGeometry(0.25, 1.65, 0.32), materials.brass);
leg.position.set(x, 0.72, -4.22);
leg.castShadow = true;
scene.add(leg);
});
const potteryPlinth = addPlinth(-4.25, materials.rust);
const potteryPlaque = makePlaque(
'01',
'Archaeological evidence',
'Pottery fragment',
'Style, manufacture, date and context track exchange.',
'HUFFMAN 2007',
'#b95739'
);
potteryPlinth.add(potteryPlaque);
const pottery = makeCurvedSherd();
pottery.position.set(0, 2.16, 0.02);
pottery.rotation.set(-0.10, 0.15, -0.07);
pottery.scale.setScalar(0.88);
potteryPlinth.add(pottery);
const cradle = new THREE.Mesh(
new THREE.BoxGeometry(1.20, 0.14, 0.60),
new THREE.MeshStandardMaterial({ color: 0x3b4b49, roughness: 0.8 })
);
cradle.position.set(0, 1.23, 0.03);
cradle.rotation.x = -0.10;
cradle.castShadow = true;
potteryPlinth.add(cradle);
const plantPlinth = addPlinth(0, materials.teal);
const plantPlaque = makePlaque(
'02',
'Archaeobotanical evidence',
'Sorghum-like cereal',
'Crops and cultivation can travel with communities.',
'HUFFMAN 2007',
'#287f72'
);
plantPlinth.add(plantPlaque);
const plant = makePlant();
plant.position.set(0, 1.17, -0.02);
plant.rotation.y = 0.15;
plantPlinth.add(plant);
const languagePlinth = addPlinth(4.25, materials.gold);
const languagePlaque = makePlaque(
'03',
'Linguistic evidence',
'Language-family diagram',
'Comparative reconstruction establishes relationships.',
'MAHO 2003 · BLENCH 2010',
'#a8782e'
);
languagePlinth.add(languagePlaque);
const languageBoard = makeLanguageBoard();
scene.add(languageBoard);
const target = new THREE.Vector3(0, 2.45, -0.25);
let radius = innerWidth < 900 ? 19.0 : 16.7;
let theta = 0.015;
let phi = 1.16;
let dragging = false;
let previousX = 0;
let previousY = 0;
function updateCamera() {
const horizontal = radius * Math.sin(phi);
camera.position.set(
target.x + horizontal * Math.sin(theta),
target.y + radius * Math.cos(phi),
target.z + horizontal * Math.cos(theta)
);
camera.lookAt(target);
}
function resetView() {
radius = innerWidth < 900 ? 19.0 : 16.7;
theta = 0.015;
phi = 1.16;
target.set(0, 2.45, -0.25);
updateCamera();
}
renderer.domElement.addEventListener('pointerdown', event => {
dragging = true;
previousX = event.clientX;
previousY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
renderer.domElement.style.cursor = 'grabbing';
});
renderer.domElement.addEventListener('pointermove', event => {
if (!dragging) return;
const dx = event.clientX - previousX;
const dy = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
theta -= dx * 0.005;
phi = THREE.MathUtils.clamp(phi + dy * 0.004, 0.72, 1.43);
updateCamera();
});
function endDrag(event) {
dragging = false;
renderer.domElement.style.cursor = 'grab';
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('dblclick', resetView);
renderer.domElement.addEventListener('wheel', event => {
event.preventDefault();
radius = THREE.MathUtils.clamp(radius + event.deltaY * 0.008, 11.5, 24.5);
updateCamera();
}, { passive: false });
renderer.domElement.style.cursor = 'grab';
document.getElementById('reset').addEventListener('click', resetView);
const sourcesPanel = document.getElementById('sources-panel');
document.getElementById('show-sources').addEventListener('click', () => {
sourcesPanel.classList.add('open');
sourcesPanel.setAttribute('aria-hidden', 'false');
document.getElementById('source-close').focus();
});
function closeSources() {
sourcesPanel.classList.remove('open');
sourcesPanel.setAttribute('aria-hidden', 'true');
document.getElementById('show-sources').focus();
}
document.getElementById('source-close').addEventListener('click', closeSources);
document.addEventListener('keydown', event => {
if (event.key === 'Escape' && sourcesPanel.classList.contains('open')) closeSources();
});
window.addEventListener('resize', () => {
camera.aspect = innerWidth / innerHeight;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.setSize(innerWidth, innerHeight);
});
updateCamera();
renderer.render(scene, camera);
viewport.remove();
const clock = new THREE.Clock();
function animate() {
const elapsed = clock.getElapsedTime();
mapBoard.userData.coreRing.scale.setScalar(1 + Math.sin(elapsed * 1.8) * 0.07);
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html>
```