Explorer Viewer Builder
The last step of a 3D explorer is a page anyone can open: no install, no build step, works on a phone. This skill produces a single HTML file from the tested template in references/viewer-template.html: Three.js from a CDN, a GLB loader, orbit controls, clickable parts with sourced labels, an exploded view and a quiz mode, filled in with the parts list and palette from the earlier steps.
Required Inputs
Ask for these if not provided:
- The GLB file (path or URL), or confirmation to start with the template's demo assembly
- The parts list: mesh name, label, description and source for each part (from model-prompt-pack)
- Palette and layout values (from explorer-interface-brief), or accept the template defaults
- Title and the illustrative statement
- Hosting: GitHub Pages, a static host, or opening the file locally (GLB files need a local server; browsers block
file:// loading)
Working from a brief
Given the model file and the list of parts, write the complete single-file viewer anyway. Assume the GLB's node names match the parts listed, say so at the top, and wire the labels, the exploded view and the quiz to those names so a mismatch is a one-line fix.
Output Structure
1. The viewer file
A complete index.html based on the template, with:
- CONFIG filled in:
title, model, and parts (one entry per mesh name, each with label, description and source)
- Palette applied to the CSS custom properties, with a dark-mode block
- The illustrative statement in the panel footer
- unchanged core behaviour from the template: orbit controls with damping; click (or tap) to select, ignoring drags; selection through the parts list for keyboard users; exploded view that moves each part away from the model's centre in its parent's space; quiz mode that asks for a random part, scores answers and highlights the right part after a miss; reset view; a demo fallback and a console warning if the model fails to load; a list of the model's mesh names when none match the parts list
2. Mesh-name check
A table matching the parts list against the mesh names the viewer reports (open the page with the model and read the panel, or the console):
| Mesh name in parts list | Found in GLB? | Action |
3. Run and publish instructions
- Local:
npx serve . (or python3 -m http.server) in the folder, then open the printed address
- GitHub Pages: commit
index.html and the .glb, enable Pages for the branch, and note the file-size limits
- Performance: keep the GLB under 15 MB; compress textures; test on a mid-range phone
4. Test checklist
Binary checks to run in a browser: the model appears; each part in the list highlights and shows its label and source; dragging rotates without selecting; exploded view separates every labelled part and reverses; quiz mode scores a right and a wrong answer; the page has no horizontal scroll at 390 px wide; dark mode is readable; the console shows no errors.
Quality Checks
Anti-Patterns
- Opening the HTML by double-clicking with a local GLB. Browsers block it; use a local server.
- Labels without sources. The viewer shows the source line for a reason; never leave it blank.
- Selecting on pointer down. Every rotation then selects a part; select on a click without movement.
- Unpinned CDN versions. A Three.js update can break the page overnight.
Example Trigger Phrases
- "Build a viewer for heart.glb with clickable labelled parts and a quiz."
- "Turn this parts list into a single-file Three.js explorer."
- "Add an exploded view and quiz mode to my 3D model page."
- "Make a GLB viewer that works on phones, no build step."
1---2name: explorer-viewer-builder3description: "Use when asked to build a 3D viewer for a GLB model, make an interactive explorer with clickable labelled parts, add an exploded view or quiz to a 3D model, or turn a parts list into a web page. Produces a single-file Three.js viewer that loads GLB models, with orbit controls, clickable labelled parts, an exploded view toggle and a quiz mode, built from the tested template in references/viewer-template.html. Third step of explorer-pipeline."4version: 1.0.05disable-model-invocation: true # skill-optimizer6metadata:7 source: https://skillmd.com/skills/slipcast-dev/explorer-viewer-builder8---910# Explorer Viewer Builder1112The last step of a 3D explorer is a page anyone can open: no install, no build step, works on a phone. This skill produces a single HTML file from the tested template in `references/viewer-template.html`: Three.js from a CDN, a GLB loader, orbit controls, clickable parts with sourced labels, an exploded view and a quiz mode, filled in with the parts list and palette from the earlier steps.1314## Required Inputs1516Ask for these if not provided:17- **The GLB file** (path or URL), or confirmation to start with the template's demo assembly18- **The parts list**: mesh name, label, description and source for each part (from model-prompt-pack)19- **Palette and layout values** (from explorer-interface-brief), or accept the template defaults20- **Title** and the illustrative statement21- **Hosting**: GitHub Pages, a static host, or opening the file locally (GLB files need a local server; browsers block `file://` loading)2223## Working from a brief2425Given the model file and the list of parts, **write the complete single-file viewer anyway**. Assume the GLB's node names match the parts listed, say so at the top, and wire the labels, the exploded view and the quiz to those names so a mismatch is a one-line fix.2627## Output Structure2829### 1. The viewer file30A complete `index.html` based on the template, with:31- **CONFIG** filled in: `title`, `model`, and `parts` (one entry per mesh name, each with `label`, `description` and `source`)32- **Palette** applied to the CSS custom properties, with a dark-mode block33- **The illustrative statement** in the panel footer34- unchanged core behaviour from the template: orbit controls with damping; click (or tap) to select, ignoring drags; selection through the parts list for keyboard users; exploded view that moves each part away from the model's centre in its parent's space; quiz mode that asks for a random part, scores answers and highlights the right part after a miss; reset view; a demo fallback and a console warning if the model fails to load; a list of the model's mesh names when none match the parts list3536### 2. Mesh-name check37A table matching the parts list against the mesh names the viewer reports (open the page with the model and read the panel, or the console):38| Mesh name in parts list | Found in GLB? | Action |3940### 3. Run and publish instructions41- Local: `npx serve .` (or `python3 -m http.server`) in the folder, then open the printed address42- GitHub Pages: commit `index.html` and the `.glb`, enable Pages for the branch, and note the file-size limits43- Performance: keep the GLB under 15 MB; compress textures; test on a mid-range phone4445### 4. Test checklist46Binary checks to run in a browser: the model appears; each part in the list highlights and shows its label and source; dragging rotates without selecting; exploded view separates every labelled part and reverses; quiz mode scores a right and a wrong answer; the page has no horizontal scroll at 390 px wide; dark mode is readable; the console shows no errors.4748## Quality Checks4950- [ ] The output is a single HTML file with no build step51- [ ] Every entry in CONFIG.parts has a label, a description and a source52- [ ] Every parts-list mesh name is checked against the GLB, with mismatches listed53- [ ] Parts can be selected from the keyboard through the parts list54- [ ] Exploded view and quiz mode both work and can be turned off55- [ ] The illustrative statement is visible on the page56- [ ] The page works at 390 px width and in dark mode with no console errors57- [ ] Three.js is loaded from a pinned version, not "latest"5859## Anti-Patterns6061- **Opening the HTML by double-clicking with a local GLB.** Browsers block it; use a local server.62- **Labels without sources.** The viewer shows the source line for a reason; never leave it blank.63- **Selecting on pointer down.** Every rotation then selects a part; select on a click without movement.64- **Unpinned CDN versions.** A Three.js update can break the page overnight.6566## Example Trigger Phrases6768- "Build a viewer for heart.glb with clickable labelled parts and a quiz."69- "Turn this parts list into a single-file Three.js explorer."70- "Add an exploded view and quiz mode to my 3D model page."71- "Make a GLB viewer that works on phones, no build step."