Prompt specification
Build or customize the Three.js 3D scene "Shared household task adaptation" 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: Shared household task adaptation
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/shared-household-task-adaptation-x3892
Scene Description Prompt:
Show a voxel household redistributing fictional chores after a new arrival, with helpers visibly performing their assignments. One HTML file using Three.js from cdnjs.
Working Three.js Starter (shared-household-task-adaptation-x3892):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Chore Shift — Voxel Household</title>
<style>
:root {
--ink: #243746;
--paper: #fffaf0;
--coral: #f27964;
--teal: #58b6a9;
--yellow: #f4c95d;
--purple: #8e7cc3;
--blue: #5b8def;
--muted: #6d7c82;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #cbdedd;
color: var(--ink);
font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif;
}
#stage {
position: fixed;
inset: 0;
}
#stage canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
#stage canvas:active {
cursor: grabbing;
}
.topbar {
position: fixed;
z-index: 5;
top: 24px;
left: 26px;
right: 26px;
display: flex;
align-items: flex-start;
justify-content: space-between;
pointer-events: none;
}
.brand {
display: flex;
align-items: center;
gap: 13px;
padding: 12px 15px 12px 12px;
border: 1px solid rgba(255, 255, 255, 0.66);
border-radius: 18px;
background: rgba(255, 250, 240, 0.82);
box-shadow: 0 12px 34px rgba(37, 59, 64, 0.12);
backdrop-filter: blur(12px);
}
.mark {
width: 44px;
height: 44px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 4px;
transform: rotate(-4deg);
}
.mark i {
display: block;
border-radius: 4px;
background: var(--coral);
box-shadow: inset 0 -3px rgba(0, 0, 0, 0.08);
}
.mark i:nth-child(2) {
background: var(--teal);
}
.mark i:nth-child(3) {
background: var(--yellow);
}
.mark i:nth-child(4) {
background: var(--purple);
}
.eyebrow {
display: block;
margin-bottom: 2px;
color: #78858a;
font-size: 9px;
font-weight: 900;
letter-spacing: 0.16em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: 23px;
line-height: 1;
letter-spacing: -0.045em;
}
.arrival {
display: flex;
align-items: center;
gap: 9px;
padding: 13px 16px;
border: 1px solid rgba(255, 255, 255, 0.7);
border-radius: 999px;
background: rgba(36, 55, 70, 0.88);
box-shadow: 0 12px 34px rgba(37, 59, 64, 0.15);
color: #fffaf0;
font-size: 10px;
font-weight: 900;
letter-spacing: 0.08em;
}
.arrival b {
padding-left: 9px;
border-left: 1px solid rgba(255, 255, 255, 0.23);
color: #f4c95d;
}
.live-dot {
width: 9px;
height: 9px;
border-radius: 50%;
background: #82d49b;
box-shadow: 0 0 0 4px rgba(130, 212, 155, 0.13);
}
.manifest {
position: fixed;
z-index: 5;
top: 104px;
right: 26px;
width: 310px;
padding: 21px;
border: 1px solid rgba(255, 255, 255, 0.72);
border-radius: 22px;
background: rgba(255, 250, 240, 0.89);
box-shadow: 0 20px 60px rgba(37, 59, 64, 0.16);
backdrop-filter: blur(15px);
pointer-events: none;
}
.manifest h2 {
margin: 5px 0 8px;
font-size: 22px;
line-height: 1.04;
letter-spacing: -0.04em;
}
.intro {
margin: 0 0 16px;
color: #66767c;
font-size: 12px;
line-height: 1.45;
}
.reroute {
display: grid;
grid-template-columns: 1fr 24px 1fr;
align-items: center;
gap: 7px;
margin-bottom: 17px;
}
.route-card {
min-height: 60px;
padding: 10px;
border: 1px solid #e3ddd2;
border-radius: 12px;
background: rgba(255, 255, 255, 0.5);
}
.route-card span {
display: block;
color: #8b9699;
font-size: 8px;
font-weight: 900;
letter-spacing: 0.12em;
}
.route-card b {
display: block;
margin-top: 5px;
font-size: 11px;
line-height: 1.2;
}
.route-arrow {
color: var(--coral);
font-size: 19px;
text-align: center;
}
.assignments {
padding: 0;
margin: 0;
list-style: none;
}
.assignments li {
display: grid;
grid-template-columns: 31px 1fr auto;
align-items: center;
gap: 10px;
padding: 9px 0;
border-top: 1px solid rgba(36, 55, 70, 0.08);
opacity: 0;
transform: translateX(16px);
animation: deal 0.55s ease forwards;
}
.assignments li:nth-child(1) { animation-delay: 0.35s; }
.assignments li:nth-child(2) { animation-delay: 0.55s; }
.assignments li:nth-child(3) { animation-delay: 0.75s; }
.assignments li:nth-child(4) { animation-delay: 0.95s; }
@keyframes deal {
to {
opacity: 1;
transform: translateX(0);
}
}
.avatar {
width: 31px;
height: 31px;
display: grid;
place-items: center;
border-radius: 9px;
color: #fff;
font-size: 10px;
font-weight: 900;
box-shadow: inset 0 -3px rgba(0, 0, 0, 0.1);
}
.assignment-name {
display: block;
font-size: 12px;
font-weight: 900;
}
.assignment-task {
display: block;
margin-top: 1px;
color: #7c898e;
font-size: 10px;
}
.active {
color: #4b9d72;
font-size: 8px;
font-weight: 900;
letter-spacing: 0.08em;
}
.manifest-footer {
display: flex;
align-items: center;
gap: 8px;
margin: 13px -4px -4px;
padding: 10px 11px;
border-radius: 10px;
background: #e9f1e7;
color: #4c7761;
font-size: 9px;
font-weight: 900;
letter-spacing: 0.04em;
}
.manifest-footer::before {
content: "";
width: 7px;
height: 7px;
border-radius: 50%;
background: #65b785;
box-shadow: 0 0 0 4px rgba(101, 183, 133, 0.13);
}
.scene-note {
position: fixed;
z-index: 5;
left: 28px;
bottom: 25px;
padding: 10px 13px;
border-radius: 999px;
background: rgba(36, 55, 70, 0.84);
color: #fffaf0;
font-size: 10px;
font-weight: 800;
letter-spacing: 0.03em;
pointer-events: none;
}
.controls {
position: fixed;
z-index: 6;
left: 28px;
bottom: 70px;
display: flex;
align-items: center;
gap: 12px;
color: #405762;
font-size: 10px;
font-weight: 800;
pointer-events: none;
}
.controls button {
padding: 8px 12px;
border: 1px solid rgba(36, 55, 70, 0.12);
border-radius: 10px;
background: rgba(255, 250, 240, 0.88);
color: var(--ink);
font: inherit;
font-size: 10px;
font-weight: 900;
cursor: pointer;
box-shadow: 0 7px 20px rgba(37, 59, 64, 0.1);
pointer-events: auto;
}
.controls button:hover {
background: white;
transform: translateY(-1px);
}
@media (max-width: 760px) {
.topbar {
top: 12px;
left: 12px;
right: 12px;
}
.brand {
padding: 9px 11px 9px 9px;
}
.mark {
width: 35px;
height: 35px;
}
h1 {
font-size: 19px;
}
.arrival {
display: none;
}
.manifest {
top: auto;
right: 12px;
bottom: 64px;
width: min(310px, calc(100vw - 24px));
padding: 15px;
}
.manifest h2 {
font-size: 18px;
}
.intro,
.reroute {
display: none;
}
.assignments {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0 12px;
}
.manifest-footer {
display: none;
}
.scene-note {
left: 12px;
bottom: 14px;
}
.controls {
left: auto;
right: 12px;
bottom: 15px;
}
.controls span {
display: none;
}
}
</style>
</head>
<body>
<div id="stage" aria-label="An animated voxel household sharing chores"></div>
<header class="topbar">
<div class="brand">
<div class="mark" aria-hidden="true"><i></i><i></i><i></i><i></i></div>
<div>
<span class="eyebrow">Household log / 08:00</span>
<h1>Chore Shift</h1>
</div>
</div>
<div class="arrival">
<span class="live-dot"></span>
MOCHI ARRIVED
<b>PLAN REBALANCED</b>
</div>
</header>
<aside class="manifest">
<span class="eyebrow">Live chore board</span>
<h2>A fairer little routine</h2>
<p class="intro">
Mochi, a tiny new housemate, just moved in. The fictional chore load
has been split into four playful assignments.
</p>
<div class="reroute">
<div class="route-card">
<span>Before</span>
<b>Mallow carried<br />4 / 4 chores</b>
</div>
<div class="route-arrow">→</div>
<div class="route-card">
<span>After</span>
<b>Four helpers<br />1 / 1 each</b>
</div>
</div>
<ul class="assignments">
<li>
<span class="avatar" style="background:#f27964">SO</span>
<span>
<span class="assignment-name">Sora</span>
<span class="assignment-task">Crumb Quest</span>
</span>
<span class="active">SWEEPING</span>
</li>
<li>
<span class="avatar" style="background:#5b8def">OL</span>
<span>
<span class="assignment-name">Ollie</span>
<span class="assignment-task">Sock Constellation</span>
</span>
<span class="active">FOLDING</span>
</li>
<li>
<span class="avatar" style="background:#8e7cc3">JU</span>
<span>
<span class="assignment-name">Juniper</span>
<span class="assignment-task">Cloud Curtain</span>
</span>
<span class="active">DUSTING</span>
</li>
<li>
<span class="avatar" style="background:#58b6a9">BE</span>
<span>
<span class="assignment-name">Bean</span>
<span class="assignment-task">Toy Gravity</span>
</span>
<span class="active">TIDYING</span>
</li>
</ul>
<div class="manifest-footer">All four assignments are in motion</div>
</aside>
<div class="scene-note">4 helpers · 1 tiny arrival · 0 forgotten chores</div>
<div class="controls">
<span>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";
const stage = document.getElementById("stage");
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.12;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
stage.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xcbdedd);
scene.fog = new THREE.Fog(0xcbdedd, 38, 68);
const camera = new THREE.OrthographicCamera(-12, 12, 8, -8, 0.1, 100);
const target = new THREE.Vector3(-0.45, 2.05, 0);
let azimuth = 0.72;
let elevation = 0.67;
let cameraZoom = 1;
function updateCamera() {
const radius = 30;
camera.position.set(
target.x + radius * Math.cos(elevation) * Math.sin(azimuth),
target.y + radius * Math.sin(elevation),
target.z + radius * Math.cos(elevation) * Math.cos(azimuth)
);
camera.lookAt(target);
camera.zoom = cameraZoom;
camera.updateProjectionMatrix();
}
function resize() {
const aspect = window.innerWidth / window.innerHeight;
const viewHeight = Math.max(13.5, 20.7 / aspect);
camera.left = (-viewHeight * aspect) / 2;
camera.right = (viewHeight * aspect) / 2;
camera.top = viewHeight / 2;
camera.bottom = -viewHeight / 2;
renderer.setSize(window.innerWidth, window.innerHeight);
updateCamera();
}
window.addEventListener("resize", resize);
// Lighting
const hemisphere = new THREE.HemisphereLight(0xfff5df, 0x789194, 2.25);
scene.add(hemisphere);
const sun = new THREE.DirectionalLight(0xffefd2, 3.35);
sun.position.set(-7, 14, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -18;
sun.shadow.camera.right = 18;
sun.shadow.camera.top = 16;
sun.shadow.camera.bottom = -16;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 45;
sun.shadow.bias = -0.00035;
scene.add(sun);
const fill = new THREE.DirectionalLight(0xb9e4ef, 1.15);
fill.position.set(10, 8, -7);
scene.add(fill);
// Shared materials
const materialCache = new Map();
function mat(color) {
if (color && color.isMaterial) return color;
if (!materialCache.has(color)) {
materialCache.set(
color,
new THREE.MeshStandardMaterial({
color,
roughness: 0.86,
metalness: 0
})
);
}
return materialCache.get(color);
}
function box(parent, w, h, d, color, x = 0, y = 0, z = 0, options = {}) {
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(w, h, d),
mat(color)
);
mesh.position.set(x, y, z);
mesh.castShadow = options.cast !== false;
mesh.receiveShadow = options.receive !== false;
parent.add(mesh);
return mesh;
}
function roundedRect(ctx, x, y, w, h, r) {
ctx.beginPath();
ctx.moveTo(x + r, y);
ctx.lineTo(x + w - r, y);
ctx.quadraticCurveTo(x + w, y, x + w, y + r);
ctx.lineTo(x + w, y + h - r);
ctx.quadraticCurveTo(x + w, y + h, x + w - r, y + h);
ctx.lineTo(x + r, y + h);
ctx.quadraticCurveTo(x, y + h, x, y + h - r);
ctx.lineTo(x, y + r);
ctx.quadraticCurveTo(x, y, x + r, y);
ctx.closePath();
}
function makeLabel(name, task, color) {
const canvas = document.createElement("canvas");
canvas.width = 512;
canvas.height = 128;
const ctx = canvas.getContext("2d");
roundedRect(ctx, 7, 7, 498, 114, 24);
ctx.fillStyle = "rgba(31, 48, 61, 0.94)";
ctx.fill();
ctx.lineWidth = 7;
ctx.strokeStyle = color;
ctx.stroke();
ctx.fillStyle = color;
roundedRect(ctx, 24, 29, 45, 67, 9);
ctx.fill();
ctx.fillStyle = "#fffdf5";
ctx.font = "900 32px Trebuchet MS, sans-serif";
ctx.fillText(name.toUpperCase(), 88, 54);
ctx.fillStyle = color;
ctx.font = "800 25px Trebuchet MS, sans-serif";
ctx.fillText(task.toUpperCase(), 88, 91);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();
const sprite = new THREE.Sprite(
new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthTest: false,
depthWrite: false,
toneMapped: false
})
);
sprite.scale.set(3.65, 0.91, 1);
sprite.renderOrder = 30;
return sprite;
}
// Ground and dollhouse shell
const ground = new THREE.Mesh(
new THREE.PlaneGeometry(200, 200),
mat("#bad2d1")
);
ground.rotation.x = -Math.PI / 2;
ground.position.y = -0.69;
ground.receiveShadow = true;
scene.add(ground);
box(scene, 18.4, 0.62, 12.3, "#a87553", 0, -0.32, 0);
box(scene, 18.05, 0.12, 11.95, "#d8b28a", 0, -0.01, 0);
const tileColors = ["#f3e6d1", "#eee0ca", "#f6ead8"];
const tileGeometry = new THREE.BoxGeometry(1.16, 0.055, 1.16);
for (let row = 0; row < 10; row++) {
for (let col = 0; col < 15; col++) {
const tile = new THREE.Mesh(
tileGeometry,
mat(tileColors[(row + col) % tileColors.length])
);
tile.position.set(-8.02 + col * 1.2, 0.08, -5.4 + row * 1.2);
tile.receiveShadow = true;
scene.add(tile);
}
}
box(scene, 18.2, 7, 0.32, "#efd5c5", 0, 3.5, -5.95, { cast: false });
box(scene, 0.32, 7, 12, "#c4ded0", -8.95, 3.5, 0, { cast: false });
box(scene, 18.25, 0.22, 0.4, "#fff0dc", 0, 6.96, -5.95);
box(scene, 0.4, 0.22, 12.05, "#fff0dc", -8.95, 6.96, 0);
box(scene, 18, 0.25, 0.18, "#b37f5c", 0, 0.2, -5.73);
box(scene, 0.18, 0.25, 11.8, "#b37f5c", -8.72, 0.2, 0);
// Window
box(scene, 3.9, 2.55, 0.09, "#8ed0e6", -5.2, 4.25, -5.71);
box(scene, 4.15, 0.16, 0.18, "#fff7e9", -5.2, 5.58, -5.53);
box(scene, 4.15, 0.16, 0.18, "#fff7e9", -5.2, 2.92, -5.53);
box(scene, 0.16, 2.8, 0.18, "#fff7e9", -7.12, 4.25, -5.53);
box(scene, 0.16, 2.8, 0.18, "#fff7e9", -3.28, 4.25, -5.53);
box(scene, 0.12, 2.55, 0.2, "#fff7e9", -5.2, 4.25, -5.52);
box(scene, 3.85, 0.12, 0.2, "#fff7e9", -5.2, 4.25, -5.52);
box(scene, 1.0, 0.35, 0.08, "#f8f4df", -5.8, 4.8, -5.61);
box(scene, 1.25, 0.3, 0.07, "#f8f4df", -4.6, 3.8, -5.61);
// Chore board texture
const boardCanvas = document.createElement("canvas");
boardCanvas.width = 1024;
boardCanvas.height = 512;
const bctx = boardCanvas.getContext("2d");
bctx.fillStyle = "#203641";
bctx.fillRect(0, 0, 1024, 512);
bctx.fillStyle = "rgba(255,255,255,0.055)";
for (let x = 20; x < 1024; x += 32) {
for (let y = 18; y < 512; y += 32) {
bctx.fillRect(x, y, 3, 3);
}
}
bctx.fillStyle = "#fffaf0";
bctx.font = "900 58px Trebuchet MS, sans-serif";
bctx.fillText("CHORE ORBIT", 52, 78);
bctx.fillStyle = "#9eb3b8";
bctx.font = "800 22px Trebuchet MS, sans-serif";
bctx.fillText("HOUSEHOLD PLAN / AFTER THE ARRIVAL", 55, 117);
roundedRect(bctx, 744, 29, 235, 68, 18);
bctx.fillStyle = "#f4c95d";
bctx.fill();
bctx.fillStyle = "#203641";
bctx.font = "900 18px Trebuchet MS, sans-serif";
bctx.fillText("MOCHI ARRIVED", 775, 57);
bctx.font = "800 14px Trebuchet MS, sans-serif";
bctx.fillText("REBALANCED 08:00", 781, 80);
const boardRows = [
["SO", "SORA", "CRUMB QUEST", "#f27964"],
["OL", "OLLIE", "SOCK CONSTELLATION", "#5b8def"],
["JU", "JUNIPER", "CLOUD CURTAIN", "#8e7cc3"],
["BE", "BEAN", "TOY GRAVITY", "#58b6a9"]
];
boardRows.forEach((row, i) => {
const y = 154 + i * 79;
roundedRect(bctx, 48, y, 928, 65, 13);
bctx.fillStyle = i % 2 ? "#294552" : "#2c4a56";
bctx.fill();
bctx.fillStyle = row[3];
roundedRect(bctx, 63, y + 12, 41, 41, 9);
bctx.fill();
bctx.fillStyle = "#203641";
bctx.font = "900 15px Trebuchet MS, sans-serif";
bctx.fillText(row[0], 72, y + 38);
bctx.fillStyle = "#fffaf0";
bctx.font = "900 22px Trebuchet MS, sans-serif";
bctx.fillText(row[1], 127, y + 40);
bctx.fillStyle = row[3];
bctx.font = "800 21px Trebuchet MS, sans-serif";
bctx.fillText(row[2], 320, y + 40);
bctx.fillStyle = "#9cc6b4";
bctx.font = "900 14px Trebuchet MS, sans-serif";
bctx.fillText("IN MOTION", 839, y + 39);
bctx.fillStyle = "#82d49b";
bctx.fillRect(815, y + 27, 10, 10);
});
const boardTexture = new THREE.CanvasTexture(boardCanvas);
boardTexture.colorSpace = THREE.SRGBColorSpace;
boardTexture.anisotropy = renderer.capabilities.getMaxAnisotropy();
box(scene, 6.7, 3.55, 0.18, "#b87a52", 0.05, 3.92, -5.73);
const board = new THREE.Mesh(
new THREE.PlaneGeometry(6.45, 3.3),
new THREE.MeshBasicMaterial({
map: boardTexture,
toneMapped: false
})
);
board.position.set(0.05, 3.92, -5.62);
scene.add(board);
// Sofa
const sofa = new THREE.Group();
sofa.position.set(-5.05, 0.06, -4.63);
scene.add(sofa);
box(sofa, 3.9, 0.62, 1.5, "#cb6d5f", 0, 0.43, 0);
box(sofa, 3.9, 1.3, 0.34, "#d87968", 0, 1.12, -0.59);
box(sofa, 0.35, 1.0, 1.5, "#d87968", -1.8, 0.83, 0);
box(sofa, 0.35, 1.0, 1.5, "#d87968", 1.8, 0.83, 0);
for (let i = -1; i <= 1; i++) {
box(sofa, 1.08, 0.2, 1.12, "#ed9783", i * 1.17, 0.83, 0.08);
}
box(sofa, 0.72, 0.72, 0.22, "#f4c95d", -1.08, 1.13, -0.28);
box(sofa, 0.7, 0.16, 0.7, "#8e7cc3", 1.05, 0.84, 0.13);
for (const x of [-1.5, 1.5]) {
for (const z of [-0.48, 0.48]) {
box(sofa, 0.18, 0.32, 0.18, "#77523c", x, 0.16, z);
}
}
// Coffee table
const table = new THREE.Group();
table.position.set(-5.1, 0.06, -1.65);
scene.add(table);
box(table, 3.0, 0.18, 1.45, "#c98c5e", 0, 0.85, 0);
for (const x of [-1.15, 1.15]) {
for (const z of [-0.45, 0.45]) {
box(table, 0.18, 0.78, 0.18, "#9d6948", x, 0.42, z);
}
}
box(table, 0.85, 0.08, 0.6, "#5b8def", -0.5, 0.99, 0);
box(table, 0.65, 0.55, 0.12, "#f4c95d", 0.65, 1.22, -0.1);
// Kitchen counter along the left wall
const kitchen = new THREE.Group();
kitchen.position.set(-7.58, 0.06, -2.25);
scene.add(kitchen);
box(kitchen, 1.55, 1.25, 4.9, "#91b9aa", 0, 0.68, 0);
box(kitchen, 1.76, 0.17, 5.08, "#f4e7ce", 0, 1.39, 0);
for (let i = 0; i < 3; i++) {
box(kitchen, 0.055, 0.98, 1.38, "#a7c9b8", 0.8, 0.69, -1.6 + i * 1.6);
box(kitchen, 0.08, 0.08, 0.48, "#557d71", 0.84, 1.05, -1.6 + i * 1.6);
}
box(kitchen, 0.95, 0.045, 1.25, "#6f9398", 0, 1.49, -0.75);
box(kitchen, 0.09, 0.55, 0.09, "#58777d", 0, 1.72, -1.1);
box(kitchen, 0.09, 0.08, 0.52, "#58777d", 0, 1.98, -0.86);
box(kitchen, 0.7, 0.7, 0.7, "#f27964", 0, 1.83, 1.45);
box(kitchen, 0.38, 0.14, 0.38, "#f8b9a4", 0, 2.23, 1.45);
// Shelf for the dusting assignment
const shelf = new THREE.Group();
shelf.position.set(6.25, 0.06, -5.3);
scene.add(shelf);
box(shelf, 0.16, 3.65, 0.75, "#b77b52", -1.55, 2.05, 0);
box(shelf, 0.16, 3.65, 0.75, "#b77b52", 1.55, 2.05, 0);
box(shelf, 3.2, 0.14, 0.78, "#c98c5e", 0, 1.15, 0);
box(shelf, 3.2, 0.14, 0.78, "#c98c5e", 0, 2.35, 0);
box(shelf, 3.2, 0.14, 0.78, "#c98c5e", 0, 3.55, 0);
const bookColors = ["#f27964", "#5b8def", "#f4c95d", "#8e7cc3", "#58b6a9"];
for (let i = 0; i < 5; i++) {
box(shelf, 0.18, 0.52 + (i % 2) * 0.12, 0.42,
bookColors[i], -1.12 + i * 0.32, 2.67, 0.05);
}
box(shelf, 0.8, 0.65, 0.5, "#a8d2b7", 0.65, 1.6, 0.05);
box(shelf, 0.45, 0.42, 0.42, "#f4c95d", -0.75, 1.43, 0.06);
// Center rug
box(scene, 6.45, 0.065, 4.35, "#db7968", -0.35, 0.12, 1.45);
box(scene, 6.08, 0.07, 3.98, "#f2d8b8", -0.35, 0.15, 1.45);
box(scene, 0.16, 0.075, 3.96, "#e9ad91", -0.35, 0.18, 1.45);
box(scene, 6.05, 0.075, 0.16, "#e9ad91", -0.35, 0.18, 1.45);
// Laundry basket
const basket = new THREE.Group();
basket.position.set(-3.05, 0.08, 1.05);
scene.add(basket);
box(basket, 1.25, 0.13, 1.05, "#a87951", 0, 0.12, 0);
box(basket, 0.14, 0.62, 1.05, "#b9875b", -0.55, 0.38, 0);
box(basket, 0.14, 0.62, 1.05, "#b9875b", 0.55, 0.38, 0);
box(basket, 1.1, 0.62, 0.14, "#b9875b", 0, 0.38, -0.46);
box(basket, 1.1, 0.38, 0.14, "#b9875b", 0, 0.29, 0.46);
box(basket, 0.78, 0.08, 0.67, "#5b8def", -0.13, 0.48, 0.03);
box(basket, 0.55, 0.09, 0.48, "#f27964", 0.2, 0.56, -0.04);
// Toy chest
const toyChest = new THREE.Group();
toyChest.position.set(4.0, 0.08, 2.2);
scene.add(toyChest);
box(toyChest, 1.8, 0.82, 1.45, "#73b7a6", 0, 0.48, 0);
box(toyChest, 1.95, 0.18, 1.58, "#e7c35d", 0, 0.96, 0);
box(toyChest, 0.75, 0.16, 0.08, "#fff0c7", 0, 0.61, 0.76);
box(toyChest, 0.35, 0.09, 0.08, "#fff0c7", 0, 0.8, 0.77);
// Plant
const plant = new THREE.Group();
plant.position.set(-7.35, 0.08, 4.0);
scene.add(plant);
box(plant, 0.9, 0.85, 0.9, "#d8896d", 0, 0.44, 0);
box(plant, 0.72, 0.08, 0.72, "#6b4d3d", 0, 0.88, 0);
box(plant, 0.1, 1.45, 0.1, "#477d5d", 0, 1.52, 0);
box(plant, 0.78, 0.18, 0.42, "#70a66f", -0.27, 1.65, 0);
box(plant, 0.78, 0.18, 0.42, "#70a66f", 0.3, 1.9, 0);
box(plant, 0.7, 0.18, 0.38, "#87bc77", 0, 2.22, 0);
// Voxel helper factory
function makeHelper({
name,
task,
color,
accent,
skin = "#d99b76",
hair = "#4b3532",
x,
z,
yaw,
style = "short"
}) {
const group = new THREE.Group();
group.position.set(x, 0.13, z);
group.rotation.y = yaw;
scene.add(group);
const leftLeg = new THREE.Group();
const rightLeg = new THREE.Group();
leftLeg.position.set(-0.16, 0.64, 0);
rightLeg.position.set(0.16, 0.64, 0);
group.add(leftLeg, rightLeg);
box(leftLeg, 0.23, 0.5, 0.27, accent, 0, -0.24, 0);
box(rightLeg, 0.23, 0.5, 0.27, accent, 0, -0.24, 0);
box(leftLeg, 0.27, 0.15, 0.39, "#37464c", 0, -0.51, 0.06);
box(rightLeg, 0.27, 0.15, 0.39, "#37464c", 0, -0.51, 0.06);
box(group, 0.68, 0.73, 0.42, color, 0, 1.06, 0);
box(group, 0.52, 0.46, 0.045, accent, 0, 0.98, 0.235);
box(group, 0.55, 0.55, 0.53, skin, 0, 1.7, 0);
if (style === "bun") {
box(group, 0.6, 0.18, 0.58, hair, 0, 1.98, 0);
box(group, 0.3, 0.3, 0.3, hair, 0, 2.16, -0.08);
} else if (style === "cap") {
box(group, 0.64, 0.2, 0.59, accent, 0, 2.0, 0);
box(group, 0.48, 0.08, 0.3, accent, 0, 1.93, 0.4);
} else {
box(group, 0.61, 0.18, 0.58, hair, 0, 1.99, -0.02);
box(group, 0.15, 0.34, 0.14, hair, -0.29, 1.83, -0.02);
box(group, 0.15, 0.34, 0.14, hair, 0.29, 1.83, -0.02);
}
box(group, 0.075, 0.09, 0.04, "#26333a", -0.13, 1.73, 0.281);
box(group, 0.075, 0.09, 0.04, "#26333a", 0.13, 1.73, 0.281);
box(group, 0.19, 0.045, 0.045, "#8f5147", 0, 1.56, 0.282);
const leftArm = new THREE.Group();
const rightArm = new THREE.Group();
leftArm.position.set(-0.43, 1.32, 0);
rightArm.position.set(0.43, 1.32, 0);
group.add(leftArm, rightArm);
box(leftArm, 0.19, 0.58, 0.22, color, 0, -0.27, 0);
box(rightArm, 0.19, 0.58, 0.22, color, 0, -0.27, 0);
box(leftArm, 0.2, 0.18, 0.23, skin, 0, -0.61, 0);
box(rightArm, 0.2, 0.18, 0.23, skin, 0, -0.61, 0);
const label = makeLabel(name, task, color);
label.position.set(0, 2.72, 0);
group.add(label);
return {
group,
leftLeg,
rightLeg,
leftArm,
rightArm,
label
};
}
const sora = makeHelper({
name: "Sora",
task: "Crumb Quest",
color: "#f27964",
accent: "#596d86",
hair: "#533a34",
x: -0.15,
z: 2.3,
yaw: 0.08,
style: "short"
});
const ollie = makeHelper({
name: "Ollie",
task: "Sock Constellation",
color: "#5b8def",
accent: "#405873",
skin: "#efbd94",
hair: "#3d5f86",
x: -4.05,
z: 1.05,
yaw: Math.PI / 2,
style: "short"
});
const juniper = makeHelper({
name: "Juniper",
task: "Cloud Curtain",
color: "#8e7cc3",
accent: "#5e527f",
skin: "#b97e61",
hair: "#352b35",
x: 5.7,
z: -3.65,
yaw: 2.55,
style: "bun"
});
const bean = makeHelper({
name: "Bean",
task: "Toy Gravity",
color: "#58b6a9",
accent: "#447b76",
skin: "#d49a72",
hair: "#78523e",
x: 2.3,
z: 1.62,
yaw: 1.2,
style: "cap"
});
// Sora's broom
const broom = new THREE.Group();
broom.position.set(0.42, 0.13, 0.8);
sora.group.add(broom);
box(broom, 0.08, 1.55, 0.08, "#b27a4b", 0, 0.83, 0);
box(broom, 0.58, 0.16, 0.28, "#f4c95d", 0, 0.08, 0);
box(broom, 0.5, 0.1, 0.08, "#d9a949", 0, 0.08, 0.13);
const crumbs = [];
const crumbPositions = [
[-0.85, 1.65], [-0.45, 1.95], [0.05, 1.7],
[0.35, 2.35], [-0.1, 2.65], [0.65, 2.05],
[-0.7, 2.45], [0.8, 2.75]
];
crumbPositions.forEach(([x, z], i) => {
const crumb = box(
scene,
0.12 + (i % 3) * 0.025,
0.1,
0.12,
i % 2 ? "#a9704d" : "#d08b58",
x,
0.24,
z
);
crumbs.push(crumb);
});
// Ollie's animated sock
const sock = new THREE.Group();
ollie.group.add(sock);
box(sock, 0.45, 0.12, 0.28, "#f27964", 0, 0, 0);
box(sock, 0.17, 0.13, 0.29, "#f5a394", -0.17, 0, 0);
box(sock, 0.48, 0.055, 0.3, "#ffcf62", 0, 0.09, 0);
// Juniper's duster
const duster = new THREE.Group();
duster.position.set(0.28, 0.06, 1.12);
juniper.group.add(duster);
box(duster, 0.07, 1.48, 0.07, "#b27a4b", 0, 0.76, 0);
box(duster, 0.5, 0.34, 0.24, "#fff4df", 0, 1.56, 0);
box(duster, 0.54, 0.12, 0.27, "#e6ddcd", 0, 1.45, 0);
const dustMotes = [];
const moteMaterial = new THREE.MeshStandardMaterial({
color: "#fff4c8",
emissive: "#f4c95d",
emissiveIntensity: 0.45,
roughness: 1
});
for (let i = 0; i < 12; i++) {
const mote = new THREE.Mesh(
new THREE.BoxGeometry(0.07, 0.07, 0.07),
moteMaterial
);
mote.position.set(
5.75 + (i % 4) * 0.33,
1.4 + Math.floor(i / 4) * 0.45,
-4.72 + (i % 2) * 0.2
);
scene.add(mote);
dustMotes.push(mote);
}
// Bean's floating toy blocks
const flyingToys = [];
const toySpecs = [
{ color: "#f27964", start: [3.15, 0.35, 2.95], end: [4.0, 1.18, 2.2] },
{ color: "#f4c95d", start: [4.65, 0.35, 2.95], end: [4.25, 1.18, 2.2] },
{ color: "#8e7cc3", start: [3.8, 0.35, 3.3], end: [3.8, 1.18, 2.35] }
];
toySpecs.forEach((spec, i) => {
const toy = box(scene, 0.3, 0.3, 0.3, spec.color, ...spec.start);
flyingToys.push({
mesh: toy,
start: new THREE.Vector3(...spec.start),
end: new THREE.Vector3(...spec.end),
phase: i * 0.31
});
});
// Mochi's crib and new arrival
const crib = new THREE.Group();
crib.position.set(6.25, 0.08, -0.65);
scene.add(crib);
box(crib, 2.55, 0.24, 2.05, "#b98058", 0, 0.56, 0);
box(crib, 2.34, 0.18, 1.84, "#fff1d4", 0, 0.77, 0);
for (const x of [-1.18, 1.18]) {
for (const z of [-0.91, 0.91]) {
box(crib, 0.14, 1.25, 0.14, "#d29a69", x, 1.23, z);
}
}
box(crib, 2.5, 0.14, 0.14, "#d29a69", 0, 1.56, -0.91);
box(crib, 2.5, 0.14, 0.14, "#d29a69", 0, 1.56, 0.91);
box(crib, 0.14, 0.14, 1.96, "#d29a69", -1.18, 1.56, 0);
box(crib, 0.14, 0.14, 1.96, "#d29a69", 1.18, 1.56, 0);
for (let i = -3; i <= 3; i++) {
box(crib, 0.08, 0.55, 0.08, "#e0aa77", i * 0.33, 1.34, -0.91);
box(crib, 0.08, 0.55, 0.08, "#e0aa77", i * 0.33, 1.34, 0.91);
}
const baby = new THREE.Group();
baby.position.set(6.25, 0.86, -0.65);
scene.add(baby);
box(baby, 0.58, 0.66, 0.48, "#73b9c8", 0, 0.3, 0);
box(baby, 0.56, 0.54, 0.52, "#efb58f", 0, 0.9, 0);
box(baby, 0.6, 0.13, 0.56, "#f4c95d", 0, 1.16, -0.01);
box(baby, 0.07, 0.09, 0.04, "#26333a", -0.12, 0.92, 0.28);
box(baby, 0.07, 0.09, 0.04, "#26333a", 0.12, 0.92, 0.28);
box(baby, 0.18, 0.05, 0.045, "#8f5147", 0, 0.77, 0.28);
const babyLeftArm = new THREE.Group();
const babyRightArm = new THREE.Group();
babyLeftArm.position.set(-0.34, 0.55, 0);
babyRightArm.position.set(0.34, 0.55, 0);
baby.add(babyLeftArm, babyRightArm);
box(babyLeftArm, 0.17, 0.46, 0.18, "#73b9c8", 0, -0.2, 0);
box(babyRightArm, 0.17, 0.46, 0.18, "#73b9c8", 0, -0.2, 0);
box(babyLeftArm, 0.18, 0.17, 0.19, "#efb58f", 0, -0.47, 0);
box(babyRightArm, 0.18, 0.17, 0.19, "#efb58f", 0, -0.47, 0);
const rattle = new THREE.Group();
rattle.position.set(0.46, 0.45, 0.12);
baby.add(rattle);
box(rattle, 0.06, 0.48, 0.06, "#fff0c7", 0, 0.05, 0);
box(rattle, 0.28, 0.28, 0.28, "#f27964", 0, 0.34, 0);
const mochiLabel = makeLabel("Mochi", "New Arrival", "#f4c95d");
mochiLabel.position.set(6.25, 3.08, -0.65);
mochiLabel.scale.set(3.25, 0.81, 1);
scene.add(mochiLabel);
const arrivalStars = [];
const starMaterial = new THREE.MeshStandardMaterial({
color: "#f4c95d",
emissive: "#f4c95d",
emissiveIntensity: 0.55,
roughness: 0.8
});
for (let i = 0; i < 7; i++) {
const star = new THREE.Mesh(
new THREE.BoxGeometry(0.12, 0.12, 0.12),
starMaterial
);
scene.add(star);
arrivalStars.push(star);
}
// Custom pointer camera controls — no addon imports
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 dx = event.clientX - pointerX;
const dy = event.clientY - pointerY;
pointerX = event.clientX;
pointerY = event.clientY;
azimuth -= dx * 0.006;
elevation = THREE.MathUtils.clamp(elevation + dy * 0.0045, 0.38, 1.05);
updateCamera();
});
function stopDragging(event) {
dragging = false;
if (event && renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
renderer.domElement.addEventListener("pointerup", stopDragging);
renderer.domElement.addEventListener("pointercancel", stopDragging);
renderer.domElement.addEventListener("contextmenu", (event) => event.preventDefault());
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
cameraZoom = THREE.MathUtils.clamp(
cameraZoom * Math.exp(-event.deltaY * 0.001),
0.72,
1.55
);
updateCamera();
},
{ passive: false }
);
document.getElementById("reset").addEventListener("click", () => {
azimuth = 0.72;
elevation = 0.67;
cameraZoom = 1;
target.set(-0.45, 2.05, 0);
updateCamera();
});
// Animation
const clock = new THREE.Clock();
let elapsed = 0;
function animate() {
const dt = Math.min(clock.getDelta(), 0.05);
elapsed += dt;
// Sora sweeps and clears crumbs.
sora.group.position.y = 0.13 + Math.sin(elapsed * 3.2) * 0.018;
broom.position.x = 0.42 + Math.sin(elapsed * 2.45) * 0.23;
broom.rotation.z = -0.14 + Math.sin(elapsed * 2.45) * 0.19;
broom.rotation.x = Math.sin(elapsed * 2.45 + 0.4) * 0.08;
sora.rightArm.rotation.x = -0.48 + Math.sin(elapsed * 2.45 + 0.6) * 0.2;
sora.leftArm.rotation.x = -0.18 + Math.sin(elapsed * 2.45) * 0.12;
crumbs.forEach((crumb, i) => {
const phase = (elapsed * 0.34 + i * 0.13) % 1;
const scale = phase < 0.78
? 1 - (phase / 0.78) * 0.88
: 0.12 + ((phase - 0.78) / 0.22) * 0.88;
crumb.scale.setScalar(scale);
crumb.rotation.y += dt * 0.6;
});
// Ollie folds a sock and places it in the basket.
const foldPhase = (elapsed * 0.34) % 1;
const foldArc = Math.sin(foldPhase * Math.PI);
sock.position.set(
0.12 + Math.sin(elapsed * 2.2) * 0.07,
0.73 + foldArc * 0.25,
0.68 + foldPhase * 0.42
);
sock.rotation.set(0, Math.sin(elapsed * 1.7) * 0.32, 0);
ollie.leftArm.rotation.x = -0.72 - foldArc * 0.4;
ollie.rightArm.rotation.x = -0.72 - foldArc * 0.4;
ollie.leftLeg.rotation.x = Math.sin(elapsed * 2.2) * 0.03;
ollie.rightLeg.rotation.x = -Math.sin(elapsed * 2.2) * 0.03;
// Juniper dusts the shelf.
const dustWave = Math.sin(elapsed * 2.1);
duster.position.z = 1.1 + dustWave * 0.2;
duster.position.y = 0.06 + Math.sin(elapsed * 2.1 + 0.8) * 0.12;
duster.rotation.z = dustWave * 0.12;
juniper.rightArm.rotation.x = -0.85 + dustWave * 0.25;
juniper.leftArm.rotation.x = -0.25 - dustWave * 0.16;
dustMotes.forEach((mote, i) => {
const life = (elapsed * 0.35 + i * 0.17) % 1;
mote.position.y += Math.sin(elapsed * 1.4 + i) * 0.0018;
mote.scale.setScalar(0.4 + Math.sin(life * Math.PI) * 0.9);
mote.rotation.x += dt * 0.7;
mote.rotation.y += dt * 0.9;
});
// Bean puts toy blocks into the chest.
flyingToys.forEach((toy, i) => {
const phase = (elapsed * 0.23 + toy.phase) % 1;
toy.mesh.position.lerpVectors(toy.start, toy.end, phase);
toy.mesh.position.y += Math.sin(phase * Math.PI) * 0.9;
toy.mesh.rotation.x += dt * 1.2;
toy.mesh.rotation.y += dt * 1.5;
const shrink = phase > 0.82 ? 1 - (phase - 0.82) / 0.18 : 1;
toy.mesh.scale.setScalar(Math.max(0.01, shrink));
});
bean.rightArm.rotation.x = -0.72 + Math.sin(elapsed * 2.4) * 0.38;
bean.leftArm.rotation.x = -0.45 + Math.sin(elapsed * 2.4 + 1.1) * 0.25;
bean.leftLeg.rotation.x = Math.sin(elapsed * 2.4) * 0.035;
bean.rightLeg.rotation.x = -Math.sin(elapsed * 2.4) * 0.035;
// Mochi wiggles, shakes a rattle, and sparkles.
baby.position.y = 0.86 + Math.sin(elapsed * 2.5) * 0.025;
babyLeftArm.rotation.z = 0.22 + Math.sin(elapsed * 3.2) * 0.22;
babyRightArm.rotation.z = -0.22 - Math.sin(elapsed * 3.2 + 0.6) * 0.22;
rattle.rotation.z = Math.sin(elapsed * 4.6) * 0.45;
arrivalStars.forEach((star, i) => {
const angle = elapsed * 0.65 + i * (Math.PI * 2 / arrivalStars.length);
const radius = 1.05 + Math.sin(elapsed * 1.2 + i) * 0.12;
star.position.set(
6.25 + Math.cos(angle) * radius,
1.65 + Math.sin(angle * 1.4) * 0.55,
-0.65 + Math.sin(angle) * radius
);
star.rotation.set(elapsed + i, elapsed * 0.7, 0);
star.scale.setScalar(0.55 + Math.sin(elapsed * 2 + i) * 0.25);
});
mochiLabel.position.y = 3.08 + Math.sin(elapsed * 2.1) * 0.045;
renderer.render(scene, camera);
}
resize();
renderer.setAnimationLoop(animate);
</script>
</body>
</html>
```