Prompt specification
Build or customize the Three.js 3D scene "Bare-ground colonization stages" 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: Bare-ground colonization stages
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/bare-ground-colonization-stages-x0729
Scene Description Prompt:
Create a single self-contained HTML file using Three.js from cdnjs that shows ecological succession. Display three small ground tiles representing bare substrate, low plants, and young shrubs; label them as one illustrative succession pathway rather than a universal fixed sequence. Voxel style.
Working Three.js Starter (bare-ground-colonization-stages-x0729):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ecological Succession — Voxel Pathway</title>
<style>
:root {
--ink: #26342c;
--muted: #657067;
--paper: #f7f4e9;
--line: rgba(38, 52, 44, 0.16);
--green: #617c3b;
--shadow: 0 12px 35px rgba(53, 57, 43, 0.12);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #ebe8dc;
color: var(--ink);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button,
canvas {
-webkit-tap-highlight-color: transparent;
}
#app,
#scene {
position: absolute;
inset: 0;
}
#scene canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
cursor: grab;
touch-action: none;
}
#scene canvas:active {
cursor: grabbing;
}
.masthead {
position: absolute;
top: 28px;
left: 32px;
z-index: 3;
max-width: 430px;
pointer-events: none;
}
.eyebrow {
display: flex;
align-items: center;
gap: 9px;
margin-bottom: 10px;
color: #586457;
font-size: 11px;
font-weight: 800;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.eyebrow::before {
width: 9px;
height: 9px;
background: var(--green);
content: "";
box-shadow: 4px 4px 0 #aab77b;
}
h1 {
margin: 0;
font-size: clamp(30px, 4vw, 54px);
font-weight: 750;
letter-spacing: -0.055em;
line-height: 0.98;
}
.masthead p {
margin: 12px 0 0;
color: var(--muted);
font-size: 14px;
line-height: 1.5;
}
.pathway-note {
position: absolute;
top: 28px;
right: 28px;
z-index: 3;
width: min(330px, calc(100vw - 56px));
padding: 16px 17px;
border: 1px solid rgba(255, 255, 255, 0.68);
border-radius: 15px;
background: rgba(250, 248, 239, 0.78);
box-shadow: var(--shadow);
backdrop-filter: blur(12px);
pointer-events: none;
}
.note-kicker {
margin-bottom: 6px;
color: #50603e;
font-size: 10px;
font-weight: 850;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.pathway-note p {
margin: 0;
color: #586359;
font-size: 12px;
line-height: 1.5;
}
.scene-label {
position: absolute;
z-index: 2;
display: flex;
align-items: center;
gap: 9px;
min-width: 154px;
padding: 9px 11px;
border: 1px solid rgba(255, 255, 255, 0.85);
border-radius: 11px;
background: rgba(251, 249, 241, 0.9);
box-shadow: 0 8px 24px rgba(56, 61, 47, 0.11);
backdrop-filter: blur(8px);
transform: translate(-50%, -100%);
pointer-events: none;
transition: opacity 120ms ease;
}
.scene-label::after {
position: absolute;
top: 100%;
left: 50%;
width: 1px;
height: 17px;
background: rgba(55, 68, 51, 0.35);
content: "";
}
.stage-index {
display: grid;
flex: 0 0 auto;
width: 29px;
height: 29px;
place-items: center;
border-radius: 7px;
background: var(--accent);
color: white;
font-size: 10px;
font-weight: 850;
letter-spacing: 0.04em;
}
.label-copy {
display: flex;
flex-direction: column;
gap: 2px;
white-space: nowrap;
}
.label-copy strong {
font-size: 12px;
font-weight: 760;
letter-spacing: -0.01em;
}
.label-copy small {
color: #6e776d;
font-size: 9.5px;
}
#label-bare {
--accent: #a38961;
}
#label-low {
--accent: #779145;
}
#label-shrubs {
--accent: #456d3c;
}
.controls {
position: absolute;
bottom: 22px;
left: 50%;
z-index: 4;
display: flex;
align-items: center;
gap: 13px;
color: #657067;
font-size: 10px;
font-weight: 650;
letter-spacing: 0.05em;
transform: translateX(-50%);
white-space: nowrap;
}
.controls button {
padding: 8px 11px;
border: 1px solid rgba(38, 52, 44, 0.18);
border-radius: 8px;
background: rgba(250, 248, 239, 0.82);
color: var(--ink);
font: inherit;
font-size: 10px;
font-weight: 750;
cursor: pointer;
transition:
background 140ms ease,
transform 140ms ease;
}
.controls button:hover {
background: white;
transform: translateY(-1px);
}
.controls button:focus-visible,
#scene canvas:focus-visible {
outline: 2px solid #708b49;
outline-offset: 3px;
}
@media (max-width: 720px) {
.masthead {
top: 17px;
left: 17px;
right: 17px;
}
.masthead h1 {
font-size: 32px;
}
.masthead p {
display: none;
}
.eyebrow {
margin-bottom: 7px;
font-size: 9px;
}
.pathway-note {
top: auto;
right: 16px;
bottom: 56px;
left: 16px;
width: auto;
padding: 11px 13px;
border-radius: 12px;
}
.pathway-note p {
font-size: 10.5px;
}
.note-kicker {
margin-bottom: 4px;
font-size: 9px;
}
.scene-label {
min-width: 0;
gap: 6px;
padding: 6px 7px;
border-radius: 8px;
}
.stage-index {
width: 23px;
height: 23px;
border-radius: 5px;
font-size: 8px;
}
.label-copy strong {
font-size: 9.5px;
}
.label-copy small {
display: none;
}
.scene-label::after {
height: 12px;
}
.controls {
bottom: 14px;
}
.controls span {
display: none;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
transition: none !important;
}
}
</style>
</head>
<body>
<main id="app">
<div id="scene"></div>
<header class="masthead">
<div class="eyebrow">Ecological succession</div>
<h1>Life takes hold.</h1>
<p>A voxel-scale glimpse of one possible progression across a changing landscape.</p>
</header>
<aside class="pathway-note">
<div class="note-kicker">One illustrative pathway</div>
<p>
Bare substrate may be followed by low plants and then young shrubs.
Succession is context-dependent—not a universal fixed sequence.
</p>
</aside>
<div id="label-bare" class="scene-label" aria-label="Stage 1: Bare substrate">
<span class="stage-index">01</span>
<span class="label-copy">
<strong>Bare substrate</strong>
<small>Rock, sand and open soil</small>
</span>
</div>
<div id="label-low" class="scene-label" aria-label="Stage 2: Low plants">
<span class="stage-index">02</span>
<span class="label-copy">
<strong>Low plants</strong>
<small>Pioneer growth and moss</small>
</span>
</div>
<div id="label-shrubs" class="scene-label" aria-label="Stage 3: Young shrubs">
<span class="stage-index">03</span>
<span class="label-copy">
<strong>Young shrubs</strong>
<small>Woody stems and new canopy</small>
</span>
</div>
<div class="controls">
<button id="reset-view" type="button">Reset view</button>
<span>Drag to orbit · Scroll or pinch to zoom</span>
</div>
</main>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const sceneHost = document.getElementById("scene");
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const scene = new THREE.Scene();
scene.background = new THREE.Color("#ebe8dc");
scene.fog = new THREE.Fog("#ebe8dc", 27, 58);
const camera = new THREE.OrthographicCamera(-12, 12, 8, -8, 0.1, 100);
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
sceneHost.appendChild(renderer.domElement);
renderer.domElement.tabIndex = 0;
renderer.domElement.setAttribute(
"aria-label",
"Interactive voxel scene showing three illustrative stages of ecological succession"
);
const hemisphere = new THREE.HemisphereLight(0xfffbed, 0x938b76, 2.1);
scene.add(hemisphere);
const sun = new THREE.DirectionalLight(0xfff7df, 3.2);
sun.position.set(-8, 15, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -18;
sun.shadow.camera.right = 18;
sun.shadow.camera.top = 15;
sun.shadow.camera.bottom = -15;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 42;
sun.shadow.bias = -0.00035;
sun.shadow.normalBias = 0.025;
scene.add(sun);
const fill = new THREE.DirectionalLight(0xc9ddb8, 0.85);
fill.position.set(10, 7, -9);
scene.add(fill);
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(80, 80),
new THREE.MeshStandardMaterial({
color: "#e8e4d7",
roughness: 1,
metalness: 0
})
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.77;
floor.receiveShadow = true;
scene.add(floor);
const geometryCache = new Map();
const materialCache = new Map();
function geometryFor(width, height, depth) {
const key = `${width}:${height}:${depth}`;
if (!geometryCache.has(key)) {
geometryCache.set(
key,
new THREE.BoxGeometry(width, height, depth)
);
}
return geometryCache.get(key);
}
function materialFor(color) {
if (!materialCache.has(color)) {
materialCache.set(
color,
new THREE.MeshStandardMaterial({
color,
roughness: 0.96,
metalness: 0,
flatShading: true
})
);
}
return materialCache.get(color);
}
function box(parent, size, position, color, options = {}) {
const mesh = new THREE.Mesh(
geometryFor(size[0], size[1], size[2]),
materialFor(color)
);
mesh.position.set(position[0], position[1], position[2]);
if (options.rotation) {
mesh.rotation.set(
options.rotation[0],
options.rotation[1],
options.rotation[2]
);
}
mesh.castShadow = options.castShadow ?? true;
mesh.receiveShadow = options.receiveShadow ?? true;
parent.add(mesh);
return mesh;
}
function seededRandom(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;
};
}
const random = seededRandom(240319);
const plants = [];
const pollen = [];
function makeTileBase(group) {
box(group, [6.25, 0.28, 6.25], [0, -0.60, 0], "#806147");
box(group, [6.00, 0.34, 6.00], [0, -0.29, 0], "#aa815d");
}
function makeTerrain(group, palette, stage) {
const cells = 6;
const spacing = 0.98;
for (let x = 0; x < cells; x++) {
for (let z = 0; z < cells; z++) {
const baseHeight =
stage === "bare"
? 0.11 + random() * 0.12
: stage === "low"
? 0.14 + random() * 0.10
: 0.16 + random() * 0.12;
const color = palette[Math.floor(random() * palette.length)];
const px = (x - (cells - 1) / 2) * spacing;
const pz = (z - (cells - 1) / 2) * spacing;
box(
group,
[0.92, baseHeight, 0.92],
[px, -0.12 + baseHeight / 2, pz],
color
);
}
}
}
function addRock(group, x, z, scale) {
const y = 0.08 + scale * 0.08;
box(
group,
[0.52 * scale, 0.34 * scale, 0.43 * scale],
[x, y, z],
random() > 0.5 ? "#8e9188" : "#a6a49a"
);
box(
group,
[0.30 * scale, 0.16 * scale, 0.26 * scale],
[x + 0.10 * scale, y + 0.19 * scale, z - 0.03],
"#777d77"
);
}
function makeBareTile() {
const group = new THREE.Group();
group.position.x = -8;
makeTileBase(group);
makeTerrain(
group,
["#c7ad82", "#d3bd92", "#b89a70", "#d8c49c", "#bea178"],
"bare"
);
addRock(group, -1.55, -1.25, 1.15);
addRock(group, 1.55, 0.85, 0.9);
addRock(group, 0.65, -1.72, 0.65);
addRock(group, -0.55, 1.35, 0.58);
for (let i = 0; i < 11; i++) {
const x = (random() - 0.5) * 4.7;
const z = (random() - 0.5) * 4.7;
const size = 0.11 + random() * 0.15;
box(
group,
[size, size * 0.55, size * 0.8],
[x, 0.04 + size * 0.2, z],
random() > 0.5 ? "#9d8d72" : "#b09b78"
);
}
return group;
}
function makeTuft(parent, x, z, scale, phase) {
const pivot = new THREE.Group();
pivot.position.set(x, 0.11, z);
pivot.scale.setScalar(scale);
parent.add(pivot);
box(pivot, [0.10, 0.48, 0.10], [0, 0.24, 0], "#617c38");
box(pivot, [0.16, 0.13, 0.16], [-0.10, 0.17, 0.03], "#819c46");
box(pivot, [0.14, 0.18, 0.14], [0.10, 0.27, -0.02], "#6e8b3b");
box(pivot, [0.13, 0.13, 0.13], [0.01, 0.38, 0.04], "#93aa50");
if (random() > 0.72) {
box(pivot, [0.10, 0.10, 0.10], [0.01, 0.47, 0.04], "#e0bd57");
}
plants.push({
object: pivot,
phase,
amount: 0.035,
baseX: 0,
baseZ: 0
});
}
function makeLowTile() {
const group = new THREE.Group();
group.position.x = 0;
makeTileBase(group);
makeTerrain(
group,
["#687447", "#737c49", "#59633c", "#828951", "#606b40"],
"low"
);
const tufts = [
[-1.75, -1.45, 0.92],
[-0.75, -1.72, 0.72],
[0.35, -1.20, 1.05],
[1.65, -1.38, 0.82],
[-1.90, 0.10, 0.78],
[-0.80, 0.38, 1.12],
[0.20, 0.58, 0.74],
[1.42, 0.35, 1.02],
[1.85, 1.45, 0.70],
[0.62, 1.75, 0.92],
[-0.85, 1.68, 0.80],
[-1.72, 1.20, 0.63],
[0.15, -0.25, 0.58]
];
tufts.forEach(([x, z, scale], index) => {
makeTuft(group, x, z, scale, index * 0.73);
});
for (let i = 0; i < 15; i++) {
const x = (random() - 0.5) * 4.7;
const z = (random() - 0.5) * 4.7;
const size = 0.22 + random() * 0.22;
box(
group,
[size, 0.09, size * 0.8],
[x, 0.08, z],
random() > 0.5 ? "#71843f" : "#84954b"
);
}
return group;
}
function makeShrub(parent, x, z, scale, phase) {
const pivot = new THREE.Group();
pivot.position.set(x, 0.12, z);
pivot.scale.setScalar(scale);
parent.add(pivot);
box(pivot, [0.18, 1.10, 0.18], [0, 0.55, 0], "#735239");
box(
pivot,
[0.48, 0.12, 0.12],
[-0.19, 0.73, 0],
"#735239",
{ rotation: [0, 0, -0.48] }
);
box(
pivot,
[0.44, 0.12, 0.12],
[0.18, 0.84, 0.02],
"#806044",
{ rotation: [0, 0, 0.52] }
);
const leaves = [
[0.00, 1.16, 0.00, 0.62, "#4f753d"],
[-0.30, 1.08, 0.04, 0.45, "#5f8140"],
[0.31, 1.12, -0.03, 0.46, "#668946"],
[0.02, 1.47, 0.01, 0.47, "#78984c"],
[-0.12, 1.36, -0.31, 0.40, "#587c3d"],
[0.23, 1.34, 0.29, 0.39, "#719044"],
[-0.37, 1.31, 0.22, 0.30, "#76934b"]
];
leaves.forEach(([lx, ly, lz, size, color]) => {
box(pivot, [size, size, size], [lx, ly, lz], color);
});
plants.push({
object: pivot,
phase,
amount: 0.022,
baseX: 0,
baseZ: 0
});
}
function makeShrubTile() {
const group = new THREE.Group();
group.position.x = 8;
makeTileBase(group);
makeTerrain(
group,
["#59663e", "#707a49", "#4d5935", "#7c8451", "#616c42"],
"shrubs"
);
makeShrub(group, -1.35, -1.28, 1.00, 0.4);
makeShrub(group, 0.05, 1.28, 1.10, 1.8);
makeShrub(group, 1.48, -0.50, 0.88, 3.1);
makeShrub(group, 1.12, 1.62, 0.67, 4.4);
for (let i = 0; i < 12; i++) {
const x = (random() - 0.5) * 4.7;
const z = (random() - 0.5) * 4.7;
const size = 0.19 + random() * 0.2;
box(
group,
[size, 0.08, size * 0.85],
[x, 0.08, z],
random() > 0.5 ? "#60783c" : "#78904a"
);
}
return group;
}
scene.add(makeBareTile());
scene.add(makeLowTile());
scene.add(makeShrubTile());
// A subtle voxel pathway runs in front of the three tiles.
for (let x = -10.8; x <= 10.8; x += 0.76) {
box(
scene,
[0.34, 0.035, 0.09],
[x, -0.735, 3.72],
"#c6b58f",
{ castShadow: false }
);
}
function addArrowHead(x) {
const z = 3.72;
box(scene, [0.18, 0.055, 0.18], [x + 0.19, -0.71, z], "#a79469", {
castShadow: false
});
box(scene, [0.18, 0.055, 0.18], [x - 0.04, -0.71, z + 0.19], "#a79469", {
castShadow: false
});
box(scene, [0.18, 0.055, 0.18], [x - 0.04, -0.71, z - 0.19], "#a79469", {
castShadow: false
});
}
addArrowHead(-4);
addArrowHead(4);
// Sparse floating pollen cubes add life around the newest vegetation.
for (let i = 0; i < 14; i++) {
const mesh = box(
scene,
[0.075, 0.075, 0.075],
[6.1 + random() * 3.7, 0.5 + random() * 2.1, -1.5 + random() * 3.5],
i % 3 === 0 ? "#d8bd66" : "#a9b96a",
{ castShadow: false, receiveShadow: false }
);
pollen.push({
mesh,
baseX: mesh.position.x,
baseY: mesh.position.y,
baseZ: mesh.position.z,
phase: random() * Math.PI * 2
});
}
const labels = [
{
element: document.getElementById("label-bare"),
anchor: new THREE.Vector3(-8, 0.62, 0)
},
{
element: document.getElementById("label-low"),
anchor: new THREE.Vector3(0, 0.98, 0)
},
{
element: document.getElementById("label-shrubs"),
anchor: new THREE.Vector3(8, 2.25, 0)
}
];
const target = new THREE.Vector3(0, 0.25, 0);
const radius = 24;
const defaultCamera = {
yaw: 0,
pitch: 0.58,
zoom: 1
};
const cameraState = { ...defaultCamera };
let dragging = false;
let previousX = 0;
let previousY = 0;
function updateCamera() {
const horizontalRadius = Math.cos(cameraState.pitch) * radius;
camera.position.set(
target.x + Math.sin(cameraState.yaw) * horizontalRadius,
target.y + Math.sin(cameraState.pitch) * radius,
target.z + Math.cos(cameraState.yaw) * horizontalRadius
);
camera.lookAt(target);
camera.zoom = cameraState.zoom;
camera.updateProjectionMatrix();
}
function resetCamera() {
cameraState.yaw = defaultCamera.yaw;
cameraState.pitch = defaultCamera.pitch;
cameraState.zoom = defaultCamera.zoom;
updateCamera();
}
function resize() {
const width = window.innerWidth;
const height = window.innerHeight;
const aspect = width / height;
const halfWidth = 11.35;
const halfHeight = halfWidth / aspect;
camera.left = -halfWidth;
camera.right = halfWidth;
camera.top = halfHeight;
camera.bottom = -halfHeight;
camera.updateProjectionMatrix();
renderer.setSize(width, height);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
}
function updateLabels() {
const width = window.innerWidth;
const height = window.innerHeight;
labels.forEach(({ element, anchor }) => {
const projected = anchor.clone().project(camera);
const x = (projected.x * 0.5 + 0.5) * width;
const y = (-projected.y * 0.5 + 0.5) * height;
element.style.left = `${x}px`;
element.style.top = `${y}px`;
element.style.opacity = projected.z < 1 ? "1" : "0";
});
}
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
previousX = event.clientX;
previousY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!dragging) return;
const deltaX = event.clientX - previousX;
const deltaY = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
cameraState.yaw -= deltaX * 0.006;
cameraState.pitch = THREE.MathUtils.clamp(
cameraState.pitch + deltaY * 0.004,
0.32,
1.12
);
updateCamera();
});
function endDrag(event) {
dragging = false;
if (event.pointerId !== undefined) {
try {
renderer.domElement.releasePointerCapture(event.pointerId);
} catch {
// Pointer capture may already have been released.
}
}
}
renderer.domElement.addEventListener("pointerup", endDrag);
renderer.domElement.addEventListener("pointercancel", endDrag);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
cameraState.zoom = THREE.MathUtils.clamp(
cameraState.zoom * Math.exp(-event.deltaY * 0.001),
0.72,
1.65
);
updateCamera();
},
{ passive: false }
);
renderer.domElement.addEventListener("keydown", (event) => {
let handled = true;
switch (event.key) {
case "ArrowLeft":
cameraState.yaw += 0.08;
break;
case "ArrowRight":
cameraState.yaw -= 0.08;
break;
case "ArrowUp":
cameraState.pitch = THREE.MathUtils.clamp(cameraState.pitch + 0.06, 0.32, 1.12);
break;
case "ArrowDown":
cameraState.pitch = THREE.MathUtils.clamp(cameraState.pitch - 0.06, 0.32, 1.12);
break;
case "+":
case "=":
cameraState.zoom = THREE.MathUtils.clamp(cameraState.zoom + 0.08, 0.72, 1.65);
break;
case "-":
case "_":
cameraState.zoom = THREE.MathUtils.clamp(cameraState.zoom - 0.08, 0.72, 1.65);
break;
case "r":
case "R":
resetCamera();
break;
default:
handled = false;
}
if (handled) {
event.preventDefault();
updateCamera();
}
});
document.getElementById("reset-view").addEventListener("click", resetCamera);
window.addEventListener("resize", resize);
resize();
updateCamera();
const clock = new THREE.Clock();
function animate() {
const time = clock.getElapsedTime();
if (!reducedMotion) {
plants.forEach(({ object, phase, amount }) => {
object.rotation.z = Math.sin(time * 0.85 + phase) * amount;
object.rotation.x = Math.cos(time * 0.66 + phase) * amount * 0.55;
});
pollen.forEach(({ mesh, baseX, baseY, baseZ, phase }) => {
mesh.position.x = baseX + Math.sin(time * 0.42 + phase) * 0.18;
mesh.position.y = baseY + Math.sin(time * 0.75 + phase) * 0.12;
mesh.position.z = baseZ + Math.cos(time * 0.37 + phase) * 0.13;
mesh.rotation.y = time * 0.35 + phase;
mesh.rotation.x = time * 0.22;
});
}
renderer.render(scene, camera);
updateLabels();
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html>
```