Prompt specification
Build or customize the Three.js 3D scene "Signed number-line stepping stones" 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: Signed number-line stepping stones
Category: Algorithms & Systems · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/signed-number-line-stepping-stones-x1701
Scene Description Prompt:
I'd like to see this as a low-poly Three.js scene: signed number-line stepping stones. Build a number line with zero, equally spaced positive and negative markers, and one movable token; define direction explicitly and keep spacing proportional to value. Use cdnjs and return one self-contained HTML file.
Working Three.js Starter (signed-number-line-stepping-stones-x1701):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signed Number Line — Stepping Stones</title>
<style>
:root {
color-scheme: dark;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
--panel: rgba(15, 23, 42, 0.86);
--border: rgba(255, 255, 255, 0.14);
--text: #f8fafc;
--muted: #b8c3d6;
--positive: #43d6ad;
--negative: #ff7f7f;
--zero: #ffd166;
--token: #ff9f43;
}
* { box-sizing: border-box; }
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #dfe7e3;
}
#scene {
display: block;
width: 100%;
height: 100%;
outline: none;
touch-action: none;
}
#hud {
position: fixed;
inset: 0;
pointer-events: none;
}
.panel {
position: absolute;
color: var(--text);
background: var(--panel);
border: 1px solid var(--border);
border-radius: 18px;
box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
}
.intro {
top: 22px;
left: 22px;
width: min(440px, calc(100vw - 44px));
padding: 19px 21px 18px;
}
.eyebrow {
margin-bottom: 6px;
color: #93a4bd;
font-size: 0.7rem;
font-weight: 800;
letter-spacing: 0.16em;
text-transform: uppercase;
}
h1 {
margin: 0 0 13px;
font-size: clamp(1.35rem, 2.4vw, 1.85rem);
line-height: 1.1;
letter-spacing: -0.035em;
}
.direction {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 9px 10px;
margin-bottom: 12px;
background: rgba(255, 255, 255, 0.06);
border-radius: 12px;
font-size: 0.82rem;
font-weight: 800;
}
.direction .arrow {
color: #e2e8f0;
font-size: 1.25rem;
line-height: 1;
}
.negative { color: var(--negative); }
.positive { color: var(--positive); }
.zero { color: var(--zero); }
.intro p {
margin: 0;
color: var(--muted);
font-size: 0.86rem;
line-height: 1.55;
}
.intro strong { color: var(--text); }
.formula {
display: inline-block;
margin-top: 9px;
padding: 5px 9px;
color: #dbeafe;
background: rgba(59, 130, 246, 0.15);
border: 1px solid rgba(96, 165, 250, 0.2);
border-radius: 8px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.76rem;
}
.help {
top: 22px;
right: 22px;
max-width: 310px;
padding: 15px 17px;
color: var(--muted);
font-size: 0.78rem;
line-height: 1.55;
}
.help strong {
display: block;
margin-bottom: 5px;
color: var(--text);
font-size: 0.78rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}
kbd {
display: inline-block;
min-width: 1.4em;
padding: 1px 5px;
color: #f8fafc;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.16);
border-bottom-width: 2px;
border-radius: 5px;
font: 700 0.72rem ui-monospace, SFMono-Regular, Menlo, monospace;
text-align: center;
}
.controls {
left: 50%;
bottom: 24px;
display: flex;
align-items: center;
gap: 10px;
padding: 10px;
transform: translateX(-50%);
pointer-events: auto;
}
button {
min-height: 44px;
padding: 0 15px;
color: var(--text);
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 12px;
font: inherit;
font-weight: 750;
cursor: pointer;
transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}
button:hover:not(:disabled) {
background: rgba(255, 255, 255, 0.15);
transform: translateY(-1px);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible {
outline: 3px solid rgba(96, 165, 250, 0.75);
outline-offset: 2px;
}
button:disabled {
opacity: 0.35;
cursor: not-allowed;
}
#previous,
#next { min-width: 48px; }
#zero {
color: var(--zero);
background: rgba(255, 209, 102, 0.1);
}
.readout {
min-width: 112px;
padding: 0 12px;
text-align: center;
}
.readout small {
display: block;
color: #93a4bd;
font-size: 0.64rem;
font-weight: 800;
letter-spacing: 0.13em;
text-transform: uppercase;
}
#tokenValue {
display: block;
margin-top: 1px;
color: var(--token);
font: 850 1.45rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (max-width: 760px) {
.intro {
top: 12px;
left: 12px;
width: calc(100vw - 24px);
padding: 15px 16px;
}
.help { display: none; }
.controls {
bottom: 12px;
width: calc(100vw - 24px);
justify-content: center;
gap: 6px;
}
button {
min-width: 44px;
padding: 0 11px;
}
.readout {
min-width: 82px;
padding: 0 5px;
}
}
@media (max-width: 430px) {
.intro p { font-size: 0.78rem; }
.direction { font-size: 0.72rem; }
#zero { font-size: 0.76rem; }
}
</style>
</head>
<body>
<canvas
id="scene"
tabindex="0"
aria-label="Interactive low-poly number line with one movable token. Drag the token, click a numbered stone, or use the arrow keys."
></canvas>
<div id="hud">
<section class="panel intro">
<div class="eyebrow">Low-poly number line</div>
<h1>Signed stepping stones</h1>
<div class="direction" aria-label="Negative values are left of zero and positive values are right of zero">
<span class="negative">− negative</span>
<span class="arrow">←</span>
<span class="zero">0</span>
<span class="arrow">→</span>
<span class="positive">positive +</span>
</div>
<p>
<strong>Direction:</strong> values increase to the right. Every neighboring stone
is exactly one unit apart, so the token's position remains proportional to its value.
<span class="formula">x = value × unit</span>
</p>
</section>
<aside class="panel help">
<strong>Controls</strong>
Drag the orange token or click a stone. Use <kbd>←</kbd> <kbd>→</kbd> to step;
hold <kbd>Shift</kbd> for five units. <kbd>Home</kbd> returns to zero.<br><br>
Drag the background to orbit, shift-drag to pan, and use the wheel to zoom.
</aside>
<nav class="panel controls" aria-label="Token controls">
<button id="previous" type="button" aria-label="Move token one unit left">−1</button>
<div class="readout" aria-live="polite">
<small>Token</small>
<span id="tokenValue">+3</span>
</div>
<button id="next" type="button" aria-label="Move token one unit right">+1</button>
<button id="zero" type="button">Zero</button>
</nav>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const canvas = document.querySelector("#scene");
const valueDisplay = document.querySelector("#tokenValue");
const previousButton = document.querySelector("#previous");
const nextButton = document.querySelector("#next");
const zeroButton = document.querySelector("#zero");
const MIN_VALUE = -10;
const MAX_VALUE = 10;
const UNIT = 1.18;
const TOKEN_Y = 0.78;
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight, false);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.08;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xdfe7e3);
scene.fog = new THREE.Fog(0xdfe7e3, 23, 46);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
100
);
const hemisphere = new THREE.HemisphereLight(0xf7fbff, 0x607262, 2.0);
scene.add(hemisphere);
const sunlight = new THREE.DirectionalLight(0xfff1d6, 3.2);
sunlight.position.set(8, 13, 9);
sunlight.castShadow = true;
sunlight.shadow.mapSize.set(2048, 2048);
sunlight.shadow.camera.left = -18;
sunlight.shadow.camera.right = 18;
sunlight.shadow.camera.top = 14;
sunlight.shadow.camera.bottom = -10;
sunlight.shadow.camera.near = 1;
sunlight.shadow.camera.far = 40;
sunlight.shadow.bias = -0.0004;
scene.add(sunlight);
const fillLight = new THREE.DirectionalLight(0xb8d9ff, 0.75);
fillLight.position.set(-10, 7, -8);
scene.add(fillLight);
const groundMaterial = new THREE.MeshStandardMaterial({
color: 0x9eb4a6,
roughness: 0.95,
metalness: 0,
flatShading: true
});
const ground = new THREE.Mesh(
new THREE.PlaneGeometry(48, 34),
groundMaterial
);
ground.rotation.x = -Math.PI / 2;
ground.position.y = -0.2;
ground.receiveShadow = true;
scene.add(ground);
const plinthMaterial = new THREE.MeshStandardMaterial({
color: 0xe8ddc9,
roughness: 0.88,
metalness: 0.02,
flatShading: true
});
const lineLength = (MAX_VALUE - MIN_VALUE) * UNIT;
const plinth = new THREE.Mesh(
new THREE.BoxGeometry(lineLength + 2.2, 0.22, 1.9),
plinthMaterial
);
plinth.position.y = -0.04;
plinth.receiveShadow = true;
scene.add(plinth);
const axisMaterial = new THREE.MeshStandardMaterial({
color: 0x243447,
roughness: 0.7,
metalness: 0.05,
flatShading: true
});
const axis = new THREE.Mesh(
new THREE.CylinderGeometry(0.035, 0.035, lineLength, 6),
axisMaterial
);
axis.rotation.z = Math.PI / 2;
axis.position.y = 0.14;
axis.castShadow = true;
scene.add(axis);
const positiveColor = 0x43d6ad;
const negativeColor = 0xff7f7f;
const zeroColor = 0xffd166;
const markerMeshes = [];
function makeMaterial(color) {
return new THREE.MeshStandardMaterial({
color,
roughness: 0.76,
metalness: 0.03,
flatShading: true
});
}
const positiveMaterial = makeMaterial(positiveColor);
const negativeMaterial = makeMaterial(negativeColor);
const zeroMaterial = makeMaterial(zeroColor);
function createLabel(text, accent, width = 0.78) {
const labelCanvas = document.createElement("canvas");
labelCanvas.width = 256;
labelCanvas.height = 128;
const context = labelCanvas.getContext("2d");
context.clearRect(0, 0, 256, 128);
const x = 8;
const y = 14;
const w = 240;
const h = 100;
const radius = 28;
context.beginPath();
context.moveTo(x + radius, y);
context.lineTo(x + w - radius, y);
context.quadraticCurveTo(x + w, y, x + w, y + radius);
context.lineTo(x + w, y + h - radius);
context.quadraticCurveTo(x + w, y + h, x + w - radius, y + h);
context.lineTo(x + radius, y + h);
context.quadraticCurveTo(x, y + h, x, y + h - radius);
context.lineTo(x, y + radius);
context.quadraticCurveTo(x, y, x + radius, y);
context.closePath();
context.fillStyle = "rgba(15, 23, 42, 0.94)";
context.fill();
context.lineWidth = 7;
context.strokeStyle = `#${accent.toString(16).padStart(6, "0")}`;
context.stroke();
context.fillStyle = "#f8fafc";
context.font = "800 58px system-ui, sans-serif";
context.textAlign = "center";
context.textBaseline = "middle";
context.fillText(text, 128, 65);
const texture = new THREE.CanvasTexture(labelCanvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = Math.min(
4,
renderer.capabilities.getMaxAnisotropy()
);
const material = new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthWrite: false,
depthTest: true
});
const sprite = new THREE.Sprite(material);
sprite.scale.set(width, width * 0.5, 1);
return sprite;
}
for (let value = MIN_VALUE; value <= MAX_VALUE; value += 1) {
const isZero = value === 0;
const radius = isZero ? 0.4 : 0.33;
const height = isZero ? 0.36 : 0.28;
const material = isZero
? zeroMaterial
: value > 0
? positiveMaterial
: negativeMaterial;
const marker = new THREE.Mesh(
new THREE.CylinderGeometry(radius, radius * 1.04, height, 6),
material
);
marker.position.set(value * UNIT, 0.08 + height / 2, 0);
marker.castShadow = true;
marker.receiveShadow = true;
marker.userData.value = value;
markerMeshes.push(marker);
scene.add(marker);
const label = createLabel(
value > 0 ? `+${value}` : `${value}`,
isZero ? zeroColor : value > 0 ? positiveColor : negativeColor,
isZero ? 0.68 : 0.76
);
label.position.set(value * UNIT, 0.55, -0.58);
scene.add(label);
}
// Arrowheads make the increasing/rightward direction explicit in 3D.
const arrowHalfLength = lineLength / 2;
const positiveArrow = new THREE.Mesh(
new THREE.ConeGeometry(0.18, 0.55, 6),
positiveMaterial
);
positiveArrow.rotation.z = -Math.PI / 2;
positiveArrow.position.set(arrowHalfLength + 0.42, 0.15, 0);
positiveArrow.castShadow = true;
scene.add(positiveArrow);
const negativeArrow = new THREE.Mesh(
new THREE.ConeGeometry(0.18, 0.55, 6),
negativeMaterial
);
negativeArrow.rotation.z = Math.PI / 2;
negativeArrow.position.set(-arrowHalfLength - 0.42, 0.15, 0);
negativeArrow.castShadow = true;
scene.add(negativeArrow);
const positiveDirectionLabel = createLabel("+ direction", positiveColor, 1.35);
positiveDirectionLabel.position.set(arrowHalfLength + 0.42, 0.67, -0.15);
scene.add(positiveDirectionLabel);
const negativeDirectionLabel = createLabel("− direction", negativeColor, 1.35);
negativeDirectionLabel.position.set(-arrowHalfLength - 0.42, 0.67, -0.15);
scene.add(negativeDirectionLabel);
// A single movable, faceted token.
const token = new THREE.Group();
token.position.set(3 * UNIT, 0, 0);
scene.add(token);
const tokenMaterial = makeMaterial(0xff9138);
const tokenGem = new THREE.Mesh(
new THREE.IcosahedronGeometry(0.39, 0),
tokenMaterial
);
tokenGem.position.y = TOKEN_Y;
tokenGem.castShadow = true;
tokenGem.receiveShadow = true;
tokenGem.userData.isToken = true;
token.add(tokenGem);
const tokenRing = new THREE.Mesh(
new THREE.TorusGeometry(0.47, 0.045, 5, 16),
axisMaterial
);
tokenRing.rotation.x = Math.PI / 2;
tokenRing.position.y = 0.42;
tokenRing.castShadow = true;
token.add(tokenRing);
const tokenCrown = new THREE.Mesh(
new THREE.OctahedronGeometry(0.11, 0),
new THREE.MeshStandardMaterial({
color: 0xfff1d6,
roughness: 0.65,
flatShading: true
})
);
tokenCrown.position.y = 1.19;
tokenCrown.castShadow = true;
token.add(tokenCrown);
// Subtle low-poly scenery beyond the number-line platform.
const hillMaterial = makeMaterial(0x789487);
const hillPositions = [
[-12, -4.8, 2.1, 1.4],
[-8.5, -5.6, 1.5, 1.0],
[9.5, -5.2, 1.8, 1.1],
[13.2, -4.4, 1.25, 0.9]
];
for (const [x, z, radius, height] of hillPositions) {
const hill = new THREE.Mesh(
new THREE.ConeGeometry(radius, height, 5),
hillMaterial
);
hill.position.set(x, -0.2 + height / 2, z);
hill.rotation.y = x * 0.17;
hill.castShadow = true;
hill.receiveShadow = true;
scene.add(hill);
}
let tokenValue = 3;
let tokenTargetX = tokenValue * UNIT;
function formatValue(value) {
return value > 0 ? `+${value}` : `${value}`;
}
function updateReadout() {
valueDisplay.textContent = formatValue(tokenValue);
valueDisplay.style.color =
tokenValue > 0 ? "#43d6ad" :
tokenValue < 0 ? "#ff7f7f" :
"#ffd166";
previousButton.disabled = tokenValue <= MIN_VALUE;
nextButton.disabled = tokenValue >= MAX_VALUE;
}
function setTokenValue(value) {
tokenValue = THREE.MathUtils.clamp(
Math.round(value),
MIN_VALUE,
MAX_VALUE
);
tokenTargetX = tokenValue * UNIT;
if (reducedMotion) {
token.position.x = tokenTargetX;
}
updateReadout();
}
function stepToken(amount) {
setTokenValue(tokenValue + amount);
}
previousButton.addEventListener("click", () => stepToken(-1));
nextButton.addEventListener("click", () => stepToken(1));
zeroButton.addEventListener("click", () => setTokenValue(0));
// Camera controls are implemented directly here, without addons.
const cameraTarget = new THREE.Vector3(0, 0.2, 0);
let cameraTheta = 0.12;
let cameraPhi = 1.12;
let cameraRadius = 19.5;
function updateCamera() {
const sinPhi = Math.sin(cameraPhi);
camera.position.set(
cameraTarget.x + cameraRadius * sinPhi * Math.sin(cameraTheta),
cameraTarget.y + cameraRadius * Math.cos(cameraPhi),
cameraTarget.z + cameraRadius * sinPhi * Math.cos(cameraTheta)
);
camera.lookAt(cameraTarget);
camera.updateMatrixWorld();
}
updateCamera();
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
const dragPlane = new THREE.Plane(new THREE.Vector3(0, 1, 0), -TOKEN_Y);
const planeHit = new THREE.Vector3();
let interaction = null;
let lastPointerX = 0;
let lastPointerY = 0;
let dragOffset = 0;
function setPointerFromEvent(event) {
const bounds = canvas.getBoundingClientRect();
pointer.x = ((event.clientX - bounds.left) / bounds.width) * 2 - 1;
pointer.y = -((event.clientY - bounds.top) / bounds.height) * 2 + 1;
}
canvas.addEventListener("pointerdown", (event) => {
canvas.focus();
setPointerFromEvent(event);
raycaster.setFromCamera(pointer, camera);
if (event.button === 0) {
const tokenHits = raycaster.intersectObject(tokenGem, false);
if (tokenHits.length > 0) {
interaction = "token";
if (raycaster.ray.intersectPlane(dragPlane, planeHit)) {
dragOffset = token.position.x - planeHit.x;
} else {
dragOffset = 0;
}
} else {
const markerHits = raycaster.intersectObjects(markerMeshes, false);
if (markerHits.length > 0) {
setTokenValue(markerHits[0].object.userData.value);
return;
}
interaction = event.shiftKey ? "pan" : "orbit";
}
} else if (event.button === 1 || event.button === 2) {
interaction = "pan";
} else {
return;
}
lastPointerX = event.clientX;
lastPointerY = event.clientY;
canvas.setPointerCapture(event.pointerId);
event.preventDefault();
});
canvas.addEventListener("pointermove", (event) => {
if (!interaction) return;
const deltaX = event.clientX - lastPointerX;
const deltaY = event.clientY - lastPointerY;
lastPointerX = event.clientX;
lastPointerY = event.clientY;
if (interaction === "token") {
setPointerFromEvent(event);
raycaster.setFromCamera(pointer, camera);
if (raycaster.ray.intersectPlane(dragPlane, planeHit)) {
const unclampedX = planeHit.x + dragOffset;
token.position.x = THREE.MathUtils.clamp(
unclampedX,
MIN_VALUE * UNIT,
MAX_VALUE * UNIT
);
tokenTargetX = token.position.x;
tokenValue = THREE.MathUtils.clamp(
Math.round(tokenTargetX / UNIT),
MIN_VALUE,
MAX_VALUE
);
updateReadout();
}
} else if (interaction === "orbit") {
cameraTheta -= deltaX * 0.006;
cameraPhi = THREE.MathUtils.clamp(
cameraPhi - deltaY * 0.005,
0.38,
1.48
);
updateCamera();
} else if (interaction === "pan") {
const right = new THREE.Vector3(1, 0, 0)
.applyQuaternion(camera.quaternion);
right.y = 0;
right.normalize();
const forward = camera.getWorldDirection(new THREE.Vector3());
forward.y = 0;
forward.normalize();
const panScale = cameraRadius * 0.0015;
cameraTarget.addScaledVector(right, -deltaX * panScale);
cameraTarget.addScaledVector(forward, deltaY * panScale);
cameraTarget.x = THREE.MathUtils.clamp(cameraTarget.x, -8, 8);
cameraTarget.z = THREE.MathUtils.clamp(cameraTarget.z, -5, 5);
updateCamera();
}
});
function finishPointerInteraction(event) {
if (interaction === "token") {
setTokenValue(Math.round(token.position.x / UNIT));
}
interaction = null;
if (canvas.hasPointerCapture(event.pointerId)) {
canvas.releasePointerCapture(event.pointerId);
}
}
canvas.addEventListener("pointerup", finishPointerInteraction);
canvas.addEventListener("pointercancel", finishPointerInteraction);
canvas.addEventListener("contextmenu", (event) => event.preventDefault());
canvas.addEventListener("wheel", (event) => {
event.preventDefault();
cameraRadius = THREE.MathUtils.clamp(
cameraRadius * Math.exp(event.deltaY * 0.001),
8,
45
);
updateCamera();
}, { passive: false });
window.addEventListener("keydown", (event) => {
if (event.ctrlKey || event.metaKey || event.altKey) return;
const tag = event.target.tagName;
if (tag === "INPUT" || tag === "TEXTAREA") return;
const step = event.shiftKey ? 5 : 1;
if (event.key === "ArrowRight" || event.key === "ArrowUp" || event.key === "+" || event.key === "=") {
stepToken(step);
event.preventDefault();
} else if (
event.key === "ArrowLeft" ||
event.key === "ArrowDown" ||
event.key === "-" ||
event.key === "_"
) {
stepToken(-step);
event.preventDefault();
} else if (event.key === "Home") {
setTokenValue(0);
event.preventDefault();
}
});
function resize() {
const width = window.innerWidth;
const height = window.innerHeight;
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(width, height, false);
camera.aspect = width / height;
camera.updateProjectionMatrix();
}
window.addEventListener("resize", resize);
const clock = new THREE.Clock();
renderer.setAnimationLoop(() => {
const delta = Math.min(clock.getDelta(), 0.05);
const smoothing = reducedMotion ? 1 : 1 - Math.exp(-13 * delta);
token.position.x = THREE.MathUtils.lerp(
token.position.x,
tokenTargetX,
smoothing
);
tokenGem.rotation.y += delta * 0.55;
tokenGem.rotation.x += delta * 0.18;
tokenCrown.rotation.y -= delta * 0.8;
renderer.render(scene, camera);
});
updateReadout();
</script>
</body>
</html>
```