Prompt specification
Build or customize the Three.js 3D scene "Dishwashing interface museum scene" 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: Dishwashing interface museum scene
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/dishwashing-interface-museum-scene-x1979
Scene Description Prompt:
A voxel greasy plate beside a magnified schematic oil droplet surrounded by surfactant molecules. One HTML file using Three.js from cdnjs.
Working Three.js Starter (dishwashing-interface-museum-scene-x1979):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Grease, Up Close — Three.js Voxel Study</title>
<style>
:root {
color-scheme: light;
--ink: #28322f;
--muted: #6f7974;
--paper: #f1eee5;
--gold: #e7ad35;
--teal: #356d68;
--line: rgba(40, 50, 47, 0.16);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: var(--paper);
font-family: Inter, ui-sans-serif, system-ui, -apple-system,
BlinkMacSystemFont, "Segoe UI", sans-serif;
color: var(--ink);
}
#app,
canvas {
width: 100%;
height: 100%;
display: block;
}
canvas {
cursor: grab;
touch-action: none;
}
canvas:active {
cursor: grabbing;
}
.hud {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 2;
}
.heading {
position: absolute;
top: clamp(24px, 4vw, 54px);
left: clamp(24px, 5vw, 72px);
max-width: 390px;
}
.eyebrow {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 13px;
color: var(--muted);
font-size: 10px;
font-weight: 750;
letter-spacing: 0.2em;
text-transform: uppercase;
}
.eyebrow::before {
content: "";
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--gold);
box-shadow: 0 0 0 5px rgba(231, 173, 53, 0.13);
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(38px, 5vw, 72px);
font-weight: 400;
line-height: 0.98;
letter-spacing: -0.045em;
}
.heading p {
max-width: 330px;
margin: 17px 0 0;
color: var(--muted);
font-size: 13px;
line-height: 1.6;
}
.legend {
position: absolute;
top: clamp(24px, 4vw, 52px);
right: clamp(22px, 4vw, 58px);
width: 214px;
padding: 17px 18px 16px;
border: 1px solid var(--line);
border-radius: 13px;
background: rgba(248, 246, 239, 0.68);
box-shadow: 0 18px 50px rgba(61, 62, 52, 0.08);
backdrop-filter: blur(12px);
}
.legend-title {
margin-bottom: 13px;
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.18em;
text-transform: uppercase;
}
.legend-row {
display: flex;
align-items: center;
gap: 10px;
margin: 10px 0;
font-size: 11px;
color: #505c57;
}
.swatch {
flex: 0 0 auto;
width: 18px;
height: 18px;
border-radius: 50%;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.swatch.head {
background: radial-gradient(circle at 32% 28%, #ffe89a, #e3aa28 68%);
}
.swatch.tail {
width: 22px;
height: 5px;
border-radius: 4px;
background: var(--teal);
}
.swatch.oil {
background: radial-gradient(circle at 35% 28%, #f7cf78, #d79225 72%);
}
.scale {
display: inline-flex;
align-items: center;
gap: 7px;
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid var(--line);
color: #7a817d;
font-size: 9px;
font-weight: 750;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.scale::before {
content: "";
width: 24px;
height: 1px;
background: #9da39f;
}
.controls {
position: absolute;
bottom: 25px;
left: 50%;
transform: translateX(-50%);
padding: 9px 14px;
border: 1px solid var(--line);
border-radius: 999px;
background: rgba(248, 246, 239, 0.64);
color: #7b837f;
font-size: 10px;
letter-spacing: 0.03em;
white-space: nowrap;
backdrop-filter: blur(10px);
}
@media (max-width: 700px) {
.heading p,
.legend {
display: none;
}
.heading {
top: 24px;
left: 24px;
}
h1 {
font-size: 42px;
}
.controls {
bottom: 16px;
}
}
</style>
</head>
<body>
<div id="app"></div>
<div class="hud">
<section class="heading">
<div class="eyebrow">Surface science / microscopic study</div>
<h1>Grease,<br />up close.</h1>
<p>
A voxel ceramic plate and a magnified molecular view of an oil
droplet stabilized by surfactant molecules.
</p>
</section>
<aside class="legend">
<div class="legend-title">Molecular legend</div>
<div class="legend-row">
<span class="swatch head"></span>
<span>Hydrophilic head</span>
</div>
<div class="legend-row">
<span class="swatch tail"></span>
<span>Lipophilic tail</span>
</div>
<div class="legend-row">
<span class="swatch oil"></span>
<span>Oil droplet</span>
</div>
<div class="scale">40× schematic</div>
</aside>
<div class="controls">Drag to orbit · Scroll to zoom · Double-click to reset</div>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const app = document.querySelector("#app");
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: false,
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.08;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
app.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xf1eee5);
scene.fog = new THREE.Fog(0xf1eee5, 18, 32);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
60
);
const cameraTarget = new THREE.Vector3(-0.05, -0.2, 0);
const spherical = new THREE.Spherical(15.2, 1.27, 0.03);
const defaultSpherical = spherical.clone();
function updateCamera() {
camera.position.setFromSpherical(spherical).add(cameraTarget);
camera.lookAt(cameraTarget);
}
updateCamera();
scene.add(new THREE.HemisphereLight(0xfff7df, 0x899891, 2.25));
const keyLight = new THREE.DirectionalLight(0xffefcf, 3.4);
keyLight.position.set(-5, 9, 8);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -10;
keyLight.shadow.camera.right = 10;
keyLight.shadow.camera.top = 10;
keyLight.shadow.camera.bottom = -10;
keyLight.shadow.camera.near = 0.5;
keyLight.shadow.camera.far = 30;
keyLight.shadow.bias = -0.0007;
scene.add(keyLight);
const rimLight = new THREE.DirectionalLight(0xc7e0d9, 1.8);
rimLight.position.set(7, 4, -6);
scene.add(rimLight);
const warmLight = new THREE.PointLight(0xffc96a, 7, 18, 2);
warmLight.position.set(4, 2.5, 5);
scene.add(warmLight);
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(40, 40),
new THREE.MeshStandardMaterial({
color: 0xe6e1d5,
roughness: 0.96,
metalness: 0
})
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -2.45;
floor.receiveShadow = true;
scene.add(floor);
let randomSeed = 28191;
function random() {
randomSeed = (randomSeed * 1664525 + 1013904223) >>> 0;
return randomSeed / 4294967296;
}
function makeContactShadow(width, depth, opacity, x, z) {
const canvas = document.createElement("canvas");
canvas.width = canvas.height = 256;
const context = canvas.getContext("2d");
const gradient = context.createRadialGradient(128, 128, 8, 128, 128, 126);
gradient.addColorStop(0, `rgba(35, 43, 39, ${opacity})`);
gradient.addColorStop(0.52, `rgba(35, 43, 39, ${opacity * 0.46})`);
gradient.addColorStop(1, "rgba(35, 43, 39, 0)");
context.fillStyle = gradient;
context.fillRect(0, 0, 256, 256);
const texture = new THREE.CanvasTexture(canvas);
const shadow = new THREE.Mesh(
new THREE.PlaneGeometry(width, depth),
new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
depthWrite: false
})
);
shadow.rotation.x = -Math.PI / 2;
shadow.position.set(x, -2.438, z);
scene.add(shadow);
}
makeContactShadow(7.5, 6.7, 0.24, -3.35, 0);
makeContactShadow(5.1, 3.2, 0.18, 2.55, 0.15);
// ------------------------------------------------------------------
// Voxel ceramic plate
// ------------------------------------------------------------------
const plate = new THREE.Group();
plate.position.set(-3.35, -2.45, 0);
scene.add(plate);
const voxelGeometry = new THREE.BoxGeometry(1, 1, 1);
const voxelMaterial = new THREE.MeshStandardMaterial({
color: 0xffffff,
roughness: 0.72,
metalness: 0.01
});
const cells = [];
const gridRadius = 10;
const spacing = 0.3;
const cellSize = 0.285;
for (let gx = -gridRadius; gx <= gridRadius; gx++) {
for (let gz = -gridRadius; gz <= gridRadius; gz++) {
const normalized = Math.hypot(gx / 10.4, gz / 9.7);
if (normalized <= 1) {
cells.push({
x: gx,
z: gz,
rim: normalized > 0.77,
variation: random()
});
}
}
}
const voxels = new THREE.InstancedMesh(
voxelGeometry,
voxelMaterial,
cells.length
);
voxels.castShadow = true;
voxels.receiveShadow = true;
voxels.instanceMatrix.setUsage(THREE.StaticDrawUsage);
const matrix = new THREE.Matrix4();
const position = new THREE.Vector3();
const quaternion = new THREE.Quaternion();
const scale = new THREE.Vector3();
const color = new THREE.Color();
cells.forEach((cell, index) => {
const height = cell.rim ? 0.3 : 0.16;
position.set(cell.x * spacing, height * 0.5, cell.z * spacing);
scale.set(cellSize, height, cellSize);
matrix.compose(position, quaternion, scale);
voxels.setMatrixAt(index, matrix);
if (cell.rim) {
color.setHSL(0.11, 0.2, 0.91 + cell.variation * 0.035);
} else {
color.setHSL(0.12, 0.09, 0.86 + cell.variation * 0.045);
}
voxels.setColorAt(index, color);
});
voxels.instanceMatrix.needsUpdate = true;
voxels.instanceColor.needsUpdate = true;
plate.add(voxels);
const greaseMaterial = new THREE.MeshPhysicalMaterial({
color: 0x667044,
roughness: 0.16,
metalness: 0.05,
clearcoat: 1,
clearcoatRoughness: 0.12,
transparent: true,
opacity: 0.62,
depthWrite: false
});
const greaseGoldMaterial = new THREE.MeshPhysicalMaterial({
color: 0xa17a2c,
roughness: 0.22,
metalness: 0.02,
clearcoat: 0.9,
clearcoatRoughness: 0.15,
transparent: true,
opacity: 0.48,
depthWrite: false
});
const greasePatches = [
{ x: -5, z: 1, w: 3, d: 2, type: 0 },
{ x: -2, z: -2, w: 2, d: 2, type: 1 },
{ x: 2, z: 3, w: 3, d: 2, type: 0 },
{ x: 5, z: -2, w: 2, d: 2, type: 1 },
{ x: -1, z: 5, w: 2, d: 1, type: 1 },
{ x: 6, z: 2, w: 1, d: 1, type: 0 },
{ x: -6, z: -3, w: 2, d: 1, type: 1 }
];
greasePatches.forEach((patch) => {
const geometry = new THREE.BoxGeometry(
patch.w * spacing * 0.9,
0.026,
patch.d * spacing * 0.9
);
const mesh = new THREE.Mesh(
geometry,
patch.type === 0 ? greaseMaterial : greaseGoldMaterial
);
mesh.position.set(
patch.x * spacing,
0.176,
patch.z * spacing
);
mesh.receiveShadow = true;
plate.add(mesh);
});
// Small greasy crumbs and droplets on the table.
const tableGreaseMaterial = new THREE.MeshPhysicalMaterial({
color: 0x707143,
roughness: 0.18,
clearcoat: 1,
transparent: true,
opacity: 0.68
});
[
[-0.05, 1.2, 0.16, 0.1],
[0.18, 1.45, 0.09, 0.07],
[-0.28, 1.02, 0.075, 0.055]
].forEach(([x, z, sx, sz]) => {
const spot = new THREE.Mesh(
new THREE.SphereGeometry(1, 20, 12),
tableGreaseMaterial
);
spot.scale.set(sx, 0.018, sz);
spot.position.set(x, -2.425, z);
scene.add(spot);
});
// Marker ring around the selected grease patch.
const marker = new THREE.Mesh(
new THREE.TorusGeometry(0.46, 0.025, 8, 64),
new THREE.MeshBasicMaterial({
color: 0xc18a2e,
transparent: true,
opacity: 0.72
})
);
marker.rotation.x = Math.PI / 2;
marker.position.set(-2 * spacing, 0.205, -2 * spacing);
plate.add(marker);
// ------------------------------------------------------------------
// Magnifying glass and molecular oil-droplet schematic
// ------------------------------------------------------------------
const magnifier = new THREE.Group();
magnifier.position.set(2.55, 0.22, 0.15);
magnifier.rotation.y = -0.08;
scene.add(magnifier);
const glassMaterial = new THREE.MeshPhysicalMaterial({
color: 0xdbe9e4,
roughness: 0.06,
metalness: 0,
transparent: true,
opacity: 0.1,
transmission: 0.25,
thickness: 0.15,
depthWrite: false,
side: THREE.DoubleSide
});
const lens = new THREE.Mesh(
new THREE.CircleGeometry(2.01, 96),
glassMaterial
);
lens.position.z = -0.08;
magnifier.add(lens);
const brassMaterial = new THREE.MeshStandardMaterial({
color: 0xc59a57,
roughness: 0.26,
metalness: 0.52
});
const outerRing = new THREE.Mesh(
new THREE.TorusGeometry(2.08, 0.09, 14, 120),
brassMaterial
);
outerRing.position.z = 0.03;
outerRing.castShadow = true;
magnifier.add(outerRing);
const innerRing = new THREE.Mesh(
new THREE.TorusGeometry(1.99, 0.022, 8, 120),
new THREE.MeshStandardMaterial({
color: 0xf0d49b,
roughness: 0.18,
metalness: 0.72
})
);
innerRing.position.z = 0.08;
magnifier.add(innerRing);
const oilMaterial = new THREE.MeshPhysicalMaterial({
color: 0xe5a52f,
roughness: 0.18,
metalness: 0.02,
clearcoat: 0.85,
clearcoatRoughness: 0.12,
transmission: 0.12,
thickness: 0.9,
ior: 1.46,
transparent: true,
opacity: 0.82,
depthWrite: false,
side: THREE.DoubleSide
});
const oilMesh = new THREE.Mesh(
new THREE.SphereGeometry(1, 72, 48),
oilMaterial
);
oilMesh.scale.set(1.35, 1.35, 0.66);
oilMesh.position.z = 0.04;
oilMesh.castShadow = true;
magnifier.add(oilMesh);
const innerOil = new THREE.Mesh(
new THREE.SphereGeometry(1, 48, 32),
new THREE.MeshPhysicalMaterial({
color: 0xc9821e,
roughness: 0.28,
transparent: true,
opacity: 0.18,
depthWrite: false
})
);
innerOil.scale.set(1.04, 1.04, 0.47);
innerOil.position.z = -0.02;
magnifier.add(innerOil);
// Soft highlights on the front of the oil droplet.
const highlightMaterial = new THREE.MeshBasicMaterial({
color: 0xfff6d4,
transparent: true,
opacity: 0.72,
depthWrite: false
});
const highlight = new THREE.Mesh(
new THREE.SphereGeometry(0.23, 24, 16),
highlightMaterial
);
highlight.scale.set(1.35, 0.65, 0.13);
highlight.position.set(-0.48, 0.49, 0.64);
highlight.rotation.z = -0.35;
magnifier.add(highlight);
const smallHighlight = new THREE.Mesh(
new THREE.SphereGeometry(0.08, 20, 12),
new THREE.MeshBasicMaterial({
color: 0xffffff,
transparent: true,
opacity: 0.55,
depthWrite: false
})
);
smallHighlight.scale.set(1, 1.2, 0.15);
smallHighlight.position.set(0.58, 0.77, 0.56);
magnifier.add(smallHighlight);
// A few suspended oil inclusions.
for (let i = 0; i < 7; i++) {
const bubble = new THREE.Mesh(
new THREE.SphereGeometry(0.05 + random() * 0.08, 16, 12),
new THREE.MeshPhysicalMaterial({
color: 0xffd979,
roughness: 0.2,
transparent: true,
opacity: 0.44,
depthWrite: false
})
);
bubble.position.set(
(random() - 0.5) * 1.6,
(random() - 0.5) * 1.6,
-0.18 + random() * 0.24
);
magnifier.add(bubble);
}
const headMaterial = new THREE.MeshPhysicalMaterial({
color: 0xf4c541,
roughness: 0.3,
metalness: 0,
clearcoat: 0.55,
clearcoatRoughness: 0.18
});
const tailMaterial = new THREE.MeshStandardMaterial({
color: 0x2f6964,
roughness: 0.48,
metalness: 0.04
});
const yAxis = new THREE.Vector3(0, 1, 0);
function cylinderBetween(start, end, radius, material, parent) {
const direction = new THREE.Vector3().subVectors(end, start);
const length = direction.length();
const cylinder = new THREE.Mesh(
new THREE.CylinderGeometry(radius, radius, length, 8),
material
);
cylinder.position.copy(start).add(end).multiplyScalar(0.5);
cylinder.quaternion.setFromUnitVectors(
yAxis,
direction.clone().normalize()
);
parent.add(cylinder);
return cylinder;
}
const surfactantHeads = [];
for (let i = 0; i < 18; i++) {
const angle = (i / 18) * Math.PI * 2 + 0.06;
const jitter = (random() - 0.5) * 0.07;
const z = 0.25 + (random() - 0.5) * 0.15;
const headPosition = new THREE.Vector3(
Math.cos(angle) * (1.77 + jitter),
Math.sin(angle) * (1.77 + jitter),
z
);
const middlePosition = new THREE.Vector3(
Math.cos(angle + 0.025) * 1.48,
Math.sin(angle + 0.025) * 1.48,
z - 0.02
);
const innerPosition = new THREE.Vector3(
Math.cos(angle + 0.065) * 1.17,
Math.sin(angle + 0.065) * 1.17,
z - 0.05
);
const head = new THREE.Mesh(
new THREE.SphereGeometry(0.115, 20, 14),
headMaterial
);
head.position.copy(headPosition);
head.castShadow = true;
magnifier.add(head);
surfactantHeads.push(head);
cylinderBetween(
headPosition,
middlePosition,
0.025,
tailMaterial,
magnifier
);
cylinderBetween(
middlePosition,
innerPosition,
0.022,
tailMaterial,
magnifier
);
}
// Magnifier handle.
const handleStart = new THREE.Vector3(1.48, -1.48, 0.03);
const collarEnd = new THREE.Vector3(1.72, -1.73, 0.03);
const handleEnd = new THREE.Vector3(2.48, -2.59, 0.03);
cylinderBetween(
handleStart,
collarEnd,
0.17,
brassMaterial,
magnifier
);
const woodMaterial = new THREE.MeshStandardMaterial({
color: 0x73513b,
roughness: 0.58,
metalness: 0
});
cylinderBetween(
collarEnd,
handleEnd,
0.145,
woodMaterial,
magnifier
);
const handleCap = new THREE.Mesh(
new THREE.SphereGeometry(0.145, 20, 14),
woodMaterial
);
handleCap.position.copy(handleEnd);
magnifier.add(handleCap);
// Dashed leader connecting the greasy patch to the magnified view.
const leaderCurve = new THREE.CatmullRomCurve3([
new THREE.Vector3(-3.95, -2.22, -0.55),
new THREE.Vector3(-2.9, -1.55, 0.05),
new THREE.Vector3(-1.45, -0.62, 0.42),
new THREE.Vector3(0.34, 0.02, 0.3)
]);
const leaderGeometry = new THREE.BufferGeometry().setFromPoints(
leaderCurve.getPoints(80)
);
const leader = new THREE.Line(
leaderGeometry,
new THREE.LineDashedMaterial({
color: 0x9a7d45,
dashSize: 0.16,
gapSize: 0.11,
transparent: true,
opacity: 0.55,
depthWrite: false
})
);
leader.computeLineDistances();
scene.add(leader);
// Small arrow at the magnified end of the guide.
const arrow = new THREE.Mesh(
new THREE.ConeGeometry(0.075, 0.23, 12),
new THREE.MeshBasicMaterial({
color: 0x9a7d45,
transparent: true,
opacity: 0.68
})
);
arrow.position.copy(leaderCurve.getPoint(0.995));
arrow.quaternion.setFromUnitVectors(
yAxis,
leaderCurve.getTangent(0.995).normalize()
);
scene.add(arrow);
// ------------------------------------------------------------------
// Direct camera controls: orbit, zoom, and reset
// ------------------------------------------------------------------
let dragging = false;
let pointerX = 0;
let pointerY = 0;
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
pointerX = event.clientX;
pointerY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!dragging) return;
const deltaX = event.clientX - pointerX;
const deltaY = event.clientY - pointerY;
pointerX = event.clientX;
pointerY = event.clientY;
spherical.theta -= deltaX * 0.005;
spherical.phi -= deltaY * 0.005;
spherical.phi = THREE.MathUtils.clamp(spherical.phi, 0.58, 1.47);
updateCamera();
});
function endDrag(event) {
dragging = false;
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(
"wheel",
(event) => {
event.preventDefault();
spherical.radius *= Math.exp(event.deltaY * 0.001);
spherical.radius = THREE.MathUtils.clamp(spherical.radius, 10.5, 21);
updateCamera();
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", () => {
spherical.copy(defaultSpherical);
updateCamera();
});
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.fov = camera.aspect < 0.8 ? 53 : 42;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
});
// ------------------------------------------------------------------
// Animation
// ------------------------------------------------------------------
const clock = new THREE.Clock();
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
function animate() {
const elapsed = clock.getElapsedTime();
if (!reducedMotion) {
oilMesh.scale.z = 0.66 + Math.sin(elapsed * 1.15) * 0.012;
surfactantHeads.forEach((head, index) => {
const pulse = 1 + Math.sin(elapsed * 1.8 + index * 0.58) * 0.035;
head.scale.setScalar(pulse);
});
greaseMaterial.opacity =
0.59 + Math.sin(elapsed * 0.75) * 0.035;
}
renderer.render(scene, camera);
}
renderer.setAnimationLoop(animate);
</script>
</body>
</html>
```