Prompt specification
Build or customize the Three.js 3D scene "Standing figure footprint exhibit" 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: Standing figure footprint exhibit
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/standing-figure-footprint-exhibit-x0983
Scene Description Prompt:
A voxel standing figure, footprints, and foot-arch cutaway with illustrative contact markers. Build one HTML file using Three.js from cdnjs.
Working Three.js Starter (standing-figure-footprint-exhibit-x0983):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Voxel Gait — Foot Arch Study</title>
<style>
:root {
--bg: #071018;
--panel: rgba(8, 21, 31, 0.82);
--line: rgba(113, 222, 220, 0.24);
--cyan: #73ded8;
--coral: #ff775f;
--cream: #f1e6d0;
--muted: #91a8af;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: var(--bg);
color: #edf8f7;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
canvas {
position: fixed;
inset: 0;
display: block;
touch-action: none;
}
.header {
position: fixed;
z-index: 5;
top: 30px;
left: 34px;
max-width: 520px;
pointer-events: none;
}
.eyebrow {
margin-bottom: 9px;
color: var(--cyan);
font-size: 11px;
font-weight: 750;
letter-spacing: 0.24em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: clamp(28px, 4vw, 52px);
font-weight: 650;
letter-spacing: -0.045em;
line-height: 0.98;
}
.subtitle {
max-width: 430px;
margin: 14px 0 0;
color: var(--muted);
font-size: 13px;
line-height: 1.55;
}
.legend {
position: fixed;
z-index: 5;
top: 31px;
right: 30px;
display: grid;
gap: 9px;
padding: 14px 16px;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--panel);
backdrop-filter: blur(12px);
pointer-events: none;
}
.legend-row {
display: flex;
align-items: center;
gap: 9px;
color: #c6d7d8;
font-size: 10px;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.swatch {
width: 18px;
height: 6px;
border-radius: 2px;
background: var(--cyan);
box-shadow: 0 0 12px rgba(115, 222, 216, 0.35);
}
.swatch.coral {
background: var(--coral);
box-shadow: 0 0 12px rgba(255, 119, 95, 0.35);
}
.swatch.bone {
background: var(--cream);
box-shadow: none;
}
.legend-note {
max-width: 210px;
margin-top: 3px;
color: #70888f;
font-size: 9px;
line-height: 1.45;
letter-spacing: 0.05em;
}
#annotations {
position: fixed;
inset: 0;
z-index: 4;
overflow: hidden;
pointer-events: none;
}
.annotation {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
will-change: transform;
}
.annotation .dot {
position: absolute;
top: -4px;
left: -4px;
width: 8px;
height: 8px;
border: 2px solid var(--cyan);
border-radius: 50%;
background: rgba(7, 16, 24, 0.85);
box-shadow: 0 0 14px rgba(115, 222, 216, 0.65);
}
.annotation.coral .dot {
border-color: var(--coral);
box-shadow: 0 0 14px rgba(255, 119, 95, 0.65);
}
.annotation .tag {
position: absolute;
left: var(--dx);
top: var(--dy);
transform: translate(-50%, -50%);
padding: 8px 10px;
border: 1px solid rgba(115, 222, 216, 0.22);
border-left: 2px solid var(--cyan);
border-radius: 5px;
background: rgba(7, 17, 25, 0.88);
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
color: #dceceb;
font-size: 9px;
font-weight: 700;
letter-spacing: 0.13em;
line-height: 1.35;
text-transform: uppercase;
white-space: nowrap;
backdrop-filter: blur(8px);
}
.annotation.coral .tag {
border-left-color: var(--coral);
}
.annotation .tag small {
display: block;
margin-top: 3px;
color: #82999f;
font-size: 8px;
font-weight: 550;
letter-spacing: 0.08em;
}
.controls {
position: fixed;
z-index: 6;
right: 28px;
bottom: 26px;
display: flex;
align-items: center;
gap: 14px;
}
.hint {
color: #718990;
font-size: 9px;
font-weight: 650;
letter-spacing: 0.14em;
text-transform: uppercase;
pointer-events: none;
}
button {
appearance: none;
border: 1px solid rgba(115, 222, 216, 0.3);
border-radius: 999px;
padding: 10px 15px;
background: rgba(8, 22, 31, 0.88);
color: var(--cyan);
cursor: pointer;
font: inherit;
font-size: 9px;
font-weight: 750;
letter-spacing: 0.14em;
text-transform: uppercase;
transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
button:hover {
border-color: rgba(115, 222, 216, 0.7);
background: rgba(17, 44, 53, 0.95);
transform: translateY(-1px);
}
.credit {
position: fixed;
z-index: 5;
left: 34px;
bottom: 27px;
color: #587078;
font-size: 9px;
font-weight: 650;
letter-spacing: 0.14em;
text-transform: uppercase;
pointer-events: none;
}
@media (max-width: 760px) {
.header {
top: 20px;
left: 20px;
}
.subtitle {
display: none;
}
.legend {
top: auto;
right: 16px;
bottom: 68px;
padding: 10px 12px;
}
.legend-row {
font-size: 8px;
}
.legend-note,
.credit,
.hint {
display: none;
}
.controls {
right: 16px;
bottom: 18px;
}
.annotation.optional {
display: none;
}
.annotation .tag {
font-size: 8px;
}
}
</style>
</head>
<body>
<header class="header">
<div class="eyebrow">Biomechanical study / 01</div>
<h1>Foot arch,<br />voxelized.</h1>
<p class="subtitle">
A stylized gait scene connecting a standing voxel figure, sequential footprints,
and a sagittal foot-arch cutaway with illustrative contact zones.
</p>
</header>
<aside class="legend" aria-label="Scene legend">
<div class="legend-row"><span class="swatch"></span>Structure / footprint</div>
<div class="legend-row"><span class="swatch coral"></span>Contact marker</div>
<div class="legend-row"><span class="swatch bone"></span>Cutaway bone</div>
<div class="legend-note">Illustrative biomechanics only. Not clinical data.</div>
</aside>
<div id="annotations"></div>
<div class="credit">Interactive three-dimensional study</div>
<div class="controls">
<span class="hint">Drag to orbit · Scroll to zoom</span>
<button id="reset" type="button">Reset view</button>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// -------------------------------------------------------------------------
// Renderer, scene, camera
// -------------------------------------------------------------------------
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x071018);
scene.fog = new THREE.FogExp2(0x071018, 0.026);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
100
);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.15;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
document.body.prepend(renderer.domElement);
// -------------------------------------------------------------------------
// Custom orbit controls — no external control modules
// -------------------------------------------------------------------------
const controls = {
target: new THREE.Vector3(0.15, 1.35, 0.1),
radius: 10.5,
theta: 0.55,
phi: 1.1,
dragging: false,
lastX: 0,
lastY: 0
};
function updateCamera() {
controls.phi = THREE.MathUtils.clamp(controls.phi, 0.48, 1.42);
controls.radius = THREE.MathUtils.clamp(controls.radius, 6.8, 16);
const offset = new THREE.Vector3().setFromSphericalCoords(
controls.radius,
controls.phi,
controls.theta
);
camera.position.copy(controls.target).add(offset);
camera.lookAt(controls.target);
}
function resetView() {
const compact = window.innerWidth < 760;
controls.target.set(compact ? 0.15 : 0.15, compact ? 1.5 : 1.35, 0.1);
controls.radius = compact ? 13.2 : 10.5;
controls.theta = 0.55;
controls.phi = 1.1;
updateCamera();
}
renderer.domElement.addEventListener("pointerdown", (event) => {
controls.dragging = true;
controls.lastX = event.clientX;
controls.lastY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!controls.dragging) return;
const dx = event.clientX - controls.lastX;
const dy = event.clientY - controls.lastY;
controls.theta -= dx * 0.006;
controls.phi -= dy * 0.005;
controls.lastX = event.clientX;
controls.lastY = event.clientY;
updateCamera();
});
function stopDragging(event) {
controls.dragging = false;
if (event.pointerId !== undefined) {
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
}
renderer.domElement.addEventListener("pointerup", stopDragging);
renderer.domElement.addEventListener("pointercancel", stopDragging);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
controls.radius *= Math.exp(event.deltaY * 0.001);
updateCamera();
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", resetView);
document.getElementById("reset").addEventListener("click", resetView);
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
});
// -------------------------------------------------------------------------
// Lighting
// -------------------------------------------------------------------------
scene.add(new THREE.HemisphereLight(0xa7dce1, 0x102028, 1.7));
const key = new THREE.DirectionalLight(0xe9fffb, 3.0);
key.position.set(-4, 8, 7);
key.castShadow = true;
key.shadow.mapSize.set(2048, 2048);
key.shadow.camera.left = -8;
key.shadow.camera.right = 8;
key.shadow.camera.top = 8;
key.shadow.camera.bottom = -8;
key.shadow.camera.near = 0.5;
key.shadow.camera.far = 25;
key.shadow.bias = -0.0004;
scene.add(key);
const rim = new THREE.DirectionalLight(0x63cfd6, 1.7);
rim.position.set(6, 4, -5);
scene.add(rim);
const warm = new THREE.PointLight(0xff775f, 10, 8, 2);
warm.position.set(3.7, 1.2, 2.0);
scene.add(warm);
// -------------------------------------------------------------------------
// Shared geometry and helpers
// -------------------------------------------------------------------------
const cubeGeometry = new THREE.BoxGeometry(1, 1, 1);
const cubeEdges = new THREE.EdgesGeometry(cubeGeometry);
const cylinderGeometry = new THREE.CylinderGeometry(1, 1, 1, 24);
const torusGeometry = new THREE.TorusGeometry(1, 0.055, 10, 48);
const coneGeometry = new THREE.ConeGeometry(1, 1, 16);
const materials = {
floor: new THREE.MeshStandardMaterial({
color: 0x09151d,
roughness: 0.96,
metalness: 0.02
}),
platform: new THREE.MeshStandardMaterial({
color: 0x10232d,
roughness: 0.78,
metalness: 0.12
}),
frame: new THREE.LineBasicMaterial({
color: 0x73ded8,
transparent: true,
opacity: 0.32
}),
body: new THREE.MeshStandardMaterial({
color: 0xe5eee9,
roughness: 0.6,
metalness: 0.04
}),
bodyShade: new THREE.MeshStandardMaterial({
color: 0x78939a,
roughness: 0.68,
metalness: 0.05
}),
bodyDark: new THREE.MeshStandardMaterial({
color: 0x193541,
roughness: 0.58,
metalness: 0.12
}),
cyan: new THREE.MeshStandardMaterial({
color: 0x65d5d0,
emissive: 0x2b8f91,
emissiveIntensity: 0.7,
roughness: 0.45,
metalness: 0.1
}),
cyanSoft: new THREE.MeshStandardMaterial({
color: 0x8ee9e1,
emissive: 0x225d62,
emissiveIntensity: 0.4,
transparent: true,
opacity: 0.72,
roughness: 0.7
}),
coral: new THREE.MeshStandardMaterial({
color: 0xff775f,
emissive: 0x8f2417,
emissiveIntensity: 0.9,
roughness: 0.46
}),
coralSoft: new THREE.MeshStandardMaterial({
color: 0xff775f,
emissive: 0x6d1d14,
emissiveIntensity: 0.45,
transparent: true,
opacity: 0.58,
roughness: 0.7
}),
skin: new THREE.MeshStandardMaterial({
color: 0xc78e70,
roughness: 0.8,
metalness: 0,
transparent: true,
opacity: 0.72
}),
bone: new THREE.MeshStandardMaterial({
color: 0xf1dfb9,
roughness: 0.55,
metalness: 0.03
}),
panel: new THREE.MeshStandardMaterial({
color: 0x0a1822,
roughness: 0.84,
metalness: 0.16
}),
panelEdge: new THREE.MeshBasicMaterial({
color: 0x73ded8,
transparent: true,
opacity: 0.18
})
};
function voxel(parent, x, y, z, sx, sy, sz, material, castShadow = true) {
const mesh = new THREE.Mesh(cubeGeometry, material);
mesh.position.set(x, y, z);
mesh.scale.set(sx, sy, sz);
mesh.castShadow = castShadow;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function outlinedVoxel(parent, x, y, z, sx, sy, sz, material, lineMaterial) {
const mesh = voxel(parent, x, y, z, sx, sy, sz, material);
const outline = new THREE.LineSegments(cubeEdges, lineMaterial);
outline.position.copy(mesh.position);
outline.scale.copy(mesh.scale);
parent.add(outline);
return mesh;
}
const pulseObjects = [];
function createContactMarker(
parent,
x,
z,
radius,
phase = 0,
frontZ = 0
) {
const group = new THREE.Group();
group.position.set(x, 0.01, z);
parent.add(group);
const disc = new THREE.Mesh(cylinderGeometry, materials.coralSoft);
disc.scale.set(radius, 0.025, radius);
disc.position.z = frontZ;
group.add(disc);
const ring = new THREE.Mesh(torusGeometry, materials.coral);
ring.scale.setScalar(radius);
ring.rotation.x = Math.PI / 2;
ring.position.z = frontZ;
group.add(ring);
pulseObjects.push({ mesh: ring, phase, base: radius });
return group;
}
// -------------------------------------------------------------------------
// Ground and floor grid
// -------------------------------------------------------------------------
const floor = new THREE.Mesh(new THREE.PlaneGeometry(30, 30), materials.floor);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.09;
floor.receiveShadow = true;
scene.add(floor);
const floorGrid = new THREE.GridHelper(22, 44, 0x24515a, 0x16313a);
floorGrid.position.y = -0.075;
floorGrid.material.transparent = true;
floorGrid.material.opacity = 0.42;
scene.add(floorGrid);
// Left display platform
const stand = new THREE.Group();
stand.position.set(-2.4, 0.02, -0.25);
scene.add(stand);
outlinedVoxel(
stand,
0,
0,
0,
2.75,
0.2,
2.2,
materials.platform,
materials.frame
);
// Small platform grid
const standGrid = new THREE.GridHelper(2.65, 10, 0x32636a, 0x244952);
standGrid.scale.z = 2.15 / 2.65;
standGrid.position.y = 0.105;
standGrid.material.transparent = true;
standGrid.material.opacity = 0.34;
stand.add(standGrid);
// -------------------------------------------------------------------------
// Voxel standing figure
// -------------------------------------------------------------------------
const figure = new THREE.Group();
figure.position.set(-2.4, 0.12, -0.15);
scene.add(figure);
// Feet
voxel(figure, -0.18, 0.11, 0.04, 0.28, 0.22, 0.62, materials.bodyDark);
voxel(figure, 0.18, 0.11, 0.04, 0.28, 0.22, 0.62, materials.bodyDark);
voxel(figure, -0.18, 0.24, 0.14, 0.29, 0.07, 0.39, materials.cyan);
voxel(figure, 0.18, 0.24, 0.14, 0.29, 0.07, 0.39, materials.cyan);
// Legs
voxel(figure, -0.18, 0.96, 0, 0.28, 1.43, 0.31, materials.bodyShade);
voxel(figure, 0.18, 0.96, 0, 0.28, 1.43, 0.31, materials.body);
voxel(figure, -0.18, 1.61, 0.01, 0.3, 0.22, 0.32, materials.bodyDark);
voxel(figure, 0.18, 1.61, 0.01, 0.3, 0.22, 0.32, materials.bodyDark);
// Pelvis
for (let col = -1; col <= 1; col++) {
voxel(
figure,
col * 0.3,
1.86,
0,
0.29,
0.29,
0.34,
col === 0 ? materials.bodyDark : materials.bodyShade
);
}
// Torso
for (let row = 0; row < 3; row++) {
for (let col = -1; col <= 1; col++) {
const accent = row === 1 && col === 0;
voxel(
figure,
col * 0.3,
2.16 + row * 0.3,
0,
0.29,
0.29,
0.34,
accent ? materials.cyan : row === 2 ? materials.body : materials.bodyShade
);
}
}
// Shoulder blocks
voxel(figure, -0.58, 2.61, 0, 0.3, 0.3, 0.34, materials.bodyShade);
voxel(figure, 0.58, 2.61, 0, 0.3, 0.3, 0.34, materials.body);
// Arms
voxel(figure, -0.61, 2.3, 0, 0.24, 0.44, 0.25, materials.bodyShade);
voxel(figure, 0.61, 2.3, 0, 0.24, 0.44, 0.25, materials.body);
voxel(figure, -0.63, 1.92, 0, 0.22, 0.38, 0.23, materials.bodyDark);
voxel(figure, 0.63, 1.92, 0, 0.22, 0.38, 0.23, materials.bodyDark);
voxel(figure, -0.64, 1.64, 0, 0.21, 0.24, 0.22, materials.cyanSoft);
voxel(figure, 0.64, 1.64, 0, 0.21, 0.24, 0.22, materials.cyanSoft);
// Neck and head
voxel(figure, 0, 2.91, 0, 0.24, 0.22, 0.24, materials.bodyDark);
voxel(figure, 0, 3.19, 0, 0.52, 0.52, 0.5, materials.body);
voxel(figure, 0, 3.46, -0.01, 0.53, 0.1, 0.51, materials.bodyDark);
voxel(figure, -0.11, 3.23, 0.258, 0.07, 0.07, 0.035, materials.bodyDark);
voxel(figure, 0.11, 3.23, 0.258, 0.07, 0.07, 0.035, materials.bodyDark);
voxel(figure, 0, 3.11, 0.26, 0.08, 0.035, 0.035, materials.cyan);
// Contact markers under the standing feet
createContactMarker(figure, -0.18, 0.04, 0.21, 0.2);
createContactMarker(figure, 0.18, 0.04, 0.21, 2.4);
// -------------------------------------------------------------------------
// Voxel footprints
// -------------------------------------------------------------------------
function createFootprint(x, z, rotation, mirror = false) {
const group = new THREE.Group();
group.position.set(x, -0.045, z);
group.rotation.y = rotation;
scene.add(group);
const cells = [
[-0.14, -0.39, 0.27, 0.22],
[0.14, -0.39, 0.27, 0.22],
[-0.1, -0.18, 0.19, 0.21],
[0.1, -0.18, 0.19, 0.21],
[-0.17, 0.08, 0.22, 0.24],
[0.03, 0.08, 0.22, 0.24],
[-0.22, 0.32, 0.16, 0.2],
[-0.04, 0.32, 0.16, 0.2],
[0.14, 0.32, 0.16, 0.2],
[-0.18, 0.49, 0.09, 0.13],
[-0.06, 0.49, 0.09, 0.13],
[0.06, 0.49, 0.09, 0.13],
[0.18, 0.49, 0.09, 0.13]
];
cells.forEach(([cx, cz, sx, sz], index) => {
const signedX = mirror ? -cx : cx;
voxel(
group,
signedX,
0.015,
cz,
sx * 0.96,
0.025,
sz * 0.96,
index % 4 === 0 ? materials.cyanSoft : materials.cyan,
false
);
});
// Pressure hotspots on heel and forefoot
const heel = new THREE.Mesh(cylinderGeometry, materials.coralSoft);
heel.scale.set(0.13, 0.018, 0.13);
heel.position.set(mirror ? 0.14 : -0.14, 0.043, -0.37);
group.add(heel);
const ball = new THREE.Mesh(cylinderGeometry, materials.coralSoft);
ball.scale.set(0.18, 0.018, 0.14);
ball.position.set(mirror ? -0.04 : 0.04, 0.043, 0.32);
group.add(ball);
const heelRing = new THREE.Mesh(torusGeometry, materials.coral);
heelRing.scale.set(0.13);
heelRing.rotation.x = Math.PI / 2;
heelRing.position.copy(heel.position);
heelRing.position.y += 0.01;
group.add(heelRing);
pulseObjects.push({ mesh: heelRing, phase: 1.1, base: 0.13 });
return group;
}
createFootprint(-2.9, 1.65, -0.13, false);
createFootprint(-1.96, 1.96, 0.12, true);
// Dashed gait path
const pathPoints = [
new THREE.Vector3(-2.65, -0.035, 0.65),
new THREE.Vector3(-2.52, -0.035, 1.05),
new THREE.Vector3(-2.4, -0.035, 1.38)
];
const gaitPath = new THREE.Line(
new THREE.BufferGeometry().setFromPoints(pathPoints),
new THREE.LineDashedMaterial({
color: 0x73ded8,
dashSize: 0.12,
gapSize: 0.1,
transparent: true,
opacity: 0.42
})
);
gaitPath.computeLineDistances();
scene.add(gaitPath);
// -------------------------------------------------------------------------
// Arch cutaway display panel
// -------------------------------------------------------------------------
const panelGroup = new THREE.Group();
scene.add(panelGroup);
const panelCenterX = 2.55;
const panelCenterY = 1.6;
const panelWidth = 4.55;
const panelHeight = 3.0;
outlinedVoxel(
panelGroup,
panelCenterX,
panelCenterY,
-0.76,
panelWidth,
panelHeight,
0.1,
materials.panel,
materials.frame
);
// Technical grid on the backplate
const gridPositions = [];
const panelLeft = panelCenterX - panelWidth / 2 + 0.12;
const panelRight = panelCenterX + panelWidth / 2 - 0.12;
const panelBottom = panelCenterY - panelHeight / 2 + 0.12;
const panelTop = panelCenterY + panelHeight / 2 - 0.12;
for (let x = panelLeft; x <= panelRight + 0.01; x += 0.38) {
gridPositions.push(x, panelBottom, -0.702, x, panelTop, -0.702);
}
for (let y = panelBottom; y <= panelTop + 0.01; y += 0.38) {
gridPositions.push(panelLeft, y, -0.702, panelRight, y, -0.702);
}
const panelGridGeometry = new THREE.BufferGeometry();
panelGridGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(gridPositions, 3)
);
const panelGrid = new THREE.LineSegments(
panelGridGeometry,
new THREE.LineBasicMaterial({
color: 0x3b7b83,
transparent: true,
opacity: 0.18
})
);
panelGroup.add(panelGrid);
// Lower display plinth
outlinedVoxel(
panelGroup,
2.55,
0.03,
-0.03,
4.65,
0.18,
1.38,
materials.platform,
materials.frame
);
// -------------------------------------------------------------------------
// Voxel sagittal foot and cutaway bones
// -------------------------------------------------------------------------
const foot = new THREE.Group();
foot.position.set(2.58, 0.25, -0.08);
panelGroup.add(foot);
const cell = 0.22;
function fillVoxelInterval(row, start, end) {
for (let x = start; x < end - 0.001; x += cell) {
const width = Math.min(cell, end - x);
voxel(
foot,
x + width / 2,
row * cell + cell / 2,
-0.14,
width - 0.012,
cell - 0.012,
0.28,
materials.skin
);
}
}
// Rear tissue shell. The open underside defines the medial arch.
fillVoxelInterval(0, -1.0, -0.42);
fillVoxelInterval(0, 0.46, 1.24);
fillVoxelInterval(1, -1.12, -0.24);
fillVoxelInterval(1, 0.24, 1.34);
fillVoxelInterval(2, -1.02, 1.22);
fillVoxelInterval(3, -0.76, 0.96);
// A few foreground tissue voxels create a convincing cut edge.
voxel(foot, -0.93, 0.10, 0.06, 0.2, 0.2, 0.16, materials.skin);
voxel(foot, -0.75, 0.32, 0.055, 0.2, 0.2, 0.16, materials.skin);
voxel(foot, 0.34, 0.10, 0.06, 0.2, 0.2, 0.16, materials.skin);
voxel(foot, 0.56, 0.32, 0.055, 0.2, 0.2, 0.16, materials.skin);
voxel(foot, 0.78, 0.32, 0.055, 0.2, 0.2, 0.16, materials.skin);
voxel(foot, 1.0, 0.32, 0.055, 0.2, 0.2, 0.16, materials.skin);
// Bones displayed in front of the cut surface
voxel(foot, -0.76, 0.18, 0.13, 0.42, 0.16, 0.19, materials.bone); // calcaneus
voxel(foot, -0.39, 0.38, 0.14, 0.25, 0.18, 0.18, materials.bone); // talus
voxel(foot, -0.10, 0.37, 0.14, 0.22, 0.16, 0.17, materials.bone); // navicular
voxel(foot, 0.14, 0.36, 0.14, 0.2, 0.16, 0.17, materials.bone); // cuneiform
[0.4, 0.63, 0.86].forEach((x, index) => {
voxel(foot, x, 0.37, 0.14, 0.13, 0.27 - index * 0.02, 0.15, materials.bone);
});
voxel(foot, 1.08, 0.34, 0.14, 0.12, 0.2, 0.14, materials.bone);
voxel(foot, 1.22, 0.31, 0.14, 0.18, 0.1, 0.14, materials.bone);
// Joint accents
[
[-0.39, 0.38],
[-0.1, 0.37],
[0.14, 0.36],
[0.4, 0.39],
[0.63, 0.37],
[0.86, 0.35]
].forEach(([x, y]) => {
voxel(foot, x, y, 0.245, 0.07, 0.07, 0.04, materials.coral, false);
});
// Dashed arch curve
const archCurve = new THREE.CatmullRomCurve3([
new THREE.Vector3(-0.29, 0.06, 0.22),
new THREE.Vector3(-0.13, 0.27, 0.22),
new THREE.Vector3(0.09, 0.28, 0.22),
new THREE.Vector3(0.3, 0.05, 0.22)
]);
const archLine = new THREE.Line(
new THREE.BufferGeometry().setFromPoints(archCurve.getPoints(48)),
new THREE.LineDashedMaterial({
color: 0x73ded8,
dashSize: 0.08,
gapSize: 0.065,
transparent: true,
opacity: 0.95
})
);
archLine.computeLineDistances();
foot.add(archLine);
// Cutaway contact markers and force arrows
function createCutawayContact(x, phase) {
const disc = new THREE.Mesh(cylinderGeometry, materials.coralSoft);
disc.scale.set(0.14, 0.026, 0.14);
disc.position.set(x, -0.025, 0.08);
foot.add(disc);
const ring = new THREE.Mesh(torusGeometry, materials.coral);
ring.scale.set(0.16);
ring.rotation.x = Math.PI / 2;
ring.position.set(x, -0.008, 0.08);
foot.add(ring);
pulseObjects.push({ mesh: ring, phase, base: 0.16 });
const lineGeometry = new THREE.BufferGeometry().setFromPoints([
new THREE.Vector3(x, 0.03, 0.38),
new THREE.Vector3(x, 0.98, 0.38)
]);
const arrowLine = new THREE.Line(
lineGeometry,
new THREE.LineBasicMaterial({
color: 0xff775f,
transparent: true,
opacity: 0.85
})
);
foot.add(arrowLine);
const arrowHead = new THREE.Mesh(coneGeometry, materials.coral);
arrowHead.scale.set(0.09, 0.2, 0.09);
arrowHead.position.set(x, 1.04, 0.38);
foot.add(arrowHead);
}
createCutawayContact(-0.76, 0.6);
createCutawayContact(0.86, 3.0);
// -------------------------------------------------------------------------
// HTML annotations
// -------------------------------------------------------------------------
const annotationsLayer = document.getElementById("annotations");
const annotationEntries = [];
function makeAnchor(parent, x, y, z) {
const anchor = new THREE.Object3D();
anchor.position.set(x, y, z);
parent.add(anchor);
return anchor;
}
function addAnnotation({
anchor,
title,
detail = "",
dx = 0,
dy = -35,
coral = false,
optional = false
}) {
const wrapper = document.createElement("div");
wrapper.className = `annotation${coral ? " coral" : ""}${optional ? " optional" : ""}`;
const dot = document.createElement("span");
dot.className = "dot";
const tag = document.createElement("span");
tag.className = "tag";
tag.style.setProperty("--dx", `${dx}px`);
tag.style.setProperty("--dy", `${dy}px`);
tag.innerHTML = detail
? `${title}<small>${detail}</small>`
: title;
wrapper.append(dot, tag);
annotationsLayer.appendChild(wrapper);
annotationEntries.push({ wrapper, anchor });
}
const figureAnchor = makeAnchor(figure, 0, 3.8, 0);
addAnnotation({
anchor: figureAnchor,
title: "Voxel subject",
detail: "Standing reference posture",
dy: -32
});
const footprintAnchor = makeAnchor(scene, -2.45, 0.05, 2.12);
addAnnotation({
anchor: footprintAnchor,
title: "Gait impressions",
detail: "Alternating footprint sequence",
dy: 44,
optional: true
});
const panelAnchor = makeAnchor(panelGroup, 2.55, 2.98, -0.55);
addAnnotation({
anchor: panelAnchor,
title: "Medial arch cutaway",
detail: "Sagittal / voxel construction",
dy: -26
});
const heelAnchor = makeAnchor(foot, -0.76, 0.0, 0.18);
addAnnotation({
anchor: heelAnchor,
title: "Heel contact",
detail: "Illustrative loading zone",
dx: -60,
dy: 48,
coral: true,
optional: true
});
const archAnchor = makeAnchor(foot, 0.02, 0.17, 0.22);
addAnnotation({
anchor: archAnchor,
title: "Arch void",
detail: "Reduced midfoot contact",
dx: -8,
dy: 47,
optional: true
});
const forefootAnchor = makeAnchor(foot, 0.86, 0.0, 0.18);
addAnnotation({
anchor: forefootAnchor,
title: "Forefoot contact",
detail: "Illustrative loading zone",
dx: 66,
dy: 47,
coral: true,
optional: true
});
const projected = new THREE.Vector3();
function updateAnnotations() {
annotationEntries.forEach(({ wrapper, anchor }) => {
anchor.getWorldPosition(projected);
projected.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;
wrapper.style.display = visible ? "block" : "none";
const x = (projected.x * 0.5 + 0.5) * window.innerWidth;
const y = (-projected.y * 0.5 + 0.5) * window.innerHeight;
wrapper.style.transform = `translate(${x}px, ${y}px)`;
});
}
// -------------------------------------------------------------------------
// Animation
// -------------------------------------------------------------------------
const clock = new THREE.Clock();
function animate() {
const elapsed = clock.getElapsedTime();
pulseObjects.forEach(({ mesh, phase, base }) => {
const pulse = 1 + Math.sin(elapsed * 2.15 + phase) * 0.09;
mesh.scale.setScalar(base * pulse);
});
materials.cyan.emissiveIntensity = 0.64 + Math.sin(elapsed * 1.4) * 0.1;
materials.coral.emissiveIntensity = 0.82 + Math.sin(elapsed * 1.8 + 0.8) * 0.14;
scene.updateMatrixWorld();
updateAnnotations();
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
resetView();
animate();
</script>
</body>
</html>
```