by sloemo01
Playbook and Three.js code kit for detailed dioramas: classic pixel art, stroked toon or pixel + stroke; two intake gates for look and model sourcing; free orbit, palette snap and ink; animated toy-scale cast; per-entity frame QA.
# Add to your Claude Code skills
git clone https://github.com/sloemo01/dioramadiorama is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by sloemo01. Playbook and Three.js code kit for detailed dioramas: classic pixel art, stroked toon or pixel + stroke; two intake gates for look and model sourcing; free orbit, palette snap and ink; animated toy-scale cast; per-entity frame QA. It has 800 GitHub stars.
diorama's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/sloemo01/diorama" and add it to your Claude Code skills directory (see the Installation section above). diorama ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
diorama is primarily written in JavaScript. It is open-source under sloemo01 on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh diorama against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
For a new commission, ask look first, model sourcing second, using the two gates below. These gates override older three-preset lists, automatic internet-first instructions and one-prompt assumptions elsewhere in this long guide and its references. Do not ask setup questions when merely editing the skill. Explicit answers in the brief skip the corresponding question; existing-project repairs retain recorded choices. An unanswered question is pending, not consent. Rendering and sourcing are independent of narrative/educational purpose.
Three looks are available: pixel (Classic Pixel Art; recommended), stroked-toon, pixel-stroke. Generic “pixel art”, “classic”, “old pixel style” and explicit delegation (“you choose”) resolve to pixel. All looks preserve free orbit. An unanswered style gate waits.
Three sourcing modes are available: internet-full, hybrid (recommended), authored-only. Generic “use internet models” resolves to hybrid unless the user requests downloaded models throughout. Older internet-first records map to hybrid on repairs. Sourcing requirements below apply only to modes that acquire external assets; authored-only skips model acquisition, not subject research, quality or geometry/contact checks.
This is the restored full-length guide, not the compact 4.x replacement. Keep its detailed composition, subject recipes, scene furniture, cast, animation, service/queue, vehicle, effects, framing and craft guidance. The following profile/sourcing updates override older wording only where explicitly stated.
Default sceneProfile: narrative. A place, landscape, amusement park, town, fantasy scene or interactive scene is not an educational mechanism. Pixel, stroked-toon and pixel+stroke choose the renderer, NOT the profile. Asset choice, a working ride or click interactions do not make a scene educational. Choose educational when the user asks to explain/teach how something works, its anatomy or causal sequence. If intent is genuinely mixed, ask once; otherwise infer and record it without another forced setup question.
Narrative has no educational UI by default. Do not import or instantiate education-v8.css, education-dock.mjs, an Explore/How it works panel, lesson steps, part picker, explanatory dashboard, floating callout labels or scattered teaching text for an ordinary diorama. This exclusion applies in ALL three render presets. Leave the scene/page visually clean. Free orbit and discreet functional pause/reset/accessibility controls remain permitted; diegetic park signs and shop names are scene geometry, not a teaching overlay. Optional title/readout furniture mentioned later is opt-in, not a toon/hybrid default. No debug panel in delivery.
Educational only: canonical V8 right card/mobile dock, causal lessons, part inspection and connected explanatory callouts apply to explanatory commissions, not to all scenes. Explicit UI-free requests still override the panel default: explanation can be delivered through the requested scene behavior and accompanying prose. Narrative scenes with explicitly requested ride/part inspection get the requested scoped interaction, not an automatic lesson dashboard. Explicit requested informational labels are allowed, but do not add unrelated teaching surfaces. Record uiMode: none | minimal-controls | requested-inspection | educational and why; never satisfy a UI test by adding unwanted UI.
Regression examples: “amusement park in pixel + stroked toon” → narrative + pixel-stroke + no education UI. “Interactive amusement park” → narrative; interaction alone adds no lessons. “Explain a roller coaster's operation” → educational, chosen style independently. “Amusement park with inspectable rides” → narrative + requested inspection only. A scene with no educational intent must not fail QA for lacking V8, lessons, labels or a card column.
Prevent intersections before adding detail or spawning copies, for people, animals, imported rigs, buildings, props and rides in BOTH profiles/all presets. Use references/action-clearance.md, templates/action-clearance.mjs and templates/pose-bounds.mjs with the actual production evaluator; this adds no educational UI.
requiredIds; missing actors/proxies or unverified coverage cannot pass. Test nonadjacent self-parts too, while explicitly declaring valid anatomical/structural joints. Proxy overlap is not automatically actual mesh penetration.sampledOnly:true is bounded sampled evidence, not continuous collision freedom. Move a real wrist/tail/knee into an obstacle, overlap building parcels and synchronize a crossing; the SAME production predicate must flag the fault and pass after repair. Review worst-contact side/back/top crops plus an action strip. Never hide bodies, shrink proxies, fade through walls or freeze the requested action to claim a pass. One source-driven QA runner, cached static obstacles, nearby-pair broad phase and worst-few reporting keep this practical.Ask the Model Sourcing Gate after the look is resolved, for BOTH profiles. Follow the recorded internet-full, hybrid or authored-only choice; do not silently impose internet-first. In the first two modes, reuse valid local assets but still search for missing major roles. The acquisition requirements in this section apply to those two modes; authored-only intentionally builds geometry and does not need a failed model search to justify it.
A search is not the deliverable. Before detailed hand-modelling, find candidates for the hero and major supporting roles, review the actual per-asset terms and appearance, download the chosen permitted model/dependencies, inspect an actual import, and USE it in the scene when it fits. A fitting, licensed asset must not be ignored in favour of primitive-only reconstruction merely because hand-building is familiar. Nor does importing one token tree satisfy sourcing a park's otherwise hand-built rides/buildings/cast. Record decisions for the main roles in the existing SOURCES/CREDITS/design ledger.
Fit means diorama-quality, not merely downloadable: correct subject/representation and silhouette, coherent kit/palette/proportions, adequate construction detail, usable parts/rig/clips for the requested motion or inspection, viable triangle/draw-call/texture budget, and compatibility with the chosen pixel/toon/hybrid rendering. Judge the real model from more than a thumbnail. Normalize scale/axes/origin, adapt colours/materials without losing important markings, preserve rigs/part identity, fit to the scene and review a rendered close-up. A realistic/PBR asset is not automatically disallowed if it can be adapted well; an unrelated low-poly substitute is not automatically suitable. Follow the original long-form craft, composition and motion standards after importing.
Rights remain mandatory: prefer FREE assets whose explicit terms permit commercial use, modifications and redistribution/embedding in the delivered scene. Read original asset/license evidence; retain credits/license/change notices where required. NC, ND, editorial, personal/educational-only and missing rights do not pass. Custom/ShareAlike/other terms require compatibility review, not a fake CC0 label. No purchases, subscriptions or paid downloads without explicit user approval. Check separately licensed dependencies. Commercial permission is not scientific accuracy or trademark/other-rights clearance.
Source order: use the user's Polyfork-first sweep for narrative kits/props, then the relevant original-author/model-library sources in this guide; if Polyfork misses, continue to appropriate alternatives rather than declare that the internet has none. Educational subjects use their bounded exact-subject search and extra accuracy/structure gate. Reuse a compatible kit for coherence. Do not crawl every provider indiscriminately or repeatedly search the same noun. Actual search/download/import evidence stays on disk; never fabricate searches, licenses or successful loads.
Hand-model only the justified gap: necessary missing/custom geometry, unsuitable candidates after source/fit checks, or interfaces/animation adaptations not supplied by an imported model. Selection or movement alone is NOT a reason to reject an asset: use real part/pivot wrappers where feasible. Retain an all-authored approach when the user explicitly asks for it. If browsing/downloads are unavailable, disclose the limitation and fallback; never say the search found nothing when it never ran. A quality mismatch, unclear license or lack of useful motion is a documented reason to reject, not a reason to force a bad download.
Proof before completion: for each major role record search/source, chosen asset or rejection/fallback reason, license evidence, actual downloaded file/path/hash and import/style/motion result. A compliant matching candidate found → acquired and used; no suitable candidate → honest specific fallback. Verify the chosen asset actually exists in the final scene, not just in assets/. Offline/standalone delivery packages every permitted dependency and is tested without network; a warm cache or CDN loader is not self-contained. Sourcing adds NO education panels, callouts or other UI to narrative scenes.
references/representation.md: Earth means a planet, not a globe on a stand. Ask real subject / physical teaching model / explanatory abstraction / you choose only if materially ambiguous; preserve explicit choices. Keep representation, render preset, purpose, scene/object context and Inside independent. Natural subjects do not acquire invented platforms, frames or machinery merely because this guide contains mechanical examples.references/external-models.md. This extends the older model-library section; do not fall back to primitive-only scenery without checking suitable assets.references/educational-models.md, not a narrative full-catalogue crawl. Add authored semantic IDs, interfaces, pivots and explanation where needed.templates/educational-asset-gate.mjs with reviewed evidence/credits and actual file hashes; CC0/CC-BY can pass, unknown/custom terms require review, NC/ND/editorial/incompatible terms do not pass. Verify dependencies and offline bundling; a remote CDN load is not an offline standalone artifact. This rights gate overrides older library summaries, including casually accepted restrictive licenses.templates/construction-kit.js and templates/interface-checks.js; reserve working pockets, derive contact stacks from shared datums, check actual geometry and repeats. Keep the original detailed construction/selection chapters. Material/selection/annotation checks apply only to implemented/requested features; no forced annotation system to satisfy QA. AABB overlap is a candidate, not certified penetration. Use scoped real mutations, not bespoke injected-object detectors. Available helpers are supplemental, not proof of a whole scene.A diorama is a tiny staged scene with a resettable three-quarter hero camera and free user orbit. The default pixel preset uses a white cut-out, palette-snapped pixel grid and ink contour; the other presets follow their own presentation contracts. Narrative scenes retain the slab and toy-scale animated cast; educational scenes use the exception below.
Classic Pixel Art is the recommended new-project look. Stroked toon / illustrated miniature
(stroked-toon) and the pixel + stroke hybrid (pixel-stroke) are optional
rendering presets for any subject, not a coffee-machine genre. Ask which of the
three to build in at the start of every project — see Render Preset Gate —
because the look changes presentation only, never the subject, story, research
requirements, choreography or construction standard, and nobody should have it
chosen silently on their behalf.
Profile precedence (read first): For an educational explanation, read
Educational Mechanism Profile before the narrative defaults. One mechanism and
one causal sequence replace ALL mandatory cast/ritual/multiple-system/story-prop
quotas throughout this guide. Clean off-white and the single V8 right card/mobile dock replace empty
paper or decorative figure UI (explicit placement requests remain supported). Construction and mechanical correctness are never
waived. For EVERY preset, free user orbit is mandatory; fixed/hero views below
refer to deterministic QA/reset poses, not a locked interaction camera.
This file restores the full guide. The supplemental references named in the 5.0 additions carry later approved sourcing/representation rules; copy-in modules and the detailed design sheet remain in templates/.
Execution index — do not read every genre recipe first. Resolve the preset
and profile, then use the fast-path table. Read Research Before You Model and
The Detail Bar (including whole-object completeness) for every build. Narrative
builds additionally use One Prompt, One Build, The Animation Bar and their
chosen rendering recipe; educational builds go directly to the canonical UI/
inspection and construction contracts. The Look Contract is pixel-only.
| Before advancing | One source of truth / required evidence |
|---|---|
| First mesh | Filled templates/DESIGN.md: complete object, essential parts, source provenance and shared mating frames |
| Repeated assembly | Construction regression gates: every instance, actual axes/bores and end-plane separation; not one good sample |
| Requested selection | Canonical educational UI and inspection contract: reuse selection behavior only as requested; no narrative education card/lessons/labels. Verify visible emphasis, keyboard equivalent and exact restoration |
| Claimed pass | Verification: nonempty actual geometry, expected counts, negative injections and fresh build hash tied to the report |
This table indexes existing acceptance rules; detailed tests live only in the sections named here. Read other subject recipes only when the build uses them.
Before the first mesh or presentation work, ask using the structured-choice tool when available. Keep labels and one-sentence consequences visible:
Which look should I build this in?
- Classic Pixel Art (Recommended) — The original finer palette-snapped miniature look with ink contours and ordered dither.
- Stroked Toon / Illustrated Miniature — Smooth bevelled parts, stepped shading and fine charcoal outlines.
- Pixel + Stroke — Toon shading and outlines on a low-resolution pixel grid.
Map answers respectively to pixel, stroked-toon, pixel-stroke. Generic “pixel art”, explicit classic and explicit delegation select pixel; silence waits. A reference image alone does not settle a materially ambiguous request. Do not repeat the question per material or repair. Record the answer verbatim in DESIGN, including the preset ID and renderer implementation. Every preset supports free orbit and deterministic hero reset; no second orbit question. After the look answer, ask the sourcing question next unless already answered. While either is pending, inspect local files and research the subject, but do not start detailed geometry, model downloads or a presentation implementation that commits the unanswered choice.
How should I create the models?
- Hybrid — source + custom-build (Recommended) — Search for commercially usable models, download and use the ones that fit, then model missing or scene-specific pieces myself.
- Internet models throughout — Search for and use commercially usable downloaded models for all major roles; focus my work on assembly, styling, rigging and animation.
- Fully agent-modeled — Build all scene geometry myself for a unified custom look, without downloading third-party models.
This is a separate question after style, not a hidden assumption or a confused “pixel hybrid” choice. Use stable question ID asset-strategy, single-select, and map answers to hybrid, internet-full, authored-only. Record exact user wording. Explicit delegation selects hybrid; silence waits. Explicit requests for original/procedural geometry answer authored-only; an offline deliverable alone does NOT mean authored-only (permitted assets can be packaged locally).
Pre-build decision receipt: after both answers, state one short line such as “Classic Pixel Art · hybrid sourcing · narrative · minimal controls”, then record the choices in DESIGN. Before delivery reconcile each major role against its chosen source mode and record native render dimensions, scaling and style crops. Missing answers, unsupported render-preset claims or unapproved sourcing switches cannot pass QA.
| If the commission is... | Read next, in this order |
|---|---|
| explicit explanation / guided how-it-works (not a machine or cutaway view alone) | Educational Mechanism Profile → Universal Inspection Controls → chosen render preset → Machine Grammar → Verification (profile-aware) |
| market, food truck, bakery, cafe, shop, laundromat | Cast → Clothed Cast: Heads, Layers, Hands → Service And Queue → Machine Grammar → Carrying, Loading And Mounting → Verification |
| heist, defence, combat | Detail Bar → Tool/Tower recipes → System And Combat Animation → Combat Readability → Verification |
| creature battle, game scene, anime/movie fight | Research Before You Model → Field Notes: Two-Creature Combat → Creature Anatomy → System And Combat Animation → Combat Readability → Verification |
| aquarium, pool, harbour | Cast → base rig → Water templates → Vehicles (boat) → Effects → Verification |
| station, airport, hotel, transit | Service And Queue → Vehicles → Crowd Variation → Verification |
| stage, festival, parade | Cast → Secondary Motion → Crowd Variation → System Grammar → Verification |
| farm, garden, nature | Creature Anatomy → Ambient Loops → Effects → Verification |
The narrative shape is place + repeated ritual + interruption + consequence. Educational scenes instead use mechanism + causal sequence + observable result; do not add a fictional interruption or cast. The fast path selects the relevant reference notes, not extra narrative requirements.
Don't use for photoreal scenes or full-resolution photographic product renders. Every scene MUST support free user orbit by default, including pixel, stroked-toon and pixel-stroke. No separate orbit consent exists. Keep a deterministic hero angle for QA/reset, never auto-spin.
Four lookups come before the first mesh: the subject by frames, the asset libraries, the motion itself, and the capture loop. Skipping them is how a build ends up with a plausible silhouette that matches nothing and animation that reads as generic. Budget for them, they are usually faster than the modelling they save.
| Question the research answers | Where it lands |
|---|---|
| what does it look like, exactly | refs/<subject>/*.png contact sheets |
| what does it do, in what order, how fast | refs/SOURCES.md + the beat table |
| does a rig or clip already exist | CREDITS.md + assets/ |
| is it actually right on screen | qa/ captures, compared to the sheets |
Find the real thing moving, not stills. For games, anime, sport or machinery the footage is the specification: it settles what the shape is, where the motion starts, how long each stage lasts and what colour it is at each step.
yt-dlp --flat-playlist --print "%(id)s | %(title)s | %(duration)s" "ytsearch6:<subject> animation"
yt-dlp --extractor-args "youtube:player_client=ios,android" -f 18 -o "refs/clip.%(ext)s" <id>
ffmpeg -i refs/clip.mp4 -vf "fps=8,scale=300:-1,tile=6x4" refs/sheet-%02d.png
Read the contact sheets with vision, then write the grammar down in words before touching geometry: ball leaves the hand on an arc, opens with a white burst, the creature springs out at full size, the ball snaps shut and returns. A paragraph like that is the acceptance test for the effect you are about to build.
Rules that come out of doing this repeatedly:
refs/<subject>/ next to the build so the next person can
see what you were matching, and so QA has an image to compare against.Internet-first sourcing applies to ALL major scene roles, not only creatures. Acquire and use fitting commercially licensed models by default; hand-build only a documented gap or explicit original-geometry request. Hand-building a creature from primitives is the last option, not the first. A rigged download with real deformation and usable clips beats four hundred lines of spheres the moment the camera comes within a metre. Search first, and keep a record of what you searched.
The ladder. Every hero asset walks down it in order.
tools/, assets/ or
model/ directory with GLBs in it. List it before anything else.Creatures, characters and rigs
| Source | Licence | What is actually there | How to search |
|---|---|---|---|
| Quaternius | CC0 | hundreds of low-poly creatures, characters, nature, buildings; the Universal Animation Library is 120+ clips | browse quaternius.com/packs, grab the pack GLB |
| KayKit / Kay Lousberg | CC0 | adventurers, skeletons, dungeon and RPG packs, rigged and animated | itch page, per-pack zip |
| Poly Pizza | CC0 or CC-BY | 10,000+ low-poly props, creatures, vehicles; GLB/OBJ, no login | search by noun, read the badge on each card |
| Kenney | CC0 | kits for props, vehicles, characters, UI, audio | category browse |
| Sketchfab | per model | the long tail: specific machines, animals, buildings | filter Downloadable + CC0/CC-BY before looking at anything |
| Smithsonian 3D | CC0 | scanned real objects, fossils, artefacts, vehicles | search, check the licence note under the download |
| NASA 3D Resources | public domain | spacecraft, rovers, terrain, helmets | browse by category |
| glTF Sample Assets | per model, mostly CC-BY 4.0 | canonical rigged test models (CesiumMan, Fox, BrainStem) | read LICENSES/ before use |
| Objaverse | mixed, per object | 800k research objects, good for odd props | verify the per-object licence, most are not clean |
| Meshy, Tripo, user-supplied | user owns the output | anything the pack libraries do not have, generated from the reference | export GLB, keep the prompt in CREDITS.md |
Animation clips (motion is usually harder to hand-key than shape is to model)
| Source | Licence | Notes |
|---|---|---|
| Quaternius Universal Animation Library | CC0 | 120+ humanoid clips, retargetable, best first stop |
| Mixamo | free with an Adobe account | thousands of humanoid clips + characters; check current Adobe terms, retarget in Blender or three.js |
| Rokoko Motion Library | 150 free clips, paid beyond | mocap quality, good for weight and follow-through |
| CMU Graphics Lab Motion Capture | free for research and commercial use with credit | raw BVH, huge, needs cleanup |
| Sketchfab animated models | per model | often ships with an idle/walk/attack set |
| Godot4 Open Animation Libraries | CC0 | Mixamo clips rebaked as Godot .bin/GLB banks, already retargeted; jwelchgames/Godot4-MixamoLibraries is the other mirror |
Props, environments, textures, light
| Source | Licence | Notes |
|---|---|---|
| Poly Haven | CC0 | HDRIs, textures, models; the HDRI set is the fastest way to fix flat lighting |
| ambientCG | CC0 | tiling PBR materials, HDRIs, some models |
| OpenGameArt | mixed | filter to CC0 / CC-BY; 3D section is thin but has good odd props |
| madjin/awesome-cc0 | index | a maintained list of CC0 sources when the usual four fail |
Searching them without a browser. Three of the libraries have open APIs, so a build can check them in a single command and read the licence back:
# Sketchfab: downloadable + CC0 only, name and page printed for each hit
curl -s "https://api.sketchfab.com/v3/search?type=models&downloadable=true&license=cc0&q=dragon&count=24" \
| python3 -c "import json,sys;[print(r['name'],'|','https://sketchfab.com/models/'+r['uid']) for r in json.load(sys.stdin)['results']]"
# Poly Haven: models, HDRIs, textures (filter by category)
curl -s "https://api.polyhaven.com/assets?t=models"
curl -s "https://api.polyhaven.com/assets?t=hdris&c=studio"
# ambientCG: materials and HDRIs by keyword
curl -s "https://ambientcg.com/api/v2/full_json?type=Material&limit=20&q=concrete" \
| python3 -c "import json,sys;print([a['assetId'] for a in json.load(sys.stdin)['foundAssets']])"
Poly Pizza, Quaternius, KayKit and Kenney are browsed by search on their own
pages; query them with the noun plus the style (low poly dragon, kaykit skeleton), not with a sentence.
Reference only, never geometry: The Spriters Resource, The Models Resource, sakugabooru, game rip archives, Pinterest. Use them to learn the shape and the timing, then build or buy the actual asset.
Shape is half the job; the other half is the motion, and it is researched the same way. Search the verb, not the noun.
# the motion itself, canonical first
web_search: "<subject> <move> animation" # a game doing it
web_search: "<subject> <move> slow motion" # real footage, for weight
web_search: "<subject> sprite sheet" # frame-by-frame timing
yt-dlp "ytsearch6:<subject> <move> animation"
ffmpeg -i clip.mp4 -vf "fps=12,scale=320:-1,tile=6x4" refs/move-%02d.png
Read the sheet, then count frames and convert: seconds = frames / fps, and
scale to the loop length you are building. That is how a 0.42 s anticipation and a
0.18 s contact become the beat table instead of a guess.
Write four lines per action before animating it:
wind-up 0.00 -> 0.42 weight back, head down, tail still
contact 0.42 -> 0.55 fastest frames, one pose held for two frames
follow 0.55 -> 0.90 overshoot, then settle
recover 0.90 -> 1.30 back to idle
Every attack in the beat sheet needs all four. Missing anticipation is why an effect reads as "it just happens", and missing follow-through is why it reads as "it snaps back".
For rigs, cross-check the reference against a real clip: if the library has a punch, a swipe or a jump that is close, retarget it and offset the acting, rather than keying a pose from scratch.
Every build writes refs/SOURCES.md. It is the proof the searches happened and
the reason the next person does not repeat them.
| Question | Searched | Found | Decision |
| --- | --- | --- | --- |
| what does the send-out look like | yt: "sword shield send out slow motion" | RoUJ_TWvB3g, orb + white burst | matched, timings below |
| hero creature rig | poly.pizza "dragon", quaternius characters | nothing matching the silhouette | hand-built from refs/sendout |
| hit reaction weight | yt: "pokemon take damage animation" | 0.9 s flinch, 1.7 s stagger | HURTS table |
A build with no SOURCES.md has not finished its research step, even if the
scene looks right.
Every beat gets frozen, captured and compared against the reference sheet before the next beat is built. The contact sheet of those captures is the review artifact, not a paragraph describing them.
?t=<second> in the page,
freeze(t) through the debug hook, screenshot the frame element.When the user gives a subject in one line, treat it as a commission, not a questionnaire. Make the creative decisions, state them in one short assumption line, and build the whole diorama. Do not stop at a plan, a blockout or a design sheet and wait for approval.
The only reasons to ask are credentials, a destructive action, a path that
would overwrite the user's work, or the Render Preset Gate. That gate is a
deliberate exception to autonomous assumptions: one question, once per project,
before the first mesh. Everything else is a default.
Ask the Render Preset Gate question first, then run the three lookups in
Research Before You Model:
CREDITS.md line per import and the search in refs/SOURCES.md.qa/shoot.mjs, a frozen ?t= frame, a contact
sheet) so every beat can be reviewed as a picture.For an invented subject, spend the same time on reference density instead: find three images that agree on what the place looks like, list the props they share, and build those before any invented detail.
Use these unless the prompt explicitly says otherwise:
| Knob | Default |
|---|---|
| Slab | 21 x 14 x 0.42 m; 16 x 12 for one room, 24 x 16 for a street, port or launch pad |
| Loop | 46 s at 40 Hz; one readable cycle plus a quiet seam |
| Palette | 64 entries |
| Systems | 4 defences/machines/service stations/attractions; 3 is acceptable, 6 is the ceiling |
| Cast | 4 to 6 roles total, including one disruption; 2 ambient loops |
| Props / landmarks | 2 hero props, 1 landmark, 3 to 6 supporting props |
| Hero detail | every hero object meets the Detail Bar |
| Animation | every hero actor has all five layers |
| Output | index.html, <slug>.html, README.md, DESIGN.md, src/, dist/ |
| Path | <cwd>/<slug>/ unless the user named a folder |
| Minimum viable | 3 systems, 3 roles + 1 disruption, 1 hero prop + 1 landmark, 30 s loop; still passes the bars |
State the assumption in one line before coding:
Assumption: market archetype, 46 s loop, 4 service systems, 6 roles plus a late customer, 21 x 14 slab, 64 colours. Say if you want a different scale or genre.
That line is the contract. State it, then continue in the same turn; do not wait for approval. It gives the user a chance to redirect after seeing the assumption, without blocking the build.
A scene like this runs for hours of agent time and thousands of messages: render loops, one screenshot per beat, one probe per bug. The session will need to compress its context, more than once, and compaction is lossy. Build so that a compact does not cost you the work:
DESIGN.md, refs/SOURCES.md,
CREDITS.md, qa/report.json and the beat table in stage.js must carry every
decision. If a fact only exists in a message, it is already gone.qa/frames/<entity>/sheet.png and shots/t-12.40.png are
stable handles a post-compact agent can re-read without rerunning anything.frames.mjs and
shoot.mjs rather than trusting your summary of what the last frame looked
like: the numbers are cheap, and a confident memory of an old build is the
most expensive thing in the session.TODO.md or an issue) so the thread
that survives compaction is the plan, not the chat.| Prompt shape | What to do |
|---|---|
| one noun ("a bakery") | pick the closest router row; invent the verb, disruption and goal |
| one sentence ("a lighthouse under siege") | take its nouns and verbs literally; fill the missing cast/systems from the router |
| a reference image | match its composition, camera side and palette first; keep this skill's detail/animation bars |
| "like X but Y" | reuse X's structure, replace the subject and the detail anchors; do not copy X's nouns |
| "make it detailed" | use the full Detail Bar and five animation layers; do not add more systems |
| "keep it simple" | cut systems and cast, not detail per hero; two rich objects beat six blockouts |
A prompt that names only a place is still a commission. Decide what the place does, who arrives, and what goes wrong. State the assumption and build.
Pick the closest row. Do not invent a new genre from scratch unless none fit.
| If the prompt is... | Systems (3–5) | Cast | Goal / disruption | Detail anchor |
|---|---|---|---|---|
| defence, siege, castle, base, zombies | 4 towers + gate guns | defenders, 4 species, boss | boss reaches the gate | gatehouse |
| heist, bank, museum, casino | drill, lasers, cameras, getaway | 3 crew, guards, manager | vault opens / escape | vault door |
| market, kitchen, bakery, cafe, food truck, night market | stalls, ovens, prep, pass, dispatch | vendors, cooks, cashier, courier, customers, inspector | closing time / service rush / last bag | counter, hatch or oven |
| laundromat, workshop, gym, repair shop, arcade | washers, dryers, benches, tools, machine slots, ticket rail | folder, attendant, customer, courier, cat | last load / closing / power cut | machine bank or workbench |
| launch, factory, port, mine | gantry, press, crane, conveyor | crew, inspector, cargo | launch / ship / lift | gantry |
| aquarium, pool, harbour, reef | filters, pumps, slides, lights | fish, swimmers, diver, lifeguard | feeding / party / storm | reef or tank |
| station, airport, bus, hotel | signal, platform, desk, luggage | commuters, guard, porter | last departure | clock |
| festival, temple, carnival, funeral | stage, rides, altar, procession | performers, crowd, official | climax / storm | big top or altar |
| farm, garden, safari, nature | irrigation, harvester, weather vane | animals, farmer, crows | harvest / storm | barn |
| home, shop, library, workshop | rooms, counter, shelves, tools | family, clerk, customer, pet | opening / closing | window |
| arena, battle, mech, gladiator | traps, weapons, doors, lifts | fighters, champion, beast | champion enters | gate |
If none fit, use the universal shape: **place + repeated ritual + interruption
Do not freeze. Answer four questions about the noun:
Those four answers give you the system, cast, goal and residue. Then use the five beats: normal output → first interruption → escalation → goal contact → residue and seam. No combat required. A deadline, an inspection, a storm or a closing bell is a valid boss.
Worked one-prompt example:
"a tiny bakery at closing time"
DESIGN.md yourself. Do not ask the user to fill it.file://, README and DESIGN.md agreeing.If time is tight, cut the number of systems or actors, never the detail per hero or the animation layers. Two detailed towers with five layers beat six blockout towers with one fire animation.
Do not report "done" until all of these are true:
DESIGN.md exists and matches the build.file:// with zero console errors.When the subject is new, the first deliverable is a design sheet, not a scene.
With a one-line prompt, fill it from the defaults in One Prompt, One Build and
do not ask the user to complete it.
templates/DESIGN.md into the project as DESIGN.md.The rest of this file is the recipe for each pass.
UI and inspection authority: Canonical educational UI and inspection contract
below owns placement, controls, lessons, selection, focus and restoration. Follow
it rather than inferring defaults from older screenshots. The render preset gate
and free orbit apply unchanged.
Choose sceneProfile: educational for explicit explanations, guided technical cutaways and how-it-works teaching requests—not a machine subject, rotation or a cutaway view alone. This profile takes precedence over ALL narrative quotas below: no mandatory cast, disruption, ritual, landmark, three systems, ambient loops, five actor layers or decorative story props. One accurately constructed mechanism and one clear causal sequence is sufficient. Do not invent a crowd or combat to satisfy the router. Research and construction accuracy remain mandatory; simple UI never means missing mechanical parts.
freeze(t) yields identical state; desktop/phone hero frames and front/back/high orbit crops are reviewed; a motion strip proves causal order, contact and no interpenetration; controls, pointer-drag vs click, keyboard selection/focus and reset are tested. Store actual commands/results and tolerances in qa/report.json. An unrun check is UNVERIFIED, never a pass. These gates make omissions detectable; no skill can guarantee every future agent complies.orbit.reset(), never during user inspection.This is the single authority for educational UI, selection and lesson behavior. EDUCATIONAL / EXPLICITLY REQUESTED FEATURES ONLY: ordinary narrative scenes skip this chapter and its UI tests. Requested narrative inspection may reuse only its selection behavior; do not add the card, lessons or teaching labels. The exact V8 tokens/hierarchy below remain the 3.16 visual contract.
Use code, not an interpretation of “shadcn-style”. For new educational scenes WITH the educational UI enabled (not an explicit UI-free brief), copy templates/education-v8.css and build the DOM hierarchy below. UI-free educational scenes skip this chapter's DOM and UI tests; narrative scenes do not inherit it.
This is the canonical visual contract extracted from the V8 explorer, independent
of the chosen 3D render preset. Default to its ONE right card / mobile bottom dock;
do not substitute the older bottom/center examples as new-build defaults.
An explicitly requested bottom/center dock may change placement only, retaining
these tokens, controls and hierarchy. Existing repairs preserve requested placement.
The older education-dock.css is a minimal helper, NOT the V8 visual reference;
do not use it as the visual starting point for new educational builds.
Evidence: the grandfather-clock drift used beige/brass UI, a separate top-left title, translucent blurred panel and fixed top-to-bottom height. None follows from a clock subject. Brass belongs on the clock, not on its application chrome.
#f7f7f5, opaque card #fff, ink #18181b, muted #71717a,
border #e4e4e7, secondary #f4f4f5, focus/accent #2563eb..viewer: grid minmax(0,1fr) 360px, right padding 24px,
height 100dvh, vertically centered card. Stage is the first grid cell, NOT
a fullscreen canvas underneath an overlay. Card is content-height, max
calc(100dvh - 48px), 22px padding, 18px gap, 14px radius, 1px border,
shadow 0 1px 3px #18181b08, 0 8px 32px #18181b03.minmax(0,1fr) auto; dock max-height
48dvh, full width, top corners 14px, padding 16px 18px plus safe-area bottom.
Measure the actual remaining stage for camera fit and renderer sizing.<main class="viewer">
<div class="stage-wrap">
<canvas id="stage" tabindex="0" aria-label="Interactive mechanism; drag to orbit"></canvas>
<p class="gesture">Drag to orbit · scroll to zoom · click a part</p>
</div>
<aside class="panel" aria-label="Mechanism controls and explanation">
<div class="panel-top">
<header class="panel-head">
<div class="title-row"><h1>Subject name</h1><span class="badge">Interactive</span></div>
<p class="lede">Short input → change → output summary.</p>
</header>
<div class="tabs" role="tablist" aria-label="Mode">
<button id="tab-explore" role="tab" aria-selected="true" aria-controls="explore-panel">Explore</button>
<button id="tab-learn" role="tab" aria-selected="false" aria-controls="learn-panel" tabindex="-1">How it works</button>
</div>
<div class="controls" role="group" aria-label="Playback">
<button class="btn primary" id="play">Pause</button>
<button class="btn icon" id="prev" aria-label="Previous step">‹</button>
<button class="btn icon" id="next" aria-label="Next step">›</button>
<button class="btn icon" id="home" aria-label="Reset view">↺</button>
<button class="btn toggle" id="xray" aria-pressed="false">Inside</button>
</div>
</div>
<section id="learn-panel" role="tabpanel" aria-labelledby="tab-learn" hidden>
<p class="section-note">One short instruction.</p>
<div class="lesson-steps" role="group" aria-label="Causal steps"><!-- subject steps --></div>
</section>
<div class="readout">
<p class="phase-title" id="phaseTitle"></p>
<p class="phase-meta" id="phaseMeta"></p>
<p class="explain" id="explainText"></p>
</div>
<button class="link" id="clearPart" hidden>← Back to cycle</button>
<section id="explore-panel" role="tabpanel" aria-labelledby="tab-explore">
<label class="label" for="parts">Inspect a part</label>
<select id="parts"><option value="">Choose a part…</option></select>
</section>
<details class="disclosure help"><summary>About this model</summary>
<p class="section-note">Simplifications and keyboard help.</p>
</details>
<p class="sr-only" role="status" aria-live="polite" id="announcer"></p>
</aside>
</main>
Adapt subject names, number of lesson steps, part IDs, explanatory text and
physical units only. Omit Inside for a mechanism with no enclosing shell; never
add a fake x-ray toggle. Optional scrubber/Back lives in this same surface, not a
second toolbar. Use line SVG icons matching the supplied CSS in production.
Implement tab click plus ArrowLeft/Right/Home/End roving tabindex, hidden panel
state, and semantic buttons/select/range. Bind controls to the actual evaluator:
play/pause, freeze(step.phase), orbit.reset, reversible inside,
selectPart(id) and clearSelection. A lesson change freezes synchronously and
updates explanation from that state; it must not trigger automatic camera motion.
The skeleton/CSS is not a functioning controller; do not ship inert controls.
#f7f7f5 consistently in CSS,
renderer clear/scene and ground composition; user-requested white overrides all
those together. A screenshot is not mechanical clearance proof.qa/report.json;
missing browser/computed-style/visual checks remain UNVERIFIED.Raycast actual visible geometry: nearest eligible hit wins, respecting nearer opaque occluders. Map the hit mesh to both its assembly ID and its actual piece ID; assembly selection and clicked-mesh selection are distinct scopes. The single labelled keyboard piece picker must expose the same pieces/actions, including hidden pieces; never silently broaden a click to an entire assembly. Show one short explanation in the card. An optional single label uses a live geometry-local anchor and hides behind camera, offscreen or when occluded.
A deliberate canvas/picker Inspect selection may make one short useful camera AND OrbitControls-target transition to live selected bounds. Avoid end-on shafts and blocking housings; use an authored reveal/cutaway for hidden pieces and report remaining occlusion honestly. Save the prior view for Back; Reset restores the hero. User orbit/pointer/keyboard navigation cancels the tween immediately. Reduced motion uses an immediate useful view. Never auto-spin, chase moving parts or restart focus per frame. Lesson step selection instead pauses and synchronously freezes the real evaluator, highlights its part and updates phase/text/readout without moving the camera; only an explicit Inspect action focuses. Scrubbing updates the lesson from evaluated state, not an independent clock. Announce intentional changes politely, not each frame.
Use semantic buttons/select/range, visible focus and non-colour part-name cues;
canvas arrows orbit and R resets. Tabs implement roving focus and keyboard
navigation; no focus trap. Drag/multitouch is orbit, not click (use the movement
threshold/cancel handling in templates/orbit.js); UI gestures never bubble into
the stage. Paused and reduced-motion modes retain inspection.
This is an inspection overlay, not a new render preset, bloom pass or a way to hide modelling errors. Use the same mechanism for a selected gear, valve, pump impeller, drawer slide or anatomical structure. The V8 selection implementation is the calibration evidence: restrained warm material lift, dimmed context, transparent outer castings and selective gold feature edges. Do not interpret “glow” as a white emissive blob.
1. Preserve and derive, never mutate the shared originals. Build a registry once from the actual selectable meshes, BEFORE adding overlays. Store each exact original material reference, including arrays of material slots; a mesh's slot array itself must also be restored by identity. Derive cached variants from each source UUID plus mode. Clone userData and outlineParameters before changing outline alpha, since nested objects may otherwise be shared. Keep toon ramps, texture maps, roughness and existing supported preset properties. Restore the originals before applying each new selection/X-ray state, not by attempting to reverse colour arithmetic.
Use templates/inspection.js rather than duplicating a second material controller.
Its API is createInspection(THREE, {parts, contextMeshes, resolveVisibility, onChange, style}), with select({partId, mesh}), clear(), refresh(),
dispose() and piecePickerEntries(partId, {visibleOnly:false}) (includes hidden
pieces for keyboard inspection). Validate actual mesh membership before selection.
The helper supports rigid meshes only; reject skinned/instanced/morph assumptions.
resolveVisibility returns named hiddenPartIds/hiddenMeshes plus description
for an authored cover removal. Hiding requires shell:true, or an explicit
inspectionOccluder:true part plus an active selection and nonempty cutaway
description; that latter exception may remove an upper gear/bridge to expose a
lower part, never hide construction failures. Optional ghostPartIds/ghostMeshes
are accepted only for shell:true. Selected assemblies/pieces remain visible;
context meshes (floor/stand/UI) cannot hide, ghost or dim.
Unknown parts, duplicate ownership, empty geometry and unsupported material or
deformation paths fail explicitly. Never request a whole-mechanism ghost. The host owns
camera focus, picking and V8 DOM; the helper owns emphasis/restoration, not UI or
mechanical certification. Cached variants derive per original material and mode; never
from the currently displayed variant. Lift colour gently; write emissive values
only where the original material supports them. Dim context as opaque solids.
Only the explicit housing reveal below may change transparency/depth-write.
2. Reveal only manifest-authorized occluders; ghosting is shell-only. Never defeat depth on the selected part. Declare internalPartIds and occludingShellIds per subject in the component manifest. For an internal selection, remove authored covers or optionally ghost only declared outer housings that obscure it; keep the selected part solid, retain non-selected internals as dim solids, and leave floor/stand/UI alone. A global Inside toggle applies that same named reveal plan without dimming all internals. A selected housing stays highlighted rather than ghosting itself. Unlisted opaque solids must still occlude correctly: renderOrder does not override the depth buffer. For an internal blocker, author an explained selection-only inspectionOccluder:true removal plan; the independent Inside toggle still affects shells only. Hidden siblings need a piece-level plan and cannot remove the selected scope. Do not set depthTest=false, use additive whole-body overlays, or fade all solids to pretend a mechanism is correctly constructed. Picker rays ignore generated edges and ghost-shell hits, but respect remaining opaque foreground objects; click and picker share the same selection action.
3. Make the hologram from feature edges, attached to the live part. Do not use wireframe:true: that exposes triangle diagonals. Use EdgesGeometry(source.geometry, 32) and a restrained LineBasicMaterial (color:0xffc35c, opacity:0.5, transparent:true, depthTest:true, depthWrite:false, toneMapped:false). Normal blending, no bloom. Exclude slivers, ring grooves, gaskets and tiny bolts when edges become noise; the V8 thresholds were minimum dimension 0.018 units and, for cast housings, volume 0.006 units³. Those are model-scale-dependent starting values, not universal dimensions. Use one physical edge overlay on the selected component only, not a second full-scene OutlineEffect/Sobel pipeline. Its surface outline may need suppression to avoid doubled contours. WebGL line width is generally one device pixel: do not promise a controllable CSS-pixel width through linewidth.
Attach each owned edge overlay as an identity-transform child of its live source mesh; mark it as an inspection overlay and exclude it from raycasting. On change, remove and dispose owned overlays, never source geometry or shared maps.
This child pattern follows moving rigid geometry without copying a stale pose. If an overlay must be a sibling/world-space object, synchronise its transform from the source every evaluation; copying position/quaternion once is insufficient when the source mesh moves. EdgesGeometry does not automatically follow vertex deformation or per-instance transforms: skinned/morphed/instanced subjects need a deformation-aware shader/overlay or a clearly declared unsupported path. Never claim those supported because a rigid V8 example works. Do not dispose the source geometry, shared source maps, shared toon ramps or original materials; dispose only owned variants/edge geometries and owned overlay materials. Keep overlay generation bounded to selection changes, never create/dispose hundreds of edge objects every frame.
State and restoration contract. One selection controller owns this effect. Resolve in order: restore exact originals → remove previous edges → compute selected/internal/Inside state → ghost selected occluding housings → highlight selected meshes → dim remaining mechanism meshes → attach selected edges. Re-apply from originals when Inside changes. Leaving How it works restores its earlier Inside state and removes its tutorial tint; clearing selection retains an independently enabled Inside toggle. Picker, canvas, keyboard and lesson adapters must not compete by writing materials from separate uncoordinated caches. Clear/reset/teardown restores material references, opacity/depth/blending/outline state, selection/readout and authored camera state; only teardown disposes long-lived caches. Respect reduced motion; avoid automatic pulsing, scanlines or flashing. Keep the part name and keyboard focus as non-colour cues.
Historical evidence (not project dependencies): quartz-watch/shots/highlights/dialPost1.png,
quartz-watch/shots/highlights/dialPost2.png, quartz-watch/shots/highlights/dialPost3.png,
quartz-watch/shots/highlights/dialPost4.png, quartz-watch/shots/highlights/individual-piece.png,
quartz-watch/shots/highlights/rotor.png, quartz-watch/shots/highlights/reduction.png,
quartz-watch/qa/highlights-report.json and quartz-watch/qa/construction-report.json.
These record this repair, not files future users must have. Twenty-six assembly
glow states had numerical tests/captures; only a subset received visual review.
Do not present that as universal contrast certification.
Evidence and test — selection contract (3.18). Quartz-watch selection was
almost invisible, posts were end-on/occluded, and adding emitter properties to
MeshBasicMaterial caused a shader.value error. Use templates/inspection.js,
with templates/qa/inspection.test.mjs and
templates/qa/inspection-browser.mjs; use the API above. Assert assembly versus actual clicked-piece identity,
keyboard equivalence, nearest opaque occlusion, and obvious visible glow with
retained shape/colour (never a white blob) in desktop/phone crops. Test shared
and array materials, Basic/toon, two frozen phases, moving/orbiting, rapid changes,
Inside/clear/Back/Reset/lesson exit, interrupted focus and reduced motion. Restore
exact original material AND slot-array identities, shadow flags and visible
state, plus original material properties; test source immutability and owned-only
disposal with stable overlay/material counts. Basic materials must never gain
emissive or emissiveIntensity, even temporarily; feature-test capability before
writing, and assert absent properties remain absent. Verify shader compilation
and no console errors in the fresh browser build. Scalar/material tests alone do
not establish visible contrast, depth correctness or useful focus.
Use this short checklist for existing educational scenes before re-reading narrative recipes. Evidence: the LEAP-1B repair was requested because its permanent section exposed the core, its fit cropped the model, its beige background and crowded panel did not match the requested V8 reference. These checks supplement mechanical QA; passing enclosure rays or a screenshot does not certify a complete mechanism.
distance - along, so each fit bound
contributes abs(transverse)/tanHalf + along (not minus along). Do not clamp
distance below the solved fit or distort portrait aspect. Re-measure on layout,
disclosure, resize/orientation and zoom changes without hijacking user orbit.
Test: project covered/exposed swept bounds at desktop, tablet, 390×844,
320×640 and 200% zoom, with lesson/disclosure open; front/back/high captures;
fail an injected protrusion and verify near-plane/focus fits separately.Canonical educational UI and inspection contract, including rendered
background, accessible lesson state and desktop/phone/200% zoom gates. Do not
copy the reference subject or introduce a second surface.These construction rules apply across subjects and all render presets; they supplement, not replace, the style gate and profile-aware verification above. They make known failures testable, not impossible.
Specify the mating interface before decorating the part. Extend the component manifest with units, parent-local frame, shaft/bore/slide axes, shared joint/port anchor IDs, mating surfaces, nominal dimensions and radial/axial tolerances. Derive both mating meshes and their motion from those anchors, not repeated guessed offsets. A bearing eye needs a real through-bore; its beam, cap, bolt and bevel must stop outside that bore. Budget bevel/fillet intrusion in the actual construction method (inward bevels reduce usable bore), axial lane widths, spacers, end float and end stops. Check coaxial alignment and anchor residual after parent transforms. Model the load path through real bearings, brackets, fasteners and a base; route each functional port through an actual connected opening to its destination, not a hose ending inside a solid. Document symbolic/omitted internals. Evidence: V8 running-gear repair found a centred rod beam cutting its crankpin despite an annular eye, bank stagger applied to only one mating member, and fillets facing the wrong local axis. Test: local-axis/anchor tests, measured bore plus bevel allowance and axial stack tests, section crops from two orbit directions, and traced port/support connections. Record geometry revision and proof frames in the manifest. Copy templates/mechanism-contract.mjs and fill the interface and connection sheets in templates/DESIGN.md; the helper validates scalar budgets, not arbitrary mesh bores or load strength.
Audit the complete swept assembly, with narrowly scoped intended contact. Derive every driven pose from one driver and test the actual transformed meshes or documented conservative collision proxies, including beams, caps, fasteners, webs, fillets and supports. Broad-phase boxes alone neither detect holes correctly nor prove clearance. Enumerate potentially interacting pairs and coverage; whitelist only a named pair of mating surfaces with phase window, normal-gap/penetration tolerance and rationale (bearing/journal, meshing teeth, valve/seat), never an entire assembly or all pairs of a part type. All other pairs need the declared positive clearance. Check full travel, extrema, cycle seam, contact transitions and close-approach intervals with refinement; include ports/FX containment. Report method, sample spacing, tolerance, worst phase/pair, exclusions and unresolved regions. Dense sampled vertex/triangle tests are bounded evidence, not continuous exact collision proof: use analytic bounds or conservative continuous checks where available, otherwise retain that limitation explicitly and block unsupported clearance claims. Evidence: the V8 12/12 invariant report omitted rod/crank interference; the later rod probe added bore triangle samples, axial lanes, journal vertices, anchor residual and fillet axes. Test: intentionally inject a beam-through-bore, wrong-axis fillet, too-wide lane, out-of-window contact and a non-whitelisted overlap; each must fail. Run full-cycle probes plus before/contact/after crops from two angles. templates/qa/mechanism-contract.test.mjs tests budget/contact-policy failure detection only; per-scene geometry/sweep checks remain mandatory and UNVERIFIED until run.
Repeated interfaces share anchors and axes (3.18 evidence + test).
Generate ALL repeated mating members from one anchor/axis table, not just the
first working example. Quartz-watch pads at radius 12.6 missed posts at 13;
rotating a native CylinderGeometry about Y did not redirect its native Y axis.
The seconds shaft opposed its hand and the model lacked a physical 60:1 stage.
Coplanar shaft-cap fans z-fought. Use transformed local axes (quaternion maps
native Y to the declared axis), common anchors, real through-bores and a single
end surface or measured axial separation; never hide coplanar caps with depth
overrides. Derive ratio/direction from the actual connected transmission, not
only a display hand formula. Test: with templates/mechanism-contract.mjs
shared anchors/checkRepeatedInterfaces/checkEndPlanes, enumerate every pad,
post, bore, cap and shaft; assert count, transformed axis/anchor residual,
radial/axial clearance and physical ratio/direction across the full cycle.
The repaired watch measured zero residual at all four pad anchors and 0.08
board-bore radial clearance; those are historical measurements, not defaults.
Inject one displaced repeat, wrong native axis, sealed bore, reversed shaft,
missing reduction and coplanar cap; each relevant check must fail. Review
section/end-on and oblique crops; scalars cannot prove real mesh openings.
Evidence: the historical construction report and highlight shots above.
Lesson/UI behavior and its tests are defined once in Canonical educational UI and inspection contract. templates/education-dock.mjs remains a dependency-free
state helper with templates/qa/education-dock.test.mjs; its older CSS is not the
V8 visual authority.
Copy templates/orbit.js for EVERY scene and preset. Create it after camera fit with the fitted target; keep animation evaluation independent of camera interaction. Render on control change even when paused. Expose orbit.reset() and have the QA freeze wrapper reset it before capture (freeze(t) evaluates time synchronously). User pause/freeze UI need not reset their chosen inspection angle. Fit zoom/polar limits to real subject bounds without preventing back/high inspection. No auto-rotation, no camera motion driven by the animation clock. Keep reset + a brief drag/keyboard hint accessible; educational controls and selection follow Canonical educational UI and inspection contract.
pixel-stroke is a third style, not the pixel default, and it is selected through the single Render Preset Gate question — never inferred, never switched to later without a new answer. Record the answer and do not offer it again during the build. Rotation is mandatory regardless of the answer.
Copy templates/pixel-stroke.js plus templates/stroked-toon.js. Create WebGLRenderer with antialias false, alpha true. Use createPixelStroke(renderer, {width:320,height:200}), its toon/flat material factories and render(scene,camera). Resize the low-resolution target explicitly with look.setSize(bufferW,bufferH) while sizing the renderer to the display aspect; keep target aspect aligned to viewport/camera. Toon lighting/materials plus selective geometry OutlineEffect render into that target, then ONE nearest-neighbour fullscreen upscale. Do not run PixelPost, Sobel ink, a second outline pass or CSS blur over it. Native-resolution DOM UI is outside the target and must remain crisp.
OutlineEffect thickness is a projected effect parameter, NOT a CSS-pixel width. Rasterisation happens at the low-resolution target: a one-target-pixel contour becomes approximately displayWidth / targetWidth CSS pixels after upscale (analogous vertically). A thinner subpixel outline can disappear or flicker; measure target and screen crops at desktop/phone, adjust target resolution and selective material stroke together. Disable outlines for inward cavity surfaces, liquids, films, transparent glass, vapour and contact patches; do not double edges. For native toon, measure the native-DPR render instead. Free orbit, construction, manifest and QA requirements are unchanged.
Use stroked toon / illustrated miniature (stroked-toon) only as resolved by
Render Preset Gate; retain its recorded answer during repairs. The gate owns
consent/default/recording rules—do not ask a second style question here. This
preset changes presentation, not the subject or choreography; never import
coffee props or workshop colours into an unrelated scene. Record paper/frame
and camera choices alongside the preset in DESIGN.md.
Precedence when approved: the recipe below replaces the pixel-only camera, white/no-plinth, palette-snap, edge-shader, Bayer, empty-paper and buffer rules where they conflict. Do not combine both post pipelines by default. A thin bevelled slab edge and a restrained optional figure frame/title/hint/readout are allowed. Locked animation framing, deterministic time, clipping/containment, contacts, silhouette readability, detail and animation QA still apply. Orbit is mandatory for all presets; it needs no separate approval. Character proportions remain subject-appropriate; don't force toy people into every scene.
Copy templates/stroked-toon.js into the project. It exports an opt-in Three.js
helper; it has no dependency on Anatomy CSS, SVG, fonts or the coffee rig.
NoToneMapping. Disable PixelPost, palette quantisation, dither,
Sobel ink and CSS image-rendering: pixelated. Keep a small authored colour
family, not a requirement that every final shaded pixel equal a palette entry.MeshToonMaterial with a 4×1 RedFormat ramp,
bytes [68, 122, 184, 246], nearest filters, no mipmaps. These are starting
values, not physical light calibration. Give materials distinct local colours:
warm/cool off-white, desaturated object hues, dark structure, metal or timber,
one restrained accent. Adapt to the setting; warm cream is optional.OutlineEffect, warm charcoal rather
than pure black. Start thickness 0.0024–0.0038 (effect units, not world units
or pixels). At the final viewport, aim for a roughly 1–2 CSS-pixel hero contour
with finer subordinate edges; tune by screenshots at desktop and phone sizes.
Broad silhouettes can be heavier, tiny fasteners lighter. Do not add wireframe
or stroke every triangulation. Flat decals, liquid films, transparent glass,
steam, contact patches and inward cavity surfaces normally have no outline.Minimal integration after user confirmation:
import * as THREE from 'three';
import { createStrokedToon } from './core/stroked-toon.js';
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
const look = createStrokedToon(renderer);
renderer.setSize(width, height, false);
const shell = look.toon(0xc4cbb4);
const inner = look.toon(0xb8bfaa, { outline: false });
// Add subject-specific lighting and objects; do not also call PixelPost.render.
look.render(scene, camera);
// On resize: renderer.setSize(width, height, false); update camera projection.
Use the Detail Bar's silhouette → construction → story passes, plus this close-up
acceptance bar. Detail is structural, not a quota of randomly scattered meshes.
Visual calibration references are media/stroked-toon-reference.jpg (overall
framing/material hierarchy) and media/stroked-toon-service-reference.jpg
(assembly detail). Read them when reproducing this look, but translate their
craft to the requested subject rather than copying their props or palette.
The coffee-rig repair is the evidence: a floating lever needed a pedestal;
interior parts needed supports and connected runs; a ring under the scale read
as a detached base; outlined cavities and oversized liquid surfaces looked broken.
| Pass | Any-scene requirement | Translate to the subject |
|---|---|---|
| Structure | Primary mass, supporting assembly, secondary panels/members | trunk/roots/branches; hull/ribs/deck; torso/joints/gear; wall/roof/trim |
| Attachments | Every small part has a visible or explainable seat, joint or support | leaf stem, rope knot, hinge pin, bracket, cuff, axle, strap, fastener |
| Functional detail | Inputs, outputs and working parts connect; contents fit containers | rooted irrigation, connected hoses, docked lines, harness to buckle, wheels to hubs |
| Surface hierarchy | Large readable forms, medium assemblies, sparse microdetails | seams, fittings, latches, bark scars, stitches, labels, scales; not uniform noise |
| Nearby life | 3–6 supporting props in purposeful clusters when space/brief permits | campsite kit; cargo/lifebuoys; books/blanket; tools/materials; tracks/nests |
| Story | At least one specific used/changed detail per hero | wear at contact, repair, folded cloth, spilled contents, missing tile, footprint |
Start with 8–15 meaningful pieces for a small supporting prop and 30–60 for a hero; a complex cutaway may need 100–250+ small pieces across its subsystems. These are planning ranges, not mesh-count acceptance tests. Reuse geometry and materials, merge static siblings only after visibility/animation ownership is settled, measure draw calls/fps and reduce invisible detail before construction. Preserve clear working paths and negative space. "Feels empty" calls for a few related clusters at varied heights, not filling every inch of deck.
Proof before delivery: one whole-scene desktop and phone frame; a 1:1 hero
crop; a cavity/contact crop if relevant; an action strip at known times. Always inspect front, service/back and high angles. Check outline
width and tiny-part legibility; no floating supports, disconnected endpoints,
false residue hoops, filled-in hollows, liquid clipping, or outlines on vapour.
Scan finite vertices, contacts/clearances and moving bounds; check the actual
readout against the frozen time. Keep freeze(t) and reduced-motion support.
Do not call a symbolic cutaway a verified engineering design. Use the existing
QA harness for shared checks, but disable or replace its pixel-palette/dither,
empty-white-paper and fixed-angle assertions for this preset explicitly; do not
silence unrelated failures. Record the preset and which checks apply.
The ten rules below define the default pixel preset, not the optional stroked-toon preset. Approved stroked-toon builds use the explicit overrides above; the remaining scene/animation requirements still hold.
t. No integration that carries state
between frames, no Math.random, no drift across the loop.A blockout with a camera is not a diorama. The difference between a demo and a diorama is three passes, and every hero object has to survive all three.
Apply these three gates to every hero object in every profile and render preset, including educational cutaways. They extend the existing Detail Bar and component manifest; they do not add cast, story-prop or mesh-count quotas to educational scenes. Evidence is the user's report of a quartz watch missing its straps and back; no independent inspection or root-cause diagnosis of that model is claimed here.
Approve the whole-object silhouette, not only the teaching core. Before detail, record whether the commissioned subject is a complete object, a detached mechanism or an explicit permanent section; default to the complete named object. Reference the entire object and its proportions, not just its most interesting subsystem. A complete wristwatch needs its case and both strap/bracelet sides, not merely a dial or quartz movement. Simplify small surface detail before deleting identity-defining masses. Evidence: the reported watch lacked straps despite its watch subject. Test: compare grey whole-object front, side and rear views against recorded references, then review desktop/phone delivery frames with the entire silhouette uncropped. Temporarily hide an essential silhouette assembly (for the watch, either strap side); the review must reject it. A close crop of the core cannot pass this gate.
Construct exterior, rear and attachment chains as real assemblies. An educational explanation of internals does not waive the casing, rear closure, mounting or wearable attachments. Inventory every orbit-exposed side and trace attachments into their seats/joints. For a strapped watch this includes caseback, lugs/spring-bar connections, both strap halves and the reference-appropriate buckle/keeper or clasp; do not impose those exact fittings on a different design. Keep required construction in the model when an explicit Inside mode reveals internals; a label, dark disc or transparency is not a replacement for absent geometry. Honour a commissioned permanent section and document its boundaries. Evidence: the same report named the missing back as well as straps. Test: review opaque front/rear/side/high orbit crops and attachment-seat close-ups; inspect mesh/group mappings and actual contact/clearance at joints. Exercise cold load → Inside on/off (if present) → Reset to check restoration. Hide the rear closure or disconnect an attachment in a test copy; the matching presence/connection check and visual review must reject it. Existing motion and non-penetration tests still apply; presence alone does not prove sound mechanics.
Close an explicit completeness matrix before claiming completion. Fill
the matching DESIGN sheet before modelling and reconcile it against the built
scene before delivery. Give each expected silhouette, exterior/rear, attachment
and functional/internal assembly a stable ID, reference or stated assumption,
required/simplified/omitted status with scope rationale, mesh/group mapping,
connection and proof view plus actual test result. An omission note alone cannot
waive an essential part of the commissioned whole object; build it or obtain an
explicit scope change. Evidence: the reported missing straps/back show why
subsystem detail cannot stand in for whole-object coverage. Test: reconcile
every expected row with nonempty live geometry and reviewed proof; check that
the inventory itself covers the whole reference, not just existing meshes.
Deliberately remove a required row's mesh, leave its proof blank, and add an
unexplained omission in test copies; each must fail the audit. Store commands,
results and proof paths in qa/report.json. Missing evidence is UNVERIFIED,
a missing required assembly is FAIL, and either blocks a completeness pass.
This matrix makes omissions reviewable; it is not automatic certification or
a guarantee that future agents will comply.
The numbers below are reference density from The Hollow Toll, a 21 x 14 m slab with four towers, two gate guns, five species, 42 units, one boss, 527 events and 183 shots. Treat them as a calibration target, not a cap.
| Element | Minimum visible assemblies | Hero target | Required story detail |
|---|---|---|---|
| Tower | 6 | 25 to 45 parts | crew, ammo, livery, wear |
| Creature | 8 | 12 to 20 parts; boss 40 to 60 | gear, scar, trophy |
| Prop | 5 | 8 to 15 parts | contents, tool, repair, rag |
| Landmark | 8 | 30 to 60 parts | one unmistakable silhouette |
| Death | 3 stages | 5 to 8 pieces + stain + soul | species-specific debris |
| Environment | 3 scale cues, 3 story props | 2 ambient loops | a before/after trace |
In a social diorama, read the Death row as Exit: a role-specific departure (turn, walk out, shutter down) with the prop and no debris. The five layers are unchanged; the residue is the changed place, not a stain.
An object can hold two roles. A lighthouse that is also a beam tower gets the landmark budget for its structure plus the machine's moving parts; list both rows in the design sheet. A boss weapon is a separate group: budget 8 to 12 parts for the weapon on top of the body, and say so, or the body will be blamed for a thin haft.
Primitive discipline. No naked box, sphere or cylinder at hero scale. A box gets a chamfer, a frame, plank divisions or a band. A sphere becomes a skull, bale, sack or head with a snout, ties or a neck. A cylinder gets a foot, cap, taper or iron rings. If a shape is still a primitive after the detail pass, it will read as a rock, a blob or a placeholder at 30 to 45 px.
Two to four palette entries per object, plus one accent. More entries turns into noise after the palette snap; fewer turns into a silhouette cut-out. Use value contrast for construction and hue for story.
Detail lives on every orbit-exposed surface. All presets need coherent backs, construction, attachments and cavities; a fixed hero shot is not permission to omit parts. Hidden internals may be simplified only if outside the mechanism manifest. Do not add detail under about 1.5 screen pixels at the delivery view: it aliases into speckle, not craft.
Every prop must touch the ground. Feet, wheels, a base, a contact shadow, a stain. A prop hovering by two centimetres is the single most common "it looks cheap" report. Check the shadow and the lowest vertex, not the group origin.
Every landmark must be the only one of its silhouette. Two skull trees, two red tents or two identical towers read as duplication, not composition. Move, scale or redesign the second one. Check overlap by projecting both bounding boxes to screen: if they merge into one blob, one is invisible detail.
Clear thresholds. Keep at least 2 m of empty ground in front of a gate, portal, spawn mouth or door. No crates, barrels, boulders, bones, vines or rising smoke in that pocket. A grey billboard above an arch reads as a rock flying out of the entrance even when it is transparent.
An actor is animated when it has all five of these, not just a walk cycle:
Background actors need 1, 2 and 5. Hero actors need all five. A tower is an actor too: idle hum, aim, fire, recoil, reload. A service actor's action is order/pay/receive, its reaction is a look-up or step-back, and its exit is the walk-out with the prop. A prop with a moving part (door, flag, wheel, pulley, cauldron) needs its own loop.
Motion is data. Author beats as absolute times or travel distances, then
read them at t. Do not hide a state machine inside render-frame conditionals;
it will pop on a seek, drift on a loop, and be impossible to screenshot.
Nothing at hero scale is static. A tower that spawns a projectile from its centre without recoil, a boss that stands at a door without touching it, a creature that slides without a step: all read as unfinished, even with good geometry.
| Knob | Value | Why |
|---|---|---|
| Camera | fov 20.5, az 45, elev 33 | long lens, near-ortho miniature |
| Framing | fillX 0.84–0.94, fillY 0.86–0.94 |
fit margin only: slab plus landmark tops |
| Subject scale | 1.0, or 0.70 for 30% smaller |
post-fit camera multiplier; never geometry |
| Camera distance | solved, 5 to 300 | bisection; actual distance = fit / subjectScale |
| Post buffer | 1× CSS; 1.2–1.5× for a small subject; 2× faces | extra detail without resizing the diorama |
| Palette | 64 entries (any N, but the shader array and loop must match) | skin, stone, asphalt, glass, livery, props |
| Dither | d*(0.0012 + 0.019*gate) + sparkle*0.0012 |
stipple in ramps only; gate = edge |
| Ink | smoothstep(0.13,0.34,edge), mix 0.62 |
outline without scribble |
| Palette tie-break | secondD-bestD < 0.0005 → lighter |
flat surfaces come out flat |
| Sun | 0xfff8ee at 3.3, hemi 0.24, fill 0.46, env 0.18 |
hard shadows, cool fill |
| Shadow cam | ±13, near 4, far 70, 2048 map, bias -0.00022 | tight around the whole slab, no acne |
| Figure | 1.69 m, hip 0.86, head 0.584 | toy proportions that read |
| Car | L 4.4, W 1.86, belt 0.90, roof 1.44 | door 1.30, leaf sits between 0.34 and 0.90 |
| Scooter | wheel r 0.26, board 0.30, seat 0.83, bars 1.06 | boots and hands land on built surfaces |
| Loop | 41 to 47 s | one robbery beat plus police, and a quiet seam |
The table mixes two different kinds of number, and treating them alike is how a new subject comes out wrong.
Pixel-preset invariants. The camera/palette/post values here belong to the
pixel look, not approved stroked-toon builds. They hold on every pixel subject: azimuth 45,
elevation 33, fov 20.5; one deterministic reset hero pose for QA plus user orbit; palette discipline
(every material samples a palette entry, the shader array length equals the
palette length); gated dither, ink at 0.13/0.34 mixed 0.62, the palette tie-break;
the rig's proportions and joint signs; 2048 shadow map with a frustum tight to
the slab; everything a pure function of t.
Calibrated. Measured against one subject and only evidence for it: palette
count (64 for the bank job, 66 here), buffer size and renderScale (1×/1.25×/2×),
fillX/fillY, subjectScale and the camera size divisor, slab dimensions
and deck height,
loop length, sun and hemisphere intensities, and every prop dimension in the
vehicle and scooter rows. Re-derive these per build: start from the value, then
look at a screenshot and change it.
A scene may change any calibrated number if the subject needs it; change the
template and DESIGN.md in the same edit and record the reason. A template that
silently uses a 2x different sun is worse than no template, because the next
reader trusts it.
Each step ends in something you can look at. Settle the render preset through the
Render Preset Gate before step 1 — one question at project start, not a mid-build
decision. In a confirmed stroked-toon or pixel-stroke build, steps 1–4 use the
authored colour family, fitted long-lens camera, toon lighting and
templates/stroked-toon.js recipe instead of pixel snap/dither/Sobel post. Steps
5–10 still apply; use preset-aware QA.
palette.js plus a named C map.
Every material samples a palette hex, nothing else. Done when a grep for
colour literals in materials.js finds only palette names.templates/camera.js, slab sized so
its projected diamond leaves a margin. Done when a grey slab shot has roughly
25 to 40 percent white around it at subjectScale: 1.0; for a smaller subject,
apply subjectScale after the fit and expect more paper, not a smaller set.updateProjectionMatrix() after changing the frustum. Done when every
figure has a readable contact shadow (crisp by day, a soft pool by night).templates/post.js: gamma, grade, ink, gated dither, palette
snap, rim dither. Done when a 1:1 crop shows square pixels and a dark contour,
and flat pavement shows no speckle.templates/peopleModel.js (base) or templates/peopleModel-street.js
(clothed) rig, one entry per figure with a base pose. Done when isolated portraits show no gaps, no floating parts, knees
bending the right way.qa/audit.mjs for seams/glows/fades,
camera/render scale, exits and emitters, desktop/iPad/phone, file:// standalone,
zero page errors, motion and camera proven from numbers and strips. See
Verification.A new subject is not a new pile of props. Before modelling, fill this sheet.
Copy templates/DESIGN.md into the project and keep it in sync with the code.
PREMISE
[place] + [a repeated verb/ritual] + [who or what interrupts it] + [payoff].
One sentence. If it has no verb, it is a shelf model, not a diorama.
CAMERA SIDE
Which face is +Z? Where is the threshold, the hero tower, the foreground prop?
Which silhouette must never be occluded from this angle?
CAST SHEET
role | silhouette feature | locomotion | action | reaction | exit/death | signature
...
SYSTEM SHEET
loop length | three or four systems | crew | three or four visitor roles |
goal/disruption (optional) | economy/score (optional) | what changes
BEAT SHEET (absolute seconds)
0.0 establish / portal / doors
... first signal, first system output, first consequence
... disruption reaches the goal (or the last customer arrives)
... contact / handoff / finale, residue, loop seam
DETAIL BUDGET
systems n x parts | vehicles n | creatures/people n | props n | landmark n |
exits/deaths n | ambient loops n | triangle / draw-call ceiling
Rules that keep a new subject from becoming a blockout:
totem, hayCart, gatehouse, troll, not
prop12. Unnamed objects become clutter because nobody owns their silhouette.The Hollow Toll shipped at this density. Use it to calibrate a new subject; a smaller subject should have fewer objects at the same detail per object, not fewer details per object.
| Measure | Value |
|---|---|
| Slab | 21 x 14 x 0.42 m, 64-colour palette |
| Towers | 4 + 2 gate cannons |
| Species | 5 (goblin, orc, slime + split, bat/imp, troll) |
| Units | 42, one boss |
| Combat events | 527 |
| Tower shots | 183 |
| Scene meshes | ~3,100 |
| Triangles | ~164,000 |
| Scene draw calls | ~1,700 at 1440 x 900 |
| Textures | 5 |
| Loop / sim | 46.0 s at 40 Hz pre-sim |
| Standalone | ~783 kB with three.js inlined |
A 12 x 9 m scene with two towers and three species should land around 1,000 to 1,600 meshes and 60 to 100k triangles. Raw count is not the goal; the detail per hero object and the number of readable beats are.
This is the reference build the numbers above come from. Read it as a calibration of what "finished" looks like, not as a scene to copy.
Fixes that became rules in this file:
| Report | Root cause | Rule |
|---|---|---|
| "rocks flying out of the entrance" | camp smoke billboards above the portal | clear the threshold of smoke, props and fireflies |
| troll inside the gatehouse | stop at length - 1.05, body through wall |
stop at body depth + weapon reach; keep the door visible |
| club looked like a rock | end-on pose, haft hidden, no bands | yaw 0.35 rad, build haft + bands + studs, sync contact |
| beam had a black segment | black backing plate in the additive beam texture | clear the canvas; transparent gaps, never black |
| deaths were spheres/rocks | generic burst | species collapse + debris + dropped gear + residue |
| skull tree looked like a monster | a second totem overlapped the tree | one landmark per silhouette; mount the skull on a board |
| cart looked like a blob | pale spheres in an open box | five-part prop: bed, slats, wheels, load, tools, story |
standalone broke over file:// |
String.replace expanded $& in the bundle |
function replacer; test the standalone |
A new subject should copy the density and audit discipline, not these nouns. A lighthouse, market or launch pad needs the same number of readable systems, the same five animation layers and the same proof frames.
The social-scene calibration: no combat, no boss, no deaths. A food truck, a queue, a courier, one scooter and a cat. It proves the same discipline applies to a life scene.
subjectScale: 0.70
after the fit (distance = fit / 0.70), not scaling the slab, cast or canvas;
geometry scaling breaks the world clip and shadow maps, and shrinking the
canvas breaks the 1:1 crops. Backing buffer 2x CSS for the faces, CSS
downscale.Fixes that became rules in this file:
| Report | Root cause | Rule |
|---|---|---|
| "the building bottom/right is cut" | slab edge/backdrop closed too tight | close side walls and undersides; camera fit includes the slab corners |
| "bike lights look unnatural" | large additive disc | emissive lens + small halo; cone only at night |
| "doesn't put the box on the bike" | prop teleported from hands to crate | carry in world space from wrists; lower over the rim; release with a beat |
| "doesn't sit on the bike naturally" | car seat/root constants reused | measure scooter seat; board for the left boot; abduction swing; bars to hands |
| "the human/cat doesn't look human" | sphere head, cap at theta 1.85 | skull+jaw head, hair cap 1.22, ears/brow/lids, tapered limbs |
| "carry the bags more human-like" | prop at root, hands nearby | two-hand hold at the prop's top, object origin at its bottom |
| "no text outside the diorama" | DOM overlay on the paper | empty-paper rule; copy on modelled signs only |
| "30% smaller" | scaling the scene | move the camera; keep world clipping and shadow scale |
| "leg swings over the handlebar" | hip X flexion for a side mount | abduct with hip Z; knee tucked; root arc 0.1–0.2 m |
| "single human slides near the shop" | standing gesture blended during walk | gate gestures on !state.moving; serve after arrival |
A new subject should copy the timing discipline and contact logs, not the food truck. A pool, a station or a bakery needs the same queue/service, carry/load and close-up proof.
templates/post.js renders the scene to an offscreen target, then a full-screen
shader turns it into pixel art. Order matters; each stage assumes the last.
mix(vec3(1.0), c, smoothstep(0.26, 0.72, cov)).c = pow(c, 1/2.2). The target is linear; skip this and the frame is
dark and muddy, which reads as a lighting bug.edge = max(abs(d)), brought to display
scale with pow(edge, 0.4545), then
ink = smoothstep(0.13,0.34,edge) * smoothstep(0.20,0.55,cov) * (1 - smoothstep(0.86,0.985,cov))
mixed 0.62 toward vec3(0.085,0.082,0.076).d = bayer8(gl_FragCoord.xy) - 0.5,
gate = smoothstep(0.004,0.055,edge),
c += (d*(0.0012 + 0.019*gate) + sparkle*0.0012) * uDither. Keep uDither as a
uniform: it is the fastest way to prove whether a speckle is the dither.(1.0, 1.12, 0.93) so
greens do not beat skin. Keep the runner-up and break near-ties toward the
lighter entry, or a surface halfway between two entries flips entry per pixel
on the dither noise and stipples a whole pavement.The palette length is a shader constant: uniform vec3 uPalette[N] in the
fragment source and the JS array must be the same length. A mismatch loses the
last colours or reads out of bounds, and the symptom is a colour that "does not
exist in the palette" appearing on screen.
| Symptom | Cause | Fix |
|---|---|---|
| Water looks like TV static | dither ungated | add the edge gate |
| Frame dark and muddy | missing gamma | pow(c, 1/2.2) before grade |
| Everything mid-grey | no grade before snap | saturate 1.07, contrast 1.028 |
| Scribble outlines | ink threshold too low | 0.13 / 0.34 |
| Missing outline on figures | rim suppression too wide | narrow to 0.86 / 0.985 |
| White speckle on flat deck | material grain aliasing | cut grain, not resolution |
| Bands with hard edges | palette hole | add 4 to 6 intermediate entries |
| Speckle only where a tone sits between entries | palette tie | break near-ties toward lighter |
| Speckle at zero dither | sub-pixel geometry | widen detail to ~1.5 px or delete it |
| Beam goes flat or vanishes on paper | additive white over white | saturated palette core + dark halo; fade before the edge |
| Glow disappears after the snap | sub-pixel or pure-white FX | widen to 2 px+, use a palette entry, add a contour |
| Beam ends in a hard vertical cut | world clip plane on a read-through FX | taper intensity to zero before the slab edge |
| Flame reads as a grey smudge | normal-alpha smoke over a bright source | lighten/remove smoke in the flame corridor, draw flame last |
Isolate noise in this order and stop at the first that removes it: dither
uniform to 0 → widen or delete sub-pixel geometry → disable shadowMap. Judge on
a 1:1 crop; a downscaled preview softens all three into "texture".
Default: setSize renders one target pixel per CSS pixel, capped by maxDim
(1600), and CSS image-rendering: pixelated handles the upscale. The chunky
look comes from the palette snap and the ink, not from a low buffer.
When the diorama is deliberately small on the page (subjectScale under ~0.8),
raise the buffer a little instead of enlarging the subject:
new PixelPost(renderer, 2000, 1.25) renders 1.25 target pixels per CSS pixel;
at a 1312 × 760 CSS canvas that is a 1640 × 950 buffer, CSS still 1312 × 760.
The post pass quantises at the finer grid and the browser downsamples; the page
size, camera solve, slab and clip do not move. 1.2–1.5× is the useful range; 2×
on a full arena is usually a frame-rate tax, not more art. Log post.size and
canvas.getBoundingClientRect() and check a 1:1 crop for shimmer.
For faces and close-up contact beats, use renderScale: 2 and
image-rendering: auto (not pixelated), with maxDim high enough (2400) to
avoid the cap. The post pass still quantises at 2×; the CSS downscale is a clean
box filter, not a change to the art. Keep the CSS size as the layout size so the
camera solve and the 1:1 QA crops stay comparable. Re-run the portraits after
any resolution change: raising the buffer exposes hats, stripes and noses that
hid at the old grid.
CAMERA = { fov: 20.5, azimuth: 45°, elevation: 33°, target: (0,-0.15,0),
fillX: 0.84, fillY: 0.86,
subjectScale: 1.0 } // 0.70 = 30% smaller, more paper
The distance is solved, not typed: build a direction vector from the angles,
project each fit point (slab corners at deck and underside, plus the tallest
building corners) into camera axes, and bisect the distance until every point's
|x|/(depth*tan*aspect) and |y|/(depth*tan) fit inside fillX and
fillY. 48 iterations is plenty. fillX/fillY are the fit margin, not the
page-size control; tune them together, because raising one alone crops the other
axis on a portrait phone.
Subject scale is a second, post-fit move. Solve the fit first, then pull the camera back:
const fit = solveDistance(aspect, points);
const scale = CAMERA.subjectScale ?? 1;
const distance = fit / Math.max(0.1, scale);
camera.userData.fitDistance = fit;
camera.userData.subjectScale = scale;
camera.userData.distance = distance;
subjectScale: 0.70 renders the diorama at 70% width/height — 30% smaller
linearly and about 49% less screen area — so the paper margin grows. 1.0 is the
fitted size. Keep the slab, cast, world clip, shadow camera, CSS canvas and
frame at full size; raise the backing buffer only with renderScale (next
section), never by scaling geometry. Shrinking the geometry also shrinks contact
shadows and the clip volume; shrinking the frame/canvas changes the 1:1 crop
and does not change the model's scale. Move the camera.
A phone is already height-limited, so 0.70 can make the trucks unreadable. Try 0.70, then 0.80–0.90 if needed; the scale is per scene, not a universal 30%.
Verification. Log both distances and assert
actualDistance ≈ fitDistance / subjectScale within 2%. Also project the slab
and compare its width to the fitted width: the ratio must be the scale, not just
the distance. On Dust Kings at 1.73 aspect: fit 67.93, scale 0.70, actual 97.05;
projected slab width 872 → 611 px (0.70), with slab, clip and shadows unchanged.
updateCamera(camera, aspect) on every resize and orientation change, with a
debounced call after orientationchange. A canvas measured at under 2 px is a
layout race: return early rather than dividing by zero.
groundY(x,z) returns street, pavement or step height
so every track and shadow samples the same function.Night is a new light ratio and a new palette, not the day rig dimmed. The sun table is a daylight default; a 2am scene needs its own numbers and its own test.
| Key | Night default | Why |
|---|---|---|
| moon / key | 0x93a7c4 at 0.45 to 0.65 |
cool, low, soft shadows |
| hemisphere | sky 0x1b2740, ground 0x090b12, 0.16 |
blue ambient, never black |
| fill | 0x6d7f9e at 0.10 to 0.16 |
keeps the shadow side readable |
| practical | 0xffb066 at 1.0 to 1.4 |
warm bulb/lamp, 2700 K |
| pool | unlit radial plane, opacity 0.28 to 0.45 | light on the ground, cheap |
| headlight | 0xfff0c8, lens + cone + floor ellipse |
source, throw and landing |
0x000000 is forbidden, as in daylight.0x0b1020, keep warm
highlights from clipping. Test a 1:1 crop: three dark values, a visible source,
a readable pool, no white blob.A night scene passes when the unlit areas still have shape and the light sources are in the frame. "It is dark" is not a pass.
The +Z street convention is for an exterior. If the hero action is inside a shop and the street is between the camera and the hero, the bus/traffic will occlude the beat. Choose one:
For glazing, build the frame, mullions, sill and a few reflection streaks. Do not lay one transparent plane across the opening: it tints the interior, hides the practical lights and turns the cutaway into a fish tank. If the bus must read through the glass, give it lit windows and a dark body against the warm interior; do not brighten the whole room to compensate.
Detail is a hierarchy, not a texture. Build in this order and stop adding when the silhouette is explained.
Every readable prop answers five questions with geometry:
A hay cart from the reference build: bed, six side slats, two spoked wheels with iron tyres, four corner straps, three tied bales, loose straw, pitchfork, sack, red rag, two draft shafts. That is ten assemblies for a prop the user sees for two seconds. A crate with a pale sphere inside is none of them.
A defence tower is a small building, a machine and a crew in one silhouette.
| Layer | What it adds | Failure if missing |
|---|---|---|
| 1 foundation | plinth, steps, rubble, contact | tower floats or looks pasted on |
| 2 shaft | taper, buttresses, bands, ladder | reads as a cylinder |
| 3 platform | deck, rail, hatch, brackets | machine has nowhere to stand |
| 4 machine | weapon, pivot, rail, recoil travel | attack has no origin |
| 5 crew | gunner, cranks, spotter, ammo | tower feels automated/empty |
| 6 livery | banner, number, pennant, paint | tower has no owner |
| 7 wear | scorch, chips, rope, spent cases | tower looks unplaced |
The animation pivot belongs to layer 4. The muzzle or launch point belongs to the weapon, never the tower centre. Recoil travel is 0.1 to 0.25 m for a ballista or cannon, 0.02 to 0.06 for a beam crystal. A tower with no recoil, no crew and no ammo is a monument.
A hollow object must show its opening. A cannon with a solid brass cap is a baton, not a gun; the same failure turns a pipe into a rod, a chimney into a post, a lamp into a mushroom and a tunnel into a painted arch. Build the opening as geometry, not a dark decal:
DoubleSide on a cloned material, never on the shared palette
material);At 1:1 the opening needs a dark centre at least 5 to 6 px across and a lit lip. If the centre is brass, the hole failed.
A rotating assembly owns only its moving parts. The yaw/turret group may contain the carriage, barrel, recoil slide and muzzle. Fixed stores — powder keg, shot pile, rammer, tools, ready rack, crew — belong to a static group on the tower root, never the yaw group. If they are children of the yaw group they sweep around the tower when it tracks a target, which reads as the whole gun deck rotating.
Do not simply reparent the props at deck height: the barrel and carriage sweep through that volume at some yaw. Put them outside both the yaw sweep and the barrel's vertical arc. If the deck has no clear sector, bolt a ready locker to the outer wall below the deck: shelf, two iron brackets, powder chest with corner straps, shot tray, and a rammer hung on two hooks. It reads as part of the tower and never collides.
Test two ways at minimum and maximum yaw: each fixed child's world position delta must be 0, and each fixed mesh's world bounding box must not intersect any mesh under the yaw group. Both checks pass, or the station is still in the arc.
Worked example, Bombard Bastion: 17 fixed parts — shelf, two iron brackets, powder chest, lid, two corner straps, rope handle, shot tray, tray lip, three iron shot, rammer shaft, iron cap and two wall hooks. It sits at y 1.1 to 1.6 on the outer shaft, below the deck and outside the barrel arc. At both yaw extremes all 17 world positions are identical and the station has zero bounding-box hits against the yaw group.
A creature needs a silhouette feature before it needs a face.
The boss gets 40 to 60 parts and one signature weapon. Build the weapon as a separate group with a haft, head, bands, studs or spikes, and a hand attachment. A stone head with no haft reads as a rock floating at the door.
A cat is not a small human on all fours. Build a horizontal spine and four contact legs; the silhouette is the back line, ears and tail.
Shoot the cat at 1:1 in profile, three-quarter and sitting. If it reads as a rabbit, the ears are too long; if it reads as a dog, the muzzle is too broad and the back line too straight. No gear, no trophy, no human jacket.
Before the animation pass, inspect each hero object at 1:1 and answer:
If any answer is no, fix the object before animating it. Animation multiplies detail; it does not create it.
A 1.69 m figure built from primitives, with an anatomical group per joint so limbs overlap when they bend. Faces +Z.
| Constant | Value | Notes |
|---|---|---|
| hipY | 0.86 | pelvis group height above the root |
| hipX | 0.10 | half stance width |
| thigh | 0.42 | hip to knee |
| shin | 0.40 | knee to ankle |
| shoulderY | 0.415 | above the pelvis |
| shoulderX | 0.182 | half shoulder width |
| upperArm | 0.30 | shoulder to elbow |
| foreArm | 0.27 | elbow to wrist |
| headY | 0.584 | neck to head group |
The base swimwear rig uses two spheres (cranium 0.115, jaw 0.089) plus a nose box. For a clothed cast, replace that with the skull/jaw/cheek head below. Torso and pelvis are lathes (0.135→0.198 and 0.105→0.180), flattened 0.72 in Z so the body is an oval, not a tube.
Construction rules:
Pose API: setPose(person, pose), easePose(p, pose, 1-exp(-22*dt)),
blendPose(a, b) (component-wise add). Angles are [x,y,z] radians per joint:
torso, head, shoulderL/R, elbowL/R, wristL/R, hipL/R, kneeL/R, ankleL/R,
optional pelvis.
Sign conventions, get these right once:
Detail that pays, in order: the skull/jaw head in Clothed Cast (hair cap theta 1.22, eyes at ±0.037, 0.110, 0.101); cap as a crown cylinder, band and brim; brow and lid creases; a narrow nose bridge; a three-layer mouth; ears as flattened spheres; hands as a palm plus a finger block and thumb; feet with a toe box. Fingers, nostrils and micro-seams do not survive 30 px.
Balaclava: one sphere shell over cranium and jaw (r 0.134, scale 1.0/1.10/0.99)
plus a neck gaiter cylinder running into the collar. A cover cut at the equator
leaves a band of skin under the hem that reads as a bare head, and eye openings
tucked under the shell disappear: put pale lids a few millimetres proud of it. A
darker skin material is skin.clone() with color.multiplyScalar(0.86).
The skeleton is shared; the person is made by the head, the garment silhouette
and the hand contact. For a clothed cast, start from
templates/peopleModel-street.js; templates/peopleModel.js remains the
swimwear/aquatic variant.
Head. A skull plus a jaw, not two stacked balls.
thetaLength 1.22, positioned at y 0.132 and stopping
at the hairline. A 1.85 cap swallows the forehead and reads as a helmet. Add a
back mass, sideburns, and for a bun a high sphere at y 0.204. Under a hat show
a nape tuft; under a full helmet show none.Clothing is geometry, not paint.
topK 1.0 tee, 1.05 jacket, 1.12
puffer), plus a hem/waistband cylinder. The garment must have a thickness step
at the cuff, collar and hem or it reads as body paint.Hands are the contact proof. Palm box 0.070 x 0.078 x 0.054, a finger block with two grooves and a thumb capsule. A glove is the same geometry in glove material, with a cuff. When a hand holds something, the palm and finger block must touch it; a wrist near a handle is not a hold.
If the head or the clothing is wrong, fix it before the walk. A good gait cannot rescue a sphere head or a painted jacket.
Every motion is a pure function of t or of a distance along a track.
const swing = Math.sin(phase), cs = Math.cos(phase);
const kneeL = 0.05 + 0.46*Math.max(0,-cs) + 0.22*Math.max(0, swing);
const kneeR = 0.05 + 0.46*Math.max(0, cs) + 0.22*Math.max(0,-swing);
pose = {
torso: [lean, swing*0.05, 0],
shoulderL: [-swing*arm, 0, -0.09], shoulderR: [swing*arm, 0, 0.09],
elbowL: [-0.16 - Math.max(0, swing)*0.28, 0, 0],
elbowR: [-0.16 - Math.max(0,-swing)*0.28, 0, 0],
hipL: [swing*amp, 0, 0.03], hipR: [-swing*amp, 0, -0.03],
kneeL: [kneeL,0,0], kneeR: [kneeR,0,0],
ankleL: [-kneeL*0.32,0,0], ankleR: [-kneeR*0.32,0,0],
};
footTravel = 2*legLength*sin(amp),
speed = footTravel * phaseRate / PI. A 0.86 leg at 0.34 rad and 5.2 rad/s is
about 0.9 m/s. Drive phase from distance travelled, not from time, and the
walk always matches the path.groundY heights
smoothed by three 1-2-1 passes, so steps read as ramps. at(d) returns
position and heading.const declared in one branch and read in another throws every frame and
freezes the figure. Pose targets are full poses, not deltas.T,
vy = (landY - launchY + 4.9*T*T)/T. A guessed vy either lands late or
stops in mid-air.C with p' = p + C - R*C, C about 0.55 up.These are the beats closest to the camera and the ones users report first. A prop that teleports, a hand that misses it, or a leg that swings through the handlebars destroys the whole miniature.
Carry. Keep the prop in world space and solve its transform from the hands every frame; do not parent a big prop to a wrist group (it inherits the wrist roll and swims).
const hl = new THREE.Vector3(), hr = new THREE.Vector3();
J.wristL.getWorldPosition(hl); J.wristR.getWorldPosition(hr);
const mid = hl.clone().add(hr).multiplyScalar(0.5);
bag.position.set(mid.x, Math.min(hl.y, hr.y) - 0.42, mid.z);
Loading into a crate or hatch.
Never translate the prop from hands to slot in one frame, and never let it descend outside the crate wall. A bungee or lid that intersects the prop on the way in must animate open and closed; hiding it for the whole beat reads as a missing part.
Mounting a scooter, bike or horse.
Author the mount in the vehicle's local frame, from a measured seat/board, not by eye.
Proof. A nine-frame side strip at 0.15 to 0.25 s spacing: approach, lift, over-rim, lower, release, step, leg-swing, seat contact, ride. Shoot it at 1:1 and log wrists, ankles, prop base and seat. A still cannot prove a mount.
The character section above covers body mechanics. This section covers the
systems that carry a diorama: towers, projectiles, reactions, deaths,
bosses, crowds and secondary motion. Every one is a pure function of t, driven
by a pre-simulated event list.
| Layer | Driver | Typical period | Use |
|---|---|---|---|
| ambient | sin(t*f + phase) |
1.5 to 5 s | breath, flame, flag, scan |
| locomotion | distance along a path | stride length | walk, fly, hop, slither |
| action | absolute event time | 0.3 to 1.2 s | fire, swing, slam, dive |
| reaction | event time + direction | 0.15 to 0.5 s | flinch, flash, knockback |
| death | absolute death time | 0.6 to 1.4 s | collapse, debris, residue |
If an action and a reaction share a clock, derive both from the same event timestamp. Two independent cycles will drift apart even if they match on the frame you happened to inspect.
const DT = 1 / 40;
const LOOP = 46.0;
const pulse = (t, t0, tau) => (t < t0 ? 0 : Math.exp(-(t - t0) / tau));
const win = (t, t0, dur) => clamp((t - t0) / dur, 0, 1);
const easeOutCubic = (u) => 1 - Math.pow(1 - u, 3);
const spring = (t, t0, freq = 9, damp = 6) => {
const a = t - t0;
return a < 0 ? 0 : Math.exp(-damp * a) * Math.cos(freq * a);
};
Run the battle at DT from 0 to LOOP once at load. Store:
events.push({ t, kind: 'shot', tower, target, from, to, flight, damage });
events.push({ t, kind: 'impact', x, y, z, species, dir });
events.push({ t, kind: 'death', id, type, x, y, z, t });
events.push({ t, kind: 'gate', x, y, z, hit: n });
The render loop reads the events whose time has passed. It never re-simulates
and never carries state between frames. ?t=12.4 freezes the whole system,
including effects, so every QA shot is reproducible.
A tower attack needs five visible stages. Cut one and the tower reads as a spawner, not a weapon.
| Stage | What the player sees | Time |
|---|---|---|
| acquire | head/turret turns; crew leans; crystal brightens | 0.15 to 0.4 s |
| wind-up | rail pulls back, arm cocks, coil charges, barrel vents | 0.1 to 0.35 s |
| release | muzzle flash, string snap, beam origin flare, arc jump | 1 to 2 frames |
| travel | bolt, ball, beam, chain, projectile with trail | 0.05 to 0.6 s |
| impact | flash on target, dust/goo/ice/feathers, ring | 0.1 to 0.25 s |
| recovery | recoil returns, crew resets, smoke clears | 0.2 to 0.5 s |
Tower archetypes:
theta(t), add a short dwell window when a target crosses the
beam, and ease in/out of the dwell so the housing never snaps. Fire inside the
dwell; return to the sweep with the same phase it would have had. If the beam
can point into the goal pocket, mask that sector physically (back-screen,
shroud) rather than breaking line of sight with a special case.If the tower has a crew, the crew reacts: brace, pull, cover ears, crank. A crew that stands in the same pose through a cannon shot is a mannequin.
A loom, press, crane, oven, pump or lighthouse lens is not a tower, but it needs the same causality. Replace "attack" with work:
| Stage | What the player sees | Time |
|---|---|---|
| engage | clutch drops, belt tightens, valve opens, lamp housing turns | 0.15 to 0.4 s |
| work | beam sweep, flywheel spin, ram stroke, dough stretch, water flow | 0.3 to 3 s |
| output | light pool, pressed sheet, lifted crate, baked loaf, water rise | 0.1 to 0.5 s |
| settle | flywheel coasts, valve closes, belt slackens, lamp returns | 0.2 to 1 s |
Audit: input (what feeds it), motion (what turns/strokes), output (what changes in the world), residue (waste, heat, crumbs, steam). A machine with a beautiful motion and no output is a kinetic sculpture; give it a product and show the product.
A boss or disaster must act on a goal, not just a door. Pick the response from the goal's material:
| Goal | Contact response | Failure |
|---|---|---|
| door / gate | flash, shake, crack, dust from the lintel | leaf hangs, ward closes |
| valve / pipe | spray, gauge drop, pipe shudder, hiss | pressure falls, lamp starves |
| rope / bridge | slack, sag, strands snap, deck drops | span falls, route closes |
| wall / dam | chip, crack, water seep, block falls | breach, flood |
| tree / mast | bark split, creak, tilt, leaves fall | trunk breaks, canopy drops |
Put the contact point on the silhouette edge of the goal, not buried in its body, and keep it clear of the boss's shoulder/weapon. If the goal is tall, put the contact at chest height and turn the boss 0.3 to 0.4 rad so the weapon shaft crosses the frame. The response and the contact must share the same timestamp.
A projectile that is visible after the target is dead is a bug, not a flourish.
| Archetype | Locomotion | Action | Reaction | Death |
|---|---|---|---|---|
| small scrapper | scamper, 2-beat | quick stab | flinch + skid | cloth, knife, stain |
| brute | heavy walk, shoulder roll | overhead cleaver | stagger, shoulder dip | iron plates, sword, dust |
| slime | squash-hop | lunge | wobble, split | goo splat, two lets |
| flyer | flap, bank, hover | dive | spiral, feather burst | feathers, spiral fall |
| boss | weight shift, slow stride | telegraph + slam | recoil, knee dip | collapse, gear, weapon, soul |
Every creature gets a hit flash on the body material for 0.08 to 0.12 s and a directional flinch opposite the impact. Do not reset the whole pose on a hit; blend a flinch over the current pose and recover.
Death is a sequence, not a switch:
A death that is a sphere burst, a grey puff or a rock shower fails the bar even if the particle count is high.
A boss exists to act on a place, not to have more hit points.
phase = hash(i) * TAU, never one global sin(t).0.9 + i * 0.8 along their own path.Flags, banners, cloth, chains, hanging bones, smoke and fire are the cheapest way to make a static scene feel alive. Rules:
sin(t * f + phase) and a phase offset per object.For every hero actor, capture:
The strip passes when feet plant, knees bend backward, no joint opens a wedge, no part floats, and the silhouette changes between frames. A still cannot prove an animation; a strip can.
A market, hatch, ticket window or bakery is a queue machine: people arrive, advance one slot, order, pay, receive and leave. Build the queue before the props; it is the scene's clock.
Slots. Lay four to six positions along the counter, 0.65 to 0.80 m apart, perpendicular to the hatch. Everyone in the queue shares one lane and one heading; a diagonal queue reads as a crowd, not a line.
const SLOTS = [q0, q1, q2, q3]; // q0 is at the hatch, q3 is the tail
const toSlot = (p, slot) => ({ x: slot.x, z: slot.z });
seg(t0, t1, track) legs: enter →
tail → advance one slot per serve → counter → exit. Keep each leg on its own
track; re-pathing every serve makes feet slide.Customer state machine.
| State | Visible action | Gate |
|---|---|---|
| arrive | walk with distance-driven gait | until slot reached |
| order | point at menu/board, head turns | only when speed = 0 |
| pay | hand to counter / phone | after order, only when still |
| wait | idle, weight shift, phone | until bag lands |
| receive | both hands or one hand out | at bag contact |
| exit | turn, walk out, carry bag | after receive + 0.3 s |
The gate is the whole fix. Never blend a standing gesture (PAY,
POINT_MENU, RECEIVE) into a walking pose. If the gesture has straight legs
and the walk has bent knees, the mix straightens the legs while the root keeps
translating: the figure glides. Compute state.moving from the mover and write:
if (state.moving) pose = walkPose(phase, { amp, arm, carry });
else if (t < orderEnd) pose = mixPose(idle, POINT_MENU, bell(t, order));
else pose = idlePose(t, phase);
Machine slots. A laundromat, workshop or gym uses the same clock with machines in the slots: washer drum → dryer drum → fold table. Advance the batch on the end-of-cycle timestamp, not on a fixed beat, and land the next action 0.25 s after the lid/door closes. A drum that starts tumbling before the door shuts is the machine version of serving before arrival.
Staff side. The cook works the grill; the cashier takes payment and hands the bag across the hatch. Their gestures are independent loops, but the bag's release comes from the cashier's hand position, not a fixed world point. Keep a stack of paper bags at the hatch and decrement it per serve; the last bag is the goal object.
Proof. Freeze the approach every 0.25 s for two strides and log root speed,
moving, hip/shoulder angles and slot. The strip passes when the feet alternate,
the root advances smoothly, no standing gesture appears while moving is true,
and the serve timestamp is after the arrival timestamp.
A vehicle is the prop the user inspects the moment a door opens, so build it to be opened. Model facing +Z.
| Part | Size and place | Note |
|---|---|---|
| floor pan | 1.62 x 0.10 x 4.02 at y 0.35 | dark; its top is the cabin floor |
| rockers | 0.12 x 0.16 x 3.92 at x ±0.87 | stay with the body |
| front fender | 0.10 x 0.56 x 1.05 at z 1.62 | body side ahead of the front door |
| rear quarter | 0.10 x 0.56 x 0.72 at z -1.84 | body side behind the rear door |
| belt moulding | 0.10 x 0.08, one per fixed panel | never one rail across the apertures |
| bulkheads | 1.84 x 0.56 x 0.16 at z ±2.12 | close the tub |
| roof | 1.48 x 0.08 x 1.94 at y 1.44 | drip rails at x ±0.76 |
| pillars | A raked -0.64, B upright, C raked +0.60, 0.075 thick | |
| windscreen | 1.44 x 0.62 x 0.05, rotation.x -0.64 | glass between the A pillars |
| side glass | none | windows down: open holes between the pillars |
Cabin: dash 1.46 x 0.15 x 0.30 at y 1.00 z 0.80; wheel torus r 0.125 at (-0.40, 1.10, 0.68) rotated -0.42; front cushions 0.46 x 0.10 x 0.50 at y 0.57 z 0.30 with backs at z 0.04; rear bench 1.20 wide at z -0.50 with its back at z -0.74.
The windscreen is not a plane at the front of the cabin: rotated -0.64 it sweeps back to about z 0.59 at its base. A front seat at z 0.72 therefore sits inside the glass volume, and every occupant's head prints on the windscreen from every angle. Keep the cushion's front edge at least 0.25 behind the glass base and move the dash, wheel and column back with it.
Doors. Hinge at the shut line, leaf extends backward in -Z: front 1.15 to
-0.15, rear -0.15 to -1.45, leaf 1.30 long and 0.55 high. Pivot at
(side*0.86, 0.62, hingeZ), children are outer skin, inner card, sill strip,
handle, and any livery; rotation.y = -side * open swings it out. Swing 1.28 rad
for a saloon, up to 1.52 for a cruiser. Split every full-length body moulding at
the shut lines: a moulding left on the shell reads as the top of the door left
behind when it opens.
Boot. Pivot at (0, 0.90, -1.46), lid extends -Z, rotation.x = +0.95 lifts
the rear edge. Well floor y 0.44 against a lid underside at 0.89, so cargo must
fit 0.45: bags r 0.165 at y 0.63 (tops 0.80) clear it. Close the boot off from
the cabin with a parcel shelf (1.74 x 0.05 x 0.66 at y 0.86, z -1.10) and a
bulkhead behind the rear seat back (1.74 x 0.46 x 0.06 at y 0.63, z -0.82);
without them the boot is open to the cabin through the rear windows and the load
reads as sitting on the closed lid.
Cargo carries visible = false until it lands and userData.noMerge = true.
A throw needs an object that travels: keep one world-space bag per thrower and arc
it hand → slot with p.y += sin(f*PI)*0.6, switching the slot's bag on when the
flight lands, not at release.
A scooter is not a car with two wheels. Build it around the contact points: two tyres on the ground, a floor pan for the boots, a seat the pelvis can sit on, bars the hands can reach, and a cargo crate whose opening is visible from the camera.
Reference local frame, facing +Z, for a delivery scooter at 1.0 scale:
| Part | Place | Note |
|---|---|---|
| wheels | r 0.26 at z ±0.62 | tyre + hub + fender; both touch y 0 |
| floor pan | 0.60 x 0.04 x 0.30 at y 0.30 | top is the boot surface |
| running boards | 0.12 wide at x ±0.235 | outboard, full length; the left boot lands here |
| body / shield | 0.46 wide, up to y 0.72 | front leg shield, not a box |
| seat | top 0.83 at z -0.18 | measure the cushion top, not the body |
| bars | y 1.06, grips x ±0.33, z 0.52 | raise bars to the rider's hands |
| cargo crate | 0.52 x 0.44 x 0.46, base y 0.86, z -0.56 | open top, interior floor ~0.91 |
| bungees | two cords across the opening | clip open during loading |
seat = local(0, 0.83, -0.18); set the root so the pelvis
mesh contacts the cushion, then prove it in a seated portrait. On the Night
Market scooter that is root y 0.09 against a 0.83 seat; do not copy a
seatY - hipY formula from a chair, because the pelvis mesh hangs below the
hip joint. A copied root puts the rider on the front edge or floating.baseY + 0.01 sits inside. Keep bungees as a separate group so
they can unclip during loading and close over the lid afterwards.Mounting is authored with the sequence in Carrying, Loading And Mounting: left boot on the board, right leg abducted over the saddle, small root arc, pelvis on the seat, hands to the grips. Prove it with the nine-frame side strip.
A bus is a moving room. Its job is a window band, a door, a route sign and a headlight sweep; the chassis is the least visible part.
| Part | Size / place | Note |
|---|---|---|
| body | 9 to 12 m long, 2.5 wide, 3.0 high | one box with a chamfered roof |
| window band | y 1.35 to 2.45, full length | dark glass + warm interior, not a transparent plane |
| door | 1.1 wide, front or centre | step well, grab rail, lit interior |
| wheels | r 0.50, wheelbase 5.5 | two axles; arches cut into the skirt |
| route sign | front above the windscreen | emissive text/colour blocks, readable at 1:1 |
| livery | one band + one number | never a full advertising wrap at this scale |
| headlights | two lenses at y 0.65 | plus cones and a floor ellipse |
| interior | 4 to 6 lit windows + driver silhouette | a dark box with one warm strip reads as a bus |
A bus that reads as a white box with black windows is not finished: the window band, route sign, wheel arches and one warm interior strip are the minimum.
Seat root = cushion top minus hipY, which is -0.38 in car space on this rig: the hips settle into the cushion and a masked head clears the roof with 6 to 8 cm. At -0.18 a hooded head lands about a centimetre under the roof panel and any bob prints a dark pixel on the white roof. Measure against the head mesh, not the head joint, and lower the seat rather than raising the roof, which is pinned to the pillars.
The stand spot is 2.00 m out from the car's centreline and 0.30 behind the hinge for a front seat, 0.55 for a rear:
const exit = toWorld(car, side * 2.00, seatZ - 0.30);
An open leaf hangs in the plane of its hinge, so an exit level with the seat puts shoulders and head through the door skin. 0.30 still sits inside the aperture and leaves room for a torso plus a swinging arm. 2.00 out is about 1.07 of daylight from the flank, and that is not padding: at 45/33 a figure 0.7 off the flank sits wholly inside the car's silhouette with his feet on the rocker line and reads as welded to the body.
The climb is authored in the car's own frame, so it works at any parking
angle. It ships: templates/transfer.js is the whole move (transfer,
climbAt, CLIMB, stepPose, standSpot), and templates/poses.js carries
the four climb poses plus the walk and run cycles it blends between. Copy them,
do not retype them. k runs 0 at the open door to 1 at the seat, dy is the root height
above the seated root, and the pose is a real sequence: stand, reach, crouch in,
sit on the edge, swing the legs in, settle.
const CLIMB = [
{ u: 0.00, k: 0.00, dy: 0.380, pose: STAND },
{ u: 0.16, k: 0.03, dy: 0.330, pose: REACH }, // hand to the roof edge
{ u: 0.36, k: 0.16, dy: 0.120, pose: CROUCH_IN }, // knees deep, hips dropping
{ u: 0.56, k: 0.38, dy: 0.010, pose: SIT_EDGE }, // perched, feet still down
{ u: 0.76, k: 0.66, dy: 0.000, pose: LEGS_IN }, // knees up, feet over the sill
{ u: 0.90, k: 0.88, dy: 0.000, pose: mix(LEGS_IN, SEATED, 0.55) },
{ u: 1.00, k: 1.00, dy: 0.000, pose: SEATED },
];
The transfer wraps that climb: the first STEP_SHARE (0.26) of the window is one
stride from the stand spot to the door, the rest is the climb, and on the way out
the stride away comes last. The body only reaches cushion height once the hips are
over the sill, so nobody sinks, floats or slides through the bodywork. DOOR_STAND_X
1.34, DOOR_STAND_DZ -0.06, durations 1.05 to 1.20 s each way. Never derive the
duration from the next beat's start: under about 0.9 s the whole move reads as a
slide or a blur. Move the following beat later instead.
Facing is the trap. The outward yaw points away from the car, so a figure entering
with it climbs in backwards: body into the seat, face to the street. On the way in
every key before the seated ones faces the car, including the standing key that
gets forgotten. Resolve it from geometry, never from the approach path's tangent:
a path's opening segment runs along the street, so path.at(0).yaw + PI points
down the kerb and lands the figure a right angle off whichever way he arrived.
const faceYaw = car.yaw - side * (PI / 2); // square to the open door
const face = Math.atan2(seat.x - stand.x, seat.z - stand.z); // stand -> seat
// turn to the windscreen only once the hips are on the cushion
const turn = smooth(clamp((v - 0.62) / 0.30, 0, 1));
yaw = lerpAngle(faceYaw, car.yaw, turn);
Staging rules that came out of real reports:
v.project(camera) and compare pixels
before concluding they are spaced.0.9 + i*0.8 along his own path, stagger the walk-in windows by 0.25 s, and let
the lead actor alone reach the threshold: the kick, the first step through. Four
men then read as a queue filing in rather than a scrum.Vehicles enter and leave the block, and the slab is a window. Four world-space planes on the renderer for the scene pass, cleared before the post quad:
const CLIP = [
new THREE.Plane(new THREE.Vector3( 1, 0, 0), hx + 0.05),
new THREE.Plane(new THREE.Vector3(-1, 0, 0), hx + 0.05),
new THREE.Plane(new THREE.Vector3( 0, 0, 1), hz + 0.05),
new THREE.Plane(new THREE.Vector3( 0, 0,-1), hz + 0.05),
];
r.clippingPlanes = clipPlanes; r.setRenderTarget(rt); r.render(scene, camera);
r.clippingPlanes = []; // before the full-screen quad
A car entering nose-first shows its own front surfaces at the cut, so the cut
reads clean; one leaving tail-first exposes the cut face, so keep the interior
modelled and it reads as a cutaway. Route every vehicle one way, in at one end of
the street and out at the other, no reversing and no angled parking: an angled
park reads as a collision, and backing in reads as a bug. Two vehicles sharing a
lane need a departure gap (pLeaveGap ~1.15 s) or the far one drives through the
near one.
MeshPhysicalMaterial with vertex colours, not a custom shader, so
it receives shadows. Ramp shallow to deep teal, never to navy: a near-black end
quantises into a hard band the user reads as a hole.(1-k)^2.trigger(x, z, power, burstSeed)), never Math.random: a frozen frame must
reproduce the same burst, and the same frame must reproduce it again after the
clock jumps.reset(). Wake and splash advance by
dt, so jumping the clock to freeze a frame does not jump their state, and the
frozen splash shows whatever the last played frame left behind. Both templates
expose reset(); the harness calls it and re-simulates in fixed steps from
zero, which took a two-frame diff from 334 differing pixels to 18.sin(n*127.1)*43758.5 fractional)
keeps every replay identical.The slab is a window, but not every effect is a solid. Split them:
Every scene effect goes through the palette snap. That is the look, but it punishes sub-pixel tricks:
?dither=0 and at 1:1. If the effect only reads in a downscaled
preview, it is not in the render."Touching the ground" is not one rule:
A diorama is judged on whether the cause and the consequence are both visible at the reset hero camera. Geometry that is correct in world space can still read as a bug on screen. Run these gates before calling a combat beat finished.
Run one row per tower, at the timestamp it fires. A tower that never fires in the loop is scenery, not a defence.
| Check | Pass condition |
|---|---|
| origin | muzzle, rail, crystal or hand is visible and offset from the body |
| wind-up | at least 0.1 s of visible anticipation |
| travel | projectile or beam is traceable across at least 4 frames |
| impact | lands on the target with a species-specific effect |
| recovery | weapon returns; crew resets; no snap to rest |
| count | shots > 0 in the sim stats for this tower |
| no stale | no projectile or beam outlives its target |
If a tower fails "origin", move the spawn point; adding more impact particles will not fix it. If it fails "travel", slow the projectile or widen the trail; a 1-frame hit is a hitscan, which is fine only for a beam.
A support, aura or ground field has no projectile and must not be failed for that. Audit it on five field stages instead:
| Check | Pass condition |
|---|---|
| source | emitter, valve, horn mouth or caster hand is visible |
| area | radius/cone is readable on the deck; no floating ring |
| ramp | effect grows over at least 0.15 s; not an instant decal |
| affect | affected units visibly change (speed, colour, stagger, burn) |
| decay | effect fades/expires on the loop, leaving residue |
| count | events > 0 for this field in the sim stats |
A field that never expires is a lighting change, not an attack.
| Species | Body collapse | Debris | Dropped | Residue |
|---|---|---|---|---|
| goblin | fold forward, knees first | cloth scraps, 2 bone chips | knife or spear | dark stain |
| orc | drop to one knee, then side | 3 iron plates, 2 tusk chips | cleaver or sword | dust + blood |
| slime | flatten, then pop | 6 goo blobs, 1 core | none | glossy splat |
| flyer | spiral, wings fold | 5 feathers, 1 bone | none | feather on ground |
| human / crew | knees, then hat/coat fold | 3 cloth scraps, 1 tool | hat, keys or hook | oil or blood stain |
| boss | knee dip, torso fall, weapon drop | 6 armour plates, 2 horns | club | scorch + rubble |
Every death also gets a 0.2 to 0.4 s additive soul flicker. It is the punctuation that says "this was a creature", not "this was a particle system".
targetId on the beam event
and hide the beam on the frame that id dies.templates/build.mjs bundles src/main.js to dist/app.js with esbuild (IIFE),
writes index.html and a standalone HTML with the bundle inlined, escapes
</script in the payload, and passes the replacement as a function, not a
string. String.replace expands $&, $', $` and $1 inside a string
replacement; a minified bundle routinely contains those sequences, which
silently injects the <script src=...> tag into the middle of the app and
breaks the standalone file. Always test the standalone over file://, not just
the served page. --minify for shipping; expect roughly 780 kB with
three.js inside.
Freeze and seek come free if everything is a function of t:
const params = new URLSearchParams(location.search);
const frozen = params.has('t') ? parseFloat(params.get('t')) : null;
const startAt = params.has('from') ? parseFloat(params.get('from')) : 0;
window.__diorama = { THREE, scene, camera, renderer, post, director, cast,
robbers, cops, mats, TL, CLIP, freeze(t){ frozen = t; draw(t); }, play(){}, view(){} };
?t=12.4 is the whole QA surface: every screenshot and every diagnosis is a
frozen frame, so a screenshot never depends on timing luck.
A build is not finished until these exist. Check them before the summary:
refs/<subject>/ has at least one contact sheet stepped from real footage.refs/SOURCES.md answers the four questions (shape, motion, asset, proof)
with the queries actually run. "Nothing found" is a valid answer only with
the query written down next to it.CREDITS.md has a row per imported asset, and every licence is CC0, CC-BY,
public domain, or owned by the user.A missing SOURCES.md means the research step was skipped, and the scene is
probably wearing the generic version of its genre.
These are the failures that survive a good first render: a finished-looking set with one raw seam, a clean loop with a vehicle that teleports out, or an effect that is technically present but reads as a grey rectangle. Audit them as a system, on every subject.
visible = false, no parking at the gate, no portal. If the
scene uses a clip plane, the mover may be cut by it, but the cut body must
continue moving out; a cut that freezes is the same bug.(±0.66, 3.74, -0.74) * scale on the truck recipe), not
the engine centre, cab roof or a point chosen by eye. Put the tip
in userData during construction and use that same object for the smoke. A
plume that starts above or behind the stack reads as a floating cloud. If a
canopy hides the tip, offset the birth point downstream in the open direction,
not the source anchor; the audit's maxOffset allows that.PlaneGeometry is a light-grey rectangle at the palette snap, especially over
a dark board or wall. Use haloPlane/softDiscTexture from detail.js, a real
emissive lens, or no halo. This is the single most common "what is that
rectangle?" report.templates/qa/audit.mjs runs the mechanical ones; the 1:1 crops remain
human evidence.Animated arrows and flames are how a mechanism explains cause. They fail silently: the build passes, one still looks plausible, and the graphic points backwards or sits inside a solid. Treat every primitive as a tiny part with its own convention test, in every preset.
CylinderGeometry(radiusTop, radiusBottom, ...) points along the top end.
Swapping those two numbers makes every arrow flow backwards while still
looking like an arrow. Build the tip at local +Z, store tipLocal and
tailLocal in userData, and assert: cone base wide and behind, tip a point
ahead, and the placement transform maps +Z onto the requested tangent.depthTest:false, which turns the scene into x-ray. Two honest options only:
cut a real window/section that exposes the gas volume, or place arrows solely
in the genuinely open region (port mouth, chamber, outlet). Keep depth test and
depth write on; assert depthTest === true for effect materials.|dy|·half + flat·head. For a
vertical arrow that is its half length, so clamping only the centre lets the
head pierce the crown or the valve. Compute the extent, reduce the scale until
the band and the bore both fit, then clamp the centre. Judge "bold" by rendered
length (length × scale), not by the scale ratio: a long authored arrow in a
short band is legitimately scaled down and still reads.0.008 under the valve head underside
(seat − 0.061 − lift), span at most 92% of the band, give a compression
chevron its tail on the rising crown (crown + 0.02) so it touches the charge
it describes, and start a force arrow 0.015 inside the flame tip. Author the arrow at its maximum length so scale ≤ 1; otherwise a
non-normalized 1.14 arrow makes the minimum-scale gate and every sizing test
meaningless.+0.024) silently shifts every "absolute" ceiling. Measure the scene in the
same local space the constants were written in; mixing world and local turned a
correct flame into a phantom 24 mm head violation.0.40, halo scale 0.42
and point-light intensity 2.2 are already generous at diorama scale; the
earlier 0.95 / 1.14 / 9.0 blew the whole head to white, and 0.55 / 0.62
still washed the crown orange for two frames. Judge the ignition frame itself,
not the frame after it.0.125 here) and be hidden below 0.12 height. A flame that
fades to a two-pixel dot on the valve seat is the flame equivalent of an arrow
speck, and a mid-stroke still will not show it.0.06 per degree, and hide only when the
final scaled size is below the legible threshold.visible from the final scaled size, not
from the envelope alone, and hide below a legible threshold (about 0.3 of the
authored arrow length at a normal educational-camera distance; 0.22 is only for
very large arrows). Test the fade boundary as well as mid-stroke; a nub reads
as a rendering bug.floor - tip instead of
tip - floor) silently hides every arrow while all numbers stay finite. Assert
the available band is positive wherever a primitive is visible, and fit the
full tip/tail/width inside it.outlineParameters.visible === false and the rendered
colour in a crop.Canonical educational UI and inspection contract;
an explicit Inspect focus is distinct from a camera-stationary lesson step.templates/flow-primitives.js
carries the +Z convention, the band fitter and the legibility gate.These were all present in one finished-looking scene; check for each by name:
radiusTop/radiusBottom) — arrows flowed backwards.depthTest:false.1.14 because the authored length was shorter than
the desired length, defeating the legibility gate. Fix: normalize length.+0.024 root lift). Fix: one declared space.opacity 0.95, scale 1.14, intensity 9.0 blew the
whole head to white for the ignition frame. Fix: capped flash.dist/ in place, and a refused or blocked edit leaves the source
untouched, so in both cases every screenshot shows the old app and the fix
looks like it did not land. Read the build's own output line, grep for a
sentinel string from the change, and only then judge the frame.type: BoxGeometry; a type-name filter produced zero
magnet samples and magnetRadius: 0, falsely passing clearance. Assert expected
object counts, nonempty finite sample sets, positive applicable radii and actual
geometry attributes/topology before measuring; never trust a constructor label
as shape proof. templates/mechanism-contract.mjs assertCoverage and
templates/qa/mechanism-contract.test.mjs cover helper failure detection;
scene probes must additionally inject an empty/type-mismatched sample set,
zero radius and a known actual-geometry overlap and reject each. Record fresh
source/build hash, successful build command, loaded artifact identity, probe
method, counts, tolerances, worst pair/phase and evidence paths in the report.
Failures or missing browser/visual/sweep coverage remain FAIL/UNVERIFIED.
Never infer full mechanical certification from scalar budgets, 26 numerical
highlight states, screenshots alone or a stale successful report. Evidence:
historical quartz-watch/qa/construction-report.json; no workspace dependency.group.rotation.y and compare it with atan2(dx, dz) of the expected facing
vector before re-shooting a facing fix.state.moving, hip/shoulder angles and slot. No
standing gesture may be non-zero while speed is non-zero; the leg angles must
alternate; serve must be at least 0.25 s after arrival.actualDistance / fitDistance ≈ 1 / subjectScale, the projected slab width fell
by the same factor, post.size ≈ CSS size × renderScale (capped), the
slab/world clip/shadow camera and CSS frame are unchanged, and the standalone
still frames on the page.visible. getWorldPosition on a merge-eaten object returns local coordinates
because the original was unparented; that is the signature of the merge pass.A still cannot prove a jump. A six-frame strip cannot prove that the third
character in the scene is animating, because the other two are moving in the
same picture. qa/frames.mjs records one dense series per entity, and prints
a verdict for each, so a dead actor cannot hide behind a live neighbour.
BASE_URL=http://127.0.0.1:4180/index.html \
ENTITIES='({ hero: d.cast[0].model, guard: d.cast[1].model })' \
FROM=4 TO=9 FPS=12 OUT=qa/frames STATIC=guard \
node templates/qa/frames.mjs
What it does per entity:
ISOLATE=scene (default) hides every mesh not on that
entity's branch, so the signature is really about this actor; siblings hides
the other registry entries only. Restored afterwards.FPS (12 by default) across FROM..TO, and for each frame logs
the world bounds centre in NDC, plus a 32x32 luminance signature.empty counts frames where the entity is not on screen,
energy is the largest mean luminance delta between consecutive on-screen
frames (a flat line means the actor is not animating), step is the largest
NDC jump (a teleport), and OFFSCREEN counts frames outside the frustum.qa/frames/<name>/sheet.png, and the
numbers to report.json. Exit code 1 when anything is flagged, so CI can gate.Reading it:
| Verdict | Means | What to do |
|---|---|---|
ok |
moved, stayed inside, no jump | still read the sheet for pose quality |
FROZEN |
energy under MIN_ENERGY |
the pose blend is not reaching this actor |
TELEPORT |
an NDC jump over MAX_STEP |
a state boundary is snapping, not blending |
EMPTY n/N |
not rendered for over half the window | wrong window, or it spawns later than you think |
NOT-IN-WINDOW |
never rendered in the window | the entity name is wrong, or it is invisible |
OFFSCREEN |
left the frustum | staging, camera fit, or a run that goes too far |
Two rules for the numbers. A blank frame beside a full one must never be allowed
to supply the energy for a window, so only consecutive on-screen pairs are
compared. And an entity that is meant to hold still (a seated figure, a guard at
a post) goes in STATIC=, or you will get a FROZEN that means nothing.
Run it for every hero actor, and for each scripted beat that involves them: send-out, attack, hit, death, exit. The sheet is the evidence; the verdict only tells you which sheet to open first.
Run this after the build and before shipping. It is deliberately visual; a number cannot prove that a club is touching a door.
events, shots per tower, deaths per species, maxD
per species, loop length and console errors. A species with zero deaths did
not finish its route; a tower with zero shots never joined the fight.file:// once. ready: true, no
console errors, and a frame that matches the served page.Keep the proof pack: shots/hero.png, shots/tower-*.png, shots/death-*.png,
shots/boss-contact.png, shots/boss-recoil.png, shots/beam-off.png. A future
chat can compare its own pack to these crops.
When a different diorama is requested in a fresh chat, the skill should produce the same level without re-deriving it:
templates/DESIGN.md.qa/audit.mjs, not just "does it
load".DESIGN.md, README.md and the code agreeing.If the new subject has no combat, replace tower grammar with Machine Grammar (loom, press, crane, oven, pump) and creature grammar with character grammar (customer, worker, animal, vehicle). Audit outputs as fields when there is no projectile. The five layers and the audit still apply: idle, locomotion, action, reaction, residue.
When the user marks a region, project the object instead of guessing pixels:
obj.getWorldPosition(v); v.project(camera); px = (v.x*0.5+0.5)*w.
If it is not obvious, raycast that pixel and read the first few hits' materials and
heights: the first hit is the surface they see, the second is what is under it.
Then fix the marked region and nothing else, and prove it with a zoomed crop at the
same timestamp.
visible flag, so hidden cargo comes back as a
single invisible mesh that never appears, and the survivor's getWorldPosition
reports local coordinates. Tag runtime-toggled meshes userData.noMerge = true.renderScale 1.2–1.5×
on a small subject sharpens it without making it larger; measure fps and inspect
a 1:1 crop before keeping it.rotation.z, and put the feet on
pivotY + h*cos(flex) - arm*sin(flex).PAY, ORDER and POINT on !state.moving; a still at one timestamp
will not catch it, a 0.15 s strip will.subjectScale instead; the frame and backing buffer stay fixed.DESIGN.md filled design sheet: premise, cast, systems, beats, budget
CREDITS.md every imported model: URL, author, licence (CC0/CC-BY/owned)
refs/ reference frames: contact sheets stepped from the source clip
refs/SOURCES.md research log: query -> found -> decision, per question
src/
config.js scene constants + clamp/lerp/smooth/pulse/hash
main.js renderer, scene, clip planes, resize, rAF, ?t= freeze
core/
palette.js N entries + named C map
post.js PixelPost: gamma, grade, ink, dither, snap, rim (pixel only)
stroked-toon.js optional approved OutlineEffect + four-step toon materials
materials.js every material, palette-validated
geometry.js roundedBox, addBox, lathe helpers
mechanism-contract.mjs shared anchors, coverage/end-plane budgets + scoped contact policy
inspection.js rigid assembly/piece emphasis, reveal authorization, exact restoration
ui/
education-dock.mjs education-dock.css dependency-free single lesson surface
merge.js mergeSiblingMeshes: one draw per material per group
scene/
camera.js lighting.js street.js bank.js props.js
car.js shell, doors, boot, seats, cargo
peopleModel.js base rig (swimwear/aquatic)
peopleModel-street.js clothed rig: heads, layers, hats, hands
people.js the cast: poses, walk/run, tracks, buildCast
stage.js the beat sheet + every actor as a function of t
effects.js contact shadows, smoke, spill, siren
build.mjs esbuild bundle, index.html, standalone HTML
qa/
shoot.mjs viewports + console errors + named timestamps
inspection.test.mjs helper state/identity/ownership and injected failure regressions
inspection-browser.mjs synthetic contrast/depth/restoration fixture, three presets
probe-*.mjs one-off numeric probes (facing, anchors, NaN, spawn pose)
audit.mjs scene lint: halos, fades, camera/render scale, exits, FX
portrait.mjs isolated figure/framing shots through a debug camera
strip.mjs N-frame motion strips (fails on a frozen loop)
probe.py colour runs across an edge
sweep.mjs pairwise distances + jam/teleport verdict
tile.py tile a motion strip
README.md audit contract, commands, failure table
Wire order in main.js: renderer → scene → camera → post → clip planes → lights →
materials → street/bank/props → cars → cast → effects → merge → stage. Merge once,
before the stage is created, so the timeline binds to the surviving meshes.
A defence or arena subject replaces street/bank/car with path/towers/keep:
src/scene/
path.js route samples, arc length, at(d), ground height
towers.js foundations, machines, crew, recoil pivots
monsters.js rig, poses, walk/fly/hop, boss club
keep.js gate, walls, door leaves, cracks, goal response
roster.js species stats and wave table
battle.js deterministic 40 Hz sim, shots, impacts, deaths, gate hits
props.js camp, skull tree, cart, torches, trees, portal dressing
effects.js beams, projectiles, dust, smoke, shards, rings, souls
The same wire order applies: build the set, then the cast, then effects, then merge once before the battle timeline reads the survivors.
When the beat sheet moves into its own module, delete the superseded director and update the README's beat table in the same pass. An unreferenced six-hundred-line timeline and a table that disagrees with the code are exactly what the next reader trusts.
templates/ carries runnable copies, not excerpts. Foundations: post.js,
palette.js, camera.js, lighting.js, geometry.js, build.mjs. Cast and
motion: peopleModel.js, peopleModel-street.js, poses.js (the pose library,
including the four climb poses and the walk/run cycles), transfer.js (seating,
the climb, stand spots, facing), track.js (arc-length paths with lane offsets
and smoothed ground height), stage.js (beat table, keysAt, place, the
actor loop, a car state machine). Props and systems: detail.js for prop
assemblies (including haloPlane/softDiscTexture for soft light cards),
combat.js for deterministic timing and death grammar, creature.js for a
fight between two rigged actors (stage-local aimYaw, bone-space headAnchor,
uprightQuat, the makeHurtModel severity table and sendOut throw-and-return
geometry). Effects: water.js, wake.js, splash.js. Sheets: DESIGN.md,
CREDITS.md, SOURCES.md (the research log, filled before the first mesh).
stage.js ships as a skeleton with one worked actor chain: a figure leaves a
car, walks a route, comes back and climbs in. It is deliberately not a story. The
structure it does ship is the part that is tedious and easy to get wrong: beats
ordered monotonically in t, one branch per actor per frame, the contact shadow
following place(), and the door as a timeline rather than a state. Replace the
cast, the routes and the beat table; keep the skeleton.
car.js is still not in the kit. A vehicle is the most subject-specific prop in
the scene, and the recipe (dimensions, door pivots, windscreen versus seat, boot
well, livery split) is written above at the length it needs. Everything else you
need is a file.
qa/ is the harness: shoot.mjs (viewports, named timestamps, console errors,
the buffer/camera/draw-call line), audit.mjs (flat-glow, whole-object fade,
camera/render-scale, early-hide, teleport, idle/orphan emitter and margin checks
against the optional scene contract), portrait.mjs (isolated figures through the debug
camera), strip.mjs plus tile.py (motion strips, which fail on a frozen
loop), probe.py (colour runs across an edge, the tool for "why is there a band
here"), and sweep.mjs (pairwise distances across a beat, with a two-sample jam
verdict and a teleport limit). They need playwright-core and a page that
exposes window.__diorama with freeze(t); verify/water/ is a worked example
that exercises the three water modules and shows what the acceptance output
looks like.
Keep a project-local postmortem of what the user actually reported, not what you intended. Installed-skill changes require an explicit maintenance request and filesystem approval; the following rules apply only during authorized maintenance.
SKILL.md.bak-v<old> beside it.DESIGN.md for a different diorama. Fix
every contradiction it finds; that is cheaper than discovering them after a
build.A useful postmortem entry has this shape:
BUG: the club read as a rock at the gate
CAUSE: end-on pose; haft hidden; no bands
RULE: turn the boss 0.35 rad to the goal; build haft + bands + studs
TEST: contact crop at the gate-hit timestamp; haft visible, head on door
Two entries from the truck-diorama correction pass:
BUG: a light-grey rectangle floated beside the jumbotron
CAUSE: a flat, untextured, additive PlaneGeometry used as a glow
RULE: halos need a radial-alpha map, an emissive lens, or deletion
TEST: qa/audit.mjs FLAT_GLOW plus a 1:1 crop of the board at the hero time
BUG: both trucks vanished at the gate before the run-out finished
CAUSE: visible=false keyed to a beat, not to world bounds clearing the slab
RULE: hide only after the box is outside slab + 0.2–0.5 m; never fade solids
TEST: qa/audit.mjs EARLY_HIDE over the full loop; exit strip at 0.2 s spacing
BUG: the yellow truck smoked while parked, from a cloud above the cab
CAUSE: continuous idle haze plus a guessed emitter point inside the body
RULE: one start/rev event window, puffs born at the real stack tip; offset the
birth point downstream if a canopy hides it, never the source anchor
TEST: qa/audit.mjs IDLE_EMITTER / ORPHAN_EMITTER; event frame present,
event + 1.5 s absent
From a Pikachu vs Charizard battle diorama built against Sword/Shield and anime footage. The rig, the effects and the send-out all broke in the same three ways, and the fixes generalise to any fight between two rigged actors.
Both rigs look down their own +Z, and both sit under a stage root that is
rotated (here 90°). Reading a world-space bearing to the opponent and writing it
to a local rotation.y aims the two past each other, toward the lens. Compute
the yaw inside the stage's own frame:
const camLocal = cameraDirection.clone().applyAxisAngle(UP, -STAGE_ROT);
const aimYaw = (a, b, cheat) => {
const dx = b.x - a.x, dz = b.z - a.z;
return Math.atan2(dx, dz) + camLocal.x * cheat; // local, not world
};
Then prove it numerically, every half second, through the whole loop: forward vector versus vector-to-opponent should sit at 0.97+, and it may only dip during a deliberate spin. Eyeballing this at 300 px hides a 20° miss.
Flames leaving a mouth must be anchored to the head joint, or they slide off the jaw whenever the head turns. Convert the parent's forward and up into the target bone's local space once at build time and keep the emitted point there:
const localFwd = bone.worldToLocal(pivotPoint.clone().add(forward)).normalize();
Same idea for the aim of a projectile: take the muzzle from the bone matrix, not from a hardcoded offset.
quaternion.setFromUnitVectors(+Z, viewDir) picks an arbitrary roll, which is
why a kanji-shaped blast can arrive upside down or rotated 40°. Build the basis
from the lens explicitly:
const right = new THREE.Vector3().crossVectors(worldUp, viewDir).normalize();
const up = new THREE.Vector3().crossVectors(viewDir, right).normalize();
mesh.quaternion.setFromRotationMatrix(new THREE.Matrix4().makeBasis(right, up, viewDir));
A hit burst is a hot core with ten short sparks radiating out of it, plus a ring on the ground. That is the whole recipe; it reads at any size.
m.scale.set(k,1,1) per layer) — sharing one
geometry between layers makes the layers invisible.An eruption anchored to actor.position every frame crawls across the slab while
the actor slides out of it, which is exactly the "something feels off, it moves a
bit" report. Latch the anchor once, at the moment of impact, and animate from
that fixed point. Same for the projectile's target: aim at the latched point, not
at the live chest position.
templates/creature.js ships these five as runnable functions: aimYaw,
headAnchor, uprightQuat, makeHurtModel, sendOut.
One hit model, four severities: a light flinch (0.9 s, a tip back), a knocked-back
stagger (1.7 s, air time), a spin-out (1.3 s), and a full collapse (3.5 s, falls,
lies down, gets up). Rotate about the axis of the blow ([dz, 0, -dx]), pivot at
mid-body so the actor rocks rather than hinging at the feet, and add a small
vertical arc so the feet leave the ground.
5.7.0 — Remove Pixel Art V2. Removes the V2 rendering contract and intake/design options at the user’s request. Classic Pixel Art is the recommended and explicitly delegated default; stroked-toon and pixel+stroke remain. V2 resources are archived, not active instructions. Regression: active intake/design expose exactly three presets, with no V2 dependency. Earlier changelog entries are historical only.
5.6.0 — V2 cast and action language. Adds dedicated rounded-character construction, cast-specific shading and articulated action guidance. Requires garment-attached patterns, actual foot/grip contacts and deterministic action-strip checks for imported or authored cast; existing rigs are starting points, not automatic style passes.
5.5.0 — Terrain edge, not just ink. Makes the irregular scattered-to-white ground perimeter a required V2 feature. Adds an independently authored terrain-only material coverage helper with shadow hooks, integration and edge-crop acceptance notes. Existing projects are not automatically modified; renderer verification remains per build.
5.4.2 — Standalone Pixel Art V2. Removes external reference materials and adapted styles. Retains an independently specified edged/dithered rendering option and the two-step look/sourcing intake. No external implementation is bundled.
5.4.0 — Two-step commission intake. Adds selectable Pixel Art V2 versus Classic Pixel, then separate hybrid / internet-throughout / fully agent-modeled sourcing choices. Explicit precedence replaces old automatic internet-first and three-option prompts. V2 requires its own renderer and rendered checks; the classic post template is not falsely advertised as V2. Updates design receipt and sourcing evidence. v5.3.0 preserved.
5.2.0 — Pose-aware clearance. Adds actor/animal/building space reservation, seat frames/occupancy and action-path checks to both profiles. Ships sphere/capsule/OBB nearby-pair sampled audits with exact time-window contact rules and independent proxy inventory, plus live CPU skin/morph pose bounds. Regressions cover limbs/tails, seats/backrests, buildings, temporal crossings and missing/invalid coverage. Proxy/sample limits remain explicit; full guide, model-first sourcing and narrative no-education-UI preserved.
5.1.0 — Model-first by default. Requires finding, acquiring and using fitting commercially modifiable/redistributable internet assets for major roles, not merely logging a search. Retains Polyfork-first narrative sourcing and educational accuracy gates; verifies actual import/style/motion and final-scene inclusion. Free-first; paid assets require approval. Hand-building is a justified gap/fallback, not the default. Preserves the full long guide and narrative no-education-UI boundary.
5.0.0 — Long-form restoration. Restores the complete 3.18 guide and detailed design sheet after compact-profile educational UI leaked into ordinary scenes. Narrative by default; no educational card/dock/lessons/callouts without explicit explanatory intent. Keeps Polyfork sourcing, commercial/adaptation/redistribution checks, actual-subject representation and tested construction helpers. Profile-consumer tests are bounded evidence, not a rendered amusement-park benchmark.
3.18.0 — Consolidates educational UI/selection/lesson rules into one V8-exact
authority with crossrefs; resolves placement, focus, preset-intro, ghost-shell
and reciprocal scale contradictions. Three quartz-watch evidence/test contracts:
all repeated mating interfaces from shared anchors/axes with real holes and
noncoplanar ends; assembly/piece inspection with class-safe reversible state;
non-vacuous actual-geometry QA and fresh build identity. Ships rigid inspection
and shared-interface helpers with class/ownership/empty-fixture failures and a
three-preset rendered contrast/depth/restoration regression; preserves context
and authorizes internal occluder removal explicitly. These tests are bounded
helper evidence, not full mechanism/UI certification.
Missing straps/back remain the existing 3.17 completeness gates, not new rules.
Full 3.17.0 preserved as SKILL.md.bak-v3.17.0.
3.17.0 — Three whole-object completeness gates prompted by the user-reported quartz watch missing straps and back: whole silhouette/scope, exterior/rear attachment construction, and a reconciled completeness matrix with proof and negative checks. Extends the Detail Bar and design template across profiles/presets; preserves prior UI, mechanics and style contracts. Per-scene checks remain required; no model certification is claimed.
3.16.0 — Code-defined V8 educational UI contract and copy-in education-v8.css: exact neutral tokens, reserved 360px right column/mobile dock, DOM/control hierarchy and measured regression gates. Records grandfather-clock beige/glass/detached-title drift; supersedes ambiguous default-placement wording without changing render presets or mechanics.
3.15.0 — LEAP-1B repair checklist: retained preset provenance, closed exterior/explicit Inside/reset lifecycle, UI-safe complete-assembly fit with correct camera-axis sign, and reference-first white compact educational UI. Adds design fields and scoped white-stage CSS. Tests remain per-scene; geometry sampling does not imply full collision certification. v3.14.1 preserved as backup.
3.14.1 — Documents the calibrated V8 soft-glow/holographic inspection implementation: isolated material variants, ghost-shell depth policy, selective live-transform feature edges, multi-material restoration, ownership/disposal, and rigid-versus-deformed limitations. Adds matching design/QA acceptance fields; no renderer preset or scene behaviour changed. v3.14.0 preserved as SKILL.md.bak-v3.14.0.
3.14.0 — Three evidence-backed regression rules: mating interfaces/local axes/shared anchors with bore/bevel/axial budgets and connected ports/supports; full-assembly swept-clearance coverage with surface-scoped intended-contact policy and explicit sampled-proof limits; compact neutral sans educational UI with progressive causal steps bound to frozen scene state. Adds dependency-free mechanism-contract and education-dock templates, scalar/contact-policy and browser helper regressions, design/QA sheets. V8 rod repair and the incomplete earlier 12/12 report are the evidence, not a guarantee of future bug-free construction. v3.13.0 preserved as SKILL.md.bak-v3.13.0.
3.13.0 — Mandatory Render Preset Gate: the agent asks once, at project
start, which of the three looks to build in (pixel default, stroked-toon,
pixel + stroke hybrid), instead of asking only once it had already decided to
try the optional look. An explicit style in the request counts as the answer;
naming a look in a reference, or the word "toon" on its own, does not; silence
resolves to pixel and is recorded as a delegated default. The grey blockout and
the research lookups continue while the answer is pending and only the
presentation pass waits. Updates the frontmatter description, the intro,
One Prompt, One Build, Step 0, both preset sections, the pipeline and
templates/DESIGN.md. v3.12.0 preserved as SKILL.md.bak-v3.12.0.
3.12.0 — Motion graphics hardened by a full-cycle, frame-by-frame audit of the four-stroke engine: effects are derived from the moving free volume instead of a spline that pierced the valve; the direction-dependent cone extent is fitted rather than only the centre; anchors, length normalization, single-row chevrons and flame-coupled fade are specified; ignition flash is capped; and every Y constant is declared in one local space. Adds the 720° vertex containment sweep, the adjacent-degree no-teleport bound and the 15°-step contact-sheet gate, plus nine new recorded failure modes. v3.11.0 preserved as backup.
3.11.0 — Motion-graphics primitives recorded as first-class geometry: forward-axis/tip convention tests, no arrows inside opaque bodies and no depth-test x-ray, minimum legible effect scale, free-volume sizing with a sign check, compact ignition kernels, one-idea arrows, un-outlined FX, phase-bound deterministic lifetimes, connected hollow outlets, real bores through crossed flanges, and reversible selection glow/dim/focus. Adds the ten recorded failure modes from the four-stroke engine. v3.10.0 preserved as backup.
3.10.0 — Mandatory user orbit for every preset with deterministic hero reset, no auto-spin; first-class educational mechanism profile, single accessible dock and one live part explanation; component manifest and ratio/kinematic/contact acceptance; optional confirmed low-resolution pixel+stroke helper with one selective outline pipeline. v3.9.0 preserved exclusively as backup.
3.9.0 — Optional subject-independent stroked-toon illustrated-miniature
preset, calibrated from the coffee-rig repairs: explicit ask-and-wait gate,
native antialiasing, four-step toon ramp, selective warm ink outlines, bevelled
assemblies, sound cavity/contact construction and related prop clusters.
Pixel remains the default. Documents overrides to conflicting pixel-only
camera/post/empty-paper rules, adds templates/stroked-toon.js and design-sheet
consent/preset fields. Checks: material/ramp tests, module bundle, unrelated-
subject spec review; renderer appearance still needs per-project visual QA.
3.8.0 — qa/frames.mjs: a per-entity frame recorder. Samples one dense
series per entity across a window, isolates it (branch, siblings or full
scene), fits one camera to its swept bounds so travel stays visible, and scores
every entity: energy (flat means frozen), step (NDC jump means teleport),
empty frames, OFFSCREEN, with STATIC= for actors meant to hold still. Each
entity gets a contact sheet plus a row in report.json, and the script exits
non-zero on any flag. New Per-entity frame recording section in Verification.
New Long builds and context section: compaction is lossy, so state lives in
DESIGN.md, SOURCES.md, CREDITS.md, report.json and the beat table, and a
post-compact agent re-runs the harness instead of trusting its summary.
3.7.0 — Research-first release, from the Pikachu vs Charizard battle
diorama. New Research Before You Model section: step the source footage into
contact sheets and write the motion grammar down before modelling, prefer
game footage over fan cuts, and check free commercial-use libraries (Poly
Pizza, Sketchfab CC0/CC-BY, Quaternius, Kenney, user-supplied AI meshes) before
hand-modelling a creature; CREDITS.md + licence gate + fitModel pipeline +
forward-axis probing; shots-as-acceptance-test. New Field Notes: Two-Creature Combat section: stage-local aiming with a numeric facing sweep, bone-space
effect anchors, upright billboard basis, explosion vocabulary (no cones/bars/
scaffolding, per-layer scaling, one continuous stream), latching effect anchors
to the impact point, send-out vs recall grammar (throw → arc → open → burst →
full-size exit → ball returns; red beam only on recall), and severity-scaled
hit reactions about the blow axis. Project layout gains refs/ and
CREDITS.md.
3.6.0 — Renamed to Diorama throughout: the playbook, templates and QA docs now call the artifact a diorama. No code behaviour changed.
3.5.1 — Camera-scale rule made explicit: subjectScale is a post-fit
multiplier (0.70 = 30% smaller linearly), while fillX/fillY stay a fit
margin. The camera template now exposes fitDistance and subjectScale;
qa/audit.mjs now proves distance ≈ fitDistance / subjectScale when those
two fields are exposed, and post.size ≈ CSS × renderScale when the post
exposes it. Added the
Dust Kings calibration (fit 67.93 → actual 97.05, projected slab 872 → 611 px)
and a rule against shrinking the geometry or canvas frame to create margin.
PixelPost gains a renderScale argument; Dust Kings renders at 1.25× (buffer
1640 × 950 on a 1312 × 760 CSS canvas) so the smaller diorama keeps its edge
detail without changing page size. The resolution section now separates buffer
from layout and warns about the frame-rate cost.
3.5.0 — Surface/Motion/Event-FX correction release from a truck-diorama
postmortem: finish heightfield/slab edges flush (no lip or portal), keep every
exiting mover visible until its world bounds clear the slab, never fade a solid
hero with material opacity, gate exhaust/steam/dust by authored event windows
with the emitter at the physical nozzle, and replace flat untextured halo
quads with radial-alpha sprites. New qa/audit.mjs checks flat glows,
whole-group fades, early hides, teleports, idle/orphan emitters and paper-margin
leaks; shoot, portrait, sweep and strip now fail with a nonzero exit
code; QA README documents the optional audit contract. New DESIGN audit sheet;
detail.js gains haloPlane/softDiscTexture so a soft light card is the
default.
3.4.0 — The fragile code is now shipped, not described: poses.js,
transfer.js (climb, stand spots, facing), track.js and a stage.js
skeleton with a worked actor chain; qa/ as runnable scripts (shoot, portrait,
strip, probe, sweep) instead of a checklist; Numbers split into invariants and
calibrated values. Water, wake and splash re-verified in verify/water/, which
found two real defects: the splash used Math.random (now seeded) and neither
effect could be frozen (both now expose reset(); the harness re-simulates from
zero and a two-frame diff fell from 334 to 18 pixels). build.mjs writes a
favicon stub so the 404 stops polluting the console gate.
3.3.0 — Social/life-scene release from the Night Market build: clothed-cast
craft (skull/jaw head, hairline, layered garments, hands), carry/handoff and
crate-loading rules, scooter/cargo-bike anatomy, two-wheeler mount with hip-Z
abduction, service/queue state machine with moving gates, Night Market worked
example and fix table, 2x backing/scale-by-camera guidance, empty-paper rule,
social verification logs, night/practical/headlight guidance, cutaway and
glazing rules, bus/van anatomy, cat/dog quadruped rig and gait, generalised
DESIGN.md with Life/Service and Contact/Choreography sheets, new
peopleModel-street.js template, scene fast path, and a laundromat/workshop
router row.
3.2.3 — Hollow-object rule: cannon bores, pipe mouths, chimney flues, lamp chimneys and tunnels need open collars, a recessed dark bore, a back disc and a lip ring. Added 1:1 bore audit and the brass-end-cap pitfall; the Bombard cannon now has an open muzzle instead of a cap.
3.2.2 — Fixed cannon ammo station rebuilt as a wall-mounted locker below the deck: shelf, brackets, powder chest, shot tray and hung rammer, outside both yaw sweep and barrel arc. Added bounding-box overlap check to the pivot audit and recorded the wall-locker pattern.
3.2.1 — Rotating-assembly parentage rule: only the gun may live under yaw; fixed deck stores go on a static group. Added pivot-parentage strip and acceptance check; cannon keg, shot and rammer moved off the yaw group.
3.2.0 — One-prompt commission mode: default commission table, assumption line, ten-scene router, universal four-question generator, bakery worked example, autonomous eight-pass build, cut-count-not-detail rule and one-prompt acceptance; reading order trimmed to the sections needed.
3.1.0 — Canonical numbers/camera/light/post/palette contract; field and
machine grammar; goal-response vocabulary; FX edge, snap and contact-context
rules; crew/defender rule; human death grammar; climb and rotating-emitter
rules; expanded DESIGN.md; new detail.js rope, trophy-board and
contact-shadow helpers.
3.0.0 — Detail Bar, Animation Bar, new-subject intake, reference density,
detail recipes, system/combat animation, attack/death audits, beam/artifact
triage, detail-and-animation QA, templates/DESIGN.md, templates/detail.js,
templates/combat.js.
2.1.0 — Combat Readability section; threshold clearing, tower grammar,
boss goal contact, death species, standalone String.replace guard.
2.0.0 — Palette/post contract, camera solve, cast rig, vehicle/seat transfers, clipping, verification.
A playbook and code kit for detailed Three.js dioramas. It asks two questions before the first mesh: which of three looks to build in, and whether the models come from libraries or from your own geometry.
Pikachu vs Charizard, 45 s · Dust Kings, 38 s · Pool, 26 s · Bank job, 48 s
Four scenes built with this playbook. Click any tile for the full capture.
Install it in one prompt · Update it in one prompt · What is in here · Start a diorama · Verification
A diorama here is a tiny staged scene on a slab: a resettable three-quarter hero camera with free user orbit, a flat cut-out against white paper, a 64 colour palette with ordered dither and an inked contour, and toy-scale people with real joint animation. The subject changes (pool, night market, bank job, arena battle); the slab, the cast and the presentation stay for the default pixel preset.
Looks: pixel (default), stroked toon, or pixel + stroke. The agent asks once and builds in the answer; silence means pixel.
Sourcing: hybrid is the default: licensed assets, hand-built gaps. Also internet
throughout or agent-modelled. Assets must allow commercial use and redistribution,
with evidence in refs/SOURCES.md and CREDITS.md.
Everything is deterministic. The scene is a pure function of t, so any frame can
be frozen, screenshotted and compared. A screenshot is evidence, not a lucky
capture.
SKILL.md is the playbook: research-first workflow, the look and animation bars,
the pipeline, the recipes, the QA harness and the pitfalls. It stays the source of
truth. references/ holds the same material split into on-demand topic files for
long sessions, and everything else here is copy-in code that supports it.
Paste this into an agent that can run shell commands. It asks where the folder should
go, installs the published package with npm i @sloemo/diorama and npx diorama,
reads it, and reports what it learned before it builds anything. That is about 155
files and 1.6 MB — SKILL.md, references/, templates/, verify/, the licence and
the two educational screenshots. Nothing is installed globally and nothing runs after
the copy.
For a one-off without adding a dependency, npx @sloemo/diorama <target> does the same
thing; --list previews the copy, --force writes over an existing install,
--no-verify skips the worked examples.
--media adds the four demo scenes as GIF and MP4 — 20 MB, from
@sloemo/diorama-media — for when
you are rebuilding one of them and want the reference footage in hand.
Install the Diorama playbook here, then use it to build scenes.
Package: https://www.npmjs.com/package/@sloemo/diorama
1. Ask me where the folder should go before installing anything,
and wait for my answer. Propose ~/skills/diorama as the default.
Do not pick a path silently.
2. Install the published package. Run it from a scratch directory or
from the parent of <target>, not inside an unrelated project:
npm i @sloemo/diorama && npx diorama "<target>"
Without touching package.json:
npx --yes @sloemo/diorama "<target>"
Add --media only if I want the four demo clips as reference footage
(20 MB, from @sloemo/diorama-media). The playbook does not need it.
--list previews the copy, --force overwrites an existing install,
--no-verify skips the worked examples. If <target> already has files,
ask me before using --force.
Install from the registry only. Do not clone the GitHub repository or
unpack an archive instead: the npm download count is how this project
tells whether anyone uses it. If npm or node 18+ is missing, say so
and stop.
3. Prove the install before describing it, and print what you ran:
npx diorama --version # package and playbook version
ls "<target>" # SKILL.md README.md LICENSE references templates verify
find "<target>" -type f | wc -l
The count must match what the installer printed. If a check fails, say
so and stop. Never describe this playbook from memory.
4. If you have a skills directory or plugin folder, install it
there so you can load it by name in later sessions; otherwise
treat "<target>" as the folder.
5. Read before you build: all of SKILL.md, references/INDEX.md, then
templates/DESIGN.md, templates/SOURCES.md, templates/CREDITS.md,
templates/qa/README.md, the header comment of every template you
intend to copy, and the worked examples under verify/. SKILL.md is
the source of truth; the README is only a summary.
6. Report back in this order: install path and version, the Look
Contract in one paragraph, the Pipeline as ordered steps, the
QA scripts and what each one checks, and three rules from
SKILL.md with the section each came from.
7. Then ask me what the first diorama should be. Do not ask me to
fill the design sheet. When I give you a subject, research it
first (frames, assets, motion), fill DESIGN.md from the
defaults, copy the modules you need into my project instead of
editing the installed copy, build through the Pipeline, and run
the QA scripts before you show me anything. Give me the paths
of the frames you kept and what each one proves.
If two parts of SKILL.md contradict each other, list them before
you build. A successful npx is not an install: 5 and 6 are it.
Paste this into an agent for a copy that is already installed. It backs the folder up,
updates the command with npm i @sloemo/diorama@latest, refreshes the folder with
npx diorama <target> --force, and reports what changed before any project is touched.
Update my Diorama install, then report what changed.
Package: https://www.npmjs.com/package/@sloemo/diorama
1. Ask me for the folder before touching anything, and wait.
Propose ~/skills/diorama as the default.
2. Print the current version and make the update reversible:
npx diorama --version
cp -R "<target>" "<target>.bak"
Keep the copy until I say the update is good.
3. Refresh in place from the registry:
npm i @sloemo/diorama@latest && npx diorama "<target>" --force
Without touching package.json:
npx --yes @sloemo/diorama@latest "<target>" --force
No git pull, no archive: the npm download count is how this project
tracks real installs. Add --media if <target>/media already holds the
demo clips, so the reference footage moves with the playbook.
If node 18+ or npm is missing, say so and stop.
4. Prove it before describing it: print the old and new version from
SKILL.md frontmatter, confirm the same six paths still exist, and
confirm the file count matches what the installer printed. If the
refresh failed, say so and stop.
5. Report the difference in this order: version jump, new or removed
folders and templates, rules that changed, and which of my own files
inside <target> differ from the new ones. Re-apply my edits only when
the difference is clean, and say so when it is not.
6. If one of my dioramas is mid-build, read SKILL.md and
references/INDEX.md again and list the rules that now affect that
project. Do not rewrite the scene without asking me.
Educational mode is a first-class exception to narrative cast/ritual/system quotas:
one accurately built mechanism, one causal sequence and clean off-white (#f7f7f5).
The default surface is one opaque white card in a reserved 360px right column, which
becomes a bottom dock below 880px; an explicitly requested placement keeps those tokens
and controls. Narrative scenes get none of it: no card, lesson steps, part picker,
dashboard or floating labels unless an explanation was asked for. Click a real part for
one short explanation, and the sa