Skip to content

armgit / viz3d

Public Imported from GitHub
0

An AI agent skill that turns any subject into a 3D film or app

Organize the README as a guide: three steps to start, a goal-to-command table, modes grouped by use and looks by family

Nguyen Xuan An3204f05ffc92
diff --git a/README.md b/README.md
index 9163c8a..4250827 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,8 @@
# viz3d
-Some things are hard to understand from text, a spreadsheet or a two-hour documentary. How does an airport turn a plane
-around in 45 minutes? What does an ER do with ten arrivals at once? How does a metro keep trains two minutes apart, or
-a toll gantry charge a truck at full speed? Why did a reactor explode at 01:23?
-
-This skill has your agent turn questions
-like these into a 3D world you can watch or click through. The world is built from researched facts and from models
-made to real dimensions.
+Visualize anything in 3D. Give your agent a subject: a place, a system, an object, a product, a creature, a story or an
+idea. The agent researches it, builds models to real dimensions, and makes a film, an app you click through, a lesson,
+a book or a game. It checks its own frames before it shows you anything.
<table>
<tr>
@@ -27,84 +23,126 @@ made to real dimensions.
</tr>
</table>
-It has eight modes:
-
-- **Live app**: a three.js app with a dashboard around a 3D world of the place. A seeded simulation moves the units and
- the numbers. The agent records a 30 s film by driving the app with real clicks on a virtual clock.
-- **Documentary film**: a 2 to 4 minute film of an event, told in order. It is built from a sourced fact file, a map,
- block-built scenes and flat glowing figures. Captions are timed for reading, and the score changes with the story.
-- **Quick prototype**: a live app in one pass from three.js primitives, with no Blender. Use it when you need something
- to show your leads this week.
-- **Live embed**: the 3D view as a web component (`<viz3d-world>`) or an iframe page that goes into the dashboard or
- product you already have. It reads your real data from REST, Server-Sent Events, WebSocket or a CSV export through a
- field mapping file, so a new feed needs no code change. Tokens stay on your backend.
-- **Lesson app**: a step-by-step lesson on a real object at real size, such as an Arduino and a breadboard. Parts and
- wires plug in as they do on a desk. The highlighted code line is what the board does right now. A free bench lets
- the learner build their own circuit.
-- **Action short**: creatures, machines or characters doing something, such as a fight, a chase or a launch. Every
- move is planned beat by beat, and every hit lands on a visible contact. The agent checks the frames for hidden or
- mistimed actions before it shows you the film.
-- **Book**: an illustrated cutaway plate of one big object or building, such as a liner or a castle, in 3D. You orbit
- it, read the margin labels and fly into any room, each full of small people at work. Several subjects make a
- page-turning book with a short quiz on each page.
-- **Game**: a free browser game people play. The player steers one creature or unit through an open world that pushes
- back, grows by playing, and starts again from a death card. Bots play it before you do, to balance it and to find
- stuck states.
-
-| Live app | Documentary film |
-|---|---|
-| ![A canal lock app: a container ship selected, its card open on the right, and the stage timeline at the bottom](docs/images/live-app.jpg) | ![A documentary map: a red route from a farm to a hardware store across a county](docs/images/documentary.jpg) |
-| **Quick prototype** | **Live embed** |
-| ![An electric bus depot built from three.js primitives, with pantograph chargers over the buses](docs/images/quick-prototype.jpg) | ![A transit company dashboard with the 3D depot view inside it, a bus card open and a live status mark](docs/images/live-embed.jpg) |
-| **Lesson app** | **Stage cameras** |
-| ![An Arduino lesson: an LED fading on a breadboard, the current code line highlighted and the PWM signal drawn on the right](docs/images/lesson-app.jpg) | ![A metro app with the stage bar at the top and the speed controls at the bottom](docs/images/stages.jpg) |
-| **Action short** | **Book (cutaway plate)** |
-| ![A steam-driven mechanical spider walking over pipes on a prototype grid](docs/images/action.jpg) | ![An illustrated cutaway plate of RMS Titanic with labelled rooms and the people aboard](docs/images/book.jpg) |
-| **Game** | **Layer build look** |
-| ![A browser game: a swarm of red worms spreading through a low-poly forest, with the worm count in the corner](docs/images/game.jpg) | ![A city built up layer by layer, shown here at its white model stage](docs/images/layer-build.jpg) |
-| **Glow look** | **ASCII look** |
-| ![A cockroach drawn in glowing ASCII glyphs on a dark dithered floor](docs/images/glow.jpg) | ![An ASCII dungeon game: the hero and a spell drawn in glyphs inside a cave](docs/images/ascii.jpg) |
-
-A real place starts from its real layout. The agent draws the plan from OpenStreetMap data and
-builds the 3D world on the same coordinates, so the two line up. Things then work as they do in reality. Aircraft
-follow the taxiway centre lines and give way to each other. Jet bridges and service vehicles attach to the real doors
-and ports, and the agent measures every gap before it records.
+## Start in three steps
-![Singapore Changi: the aerodrome plan drawn from OpenStreetMap on the left, the same layout in 3D on the right](docs/images/real-place.jpg)
+1. [Install](#install) the plugin.
+2. Type `/viz3d` with nothing after it. The agent shows the menu of modes and looks.
+3. Type a mode, a look if you want one, and the subject: `/viz3d film white model the Chernobyl accident`.
+
+You can also skip the command and ask in your own words. The agent picks the mode and the look from the subject.
+
+## What do you want to make?
+
+| You want to | Type |
+|---|---|
+| Tell a story or an event as a film | `/viz3d film the 1906 San Francisco earthquake` |
+| Show creatures, machines or characters in action | `/viz3d action two mechs fighting in a flooded city` |
+| Show off one object, product or model | `/viz3d showcase glow a cockroach` |
+| Show how a place or a system runs | `/viz3d app a container port` |
+| Teach how a thing works, step by step | `/viz3d lesson an Arduino that fades an LED` |
+| Open up one big object or building, room by room | `/viz3d book the Titanic` |
+| Let people play it | `/viz3d game pixel a worm that eats its way through a city` |
+| Show your leads something this week | `/viz3d prototype our warehouse, from last week's CSV export` |
+| Put a live 3D view in your own dashboard | `/viz3d embed our fleet, the feed is at /api/fleet/events` |
+
+## Modes
+
+The nine modes fall into three groups, by what people do with the result.
+
+**Watch it**
+
+- **Documentary film** (`film`): a 2 to 4 minute film of an event, told in order. It is built from a sourced fact
+ file, a map, block-built scenes and flat glowing figures. Captions are timed for reading, and the score changes with
+ the story.
+- **Action short** (`action`): creatures, machines or characters doing something, such as a fight, a chase or a
+ launch. Every move is planned beat by beat, and every hit lands on a visible contact. The agent checks the frames for
+ hidden or mistimed actions before it shows you the film.
+- **Showcase** (`showcase`): a film or a set of stills that shows off one object, product or model. The model stays
+ clean while the world around it turns to ASCII or glow.
+
+**Explore it**
+
+- **Live app** (`app`): a three.js app with a dashboard around a 3D world of the place. A seeded simulation moves the
+ units and the numbers. The agent records a 30 s film by driving the app with real clicks on a virtual clock.
+- **Lesson app** (`lesson`): a step-by-step lesson on a real object at real size, such as an Arduino and a
+ breadboard. Parts and wires plug in as they do on a desk. The highlighted code line is what the board does right
+ now. A free bench lets the learner build their own circuit.
+- **Book** (`book`): an illustrated cutaway plate of one big object or building, such as a liner or a castle, in 3D.
+ You orbit it, read the margin labels and fly into any room, each full of small people at work. Several subjects
+ make a page-turning book with a short quiz on each page.
+- **Game** (`game`): a free browser game people play. The player steers one creature or unit through an open world
+ that pushes back, grows by playing, and starts again from a death card. Bots play it before you do, to balance it
+ and to find stuck states.
+
+**Put it in your product**
+
+- **Quick prototype** (`prototype`): a live app in one pass from three.js primitives, with no Blender. Use it when you
+ need something to show your leads this week.
+- **Live embed** (`embed`): the 3D view as a web component (`<viz3d-world>`) or an iframe page that goes into the
+ dashboard or product you already have. It reads your real data from REST, Server-Sent Events, WebSocket or a CSV
+ export through a field mapping file, so a new feed needs no code change. Tokens stay on your backend.
+
+| Documentary film | Action short |
+|---|---|
+| ![A documentary map: a red route from a farm to a hardware store across a county](docs/images/documentary.jpg) | ![A steam-driven mechanical spider walking over pipes on a prototype grid](docs/images/action.jpg) |
+| **Showcase** | **Live app** |
+| ![A cockroach drawn in glowing ASCII glyphs on a dark dithered floor](docs/images/glow.jpg) | ![A canal lock app: a container ship selected, its card open on the right, and the stage timeline at the bottom](docs/images/live-app.jpg) |
+| **Lesson app** | **Book** |
+| ![An Arduino lesson: an LED fading on a breadboard, the current code line highlighted and the PWM signal drawn on the right](docs/images/lesson-app.jpg) | ![An illustrated cutaway plate of RMS Titanic with labelled rooms and the people aboard](docs/images/book.jpg) |
+| **Game** | **Quick prototype** |
+| ![A browser game: a swarm of red worms spreading through a low-poly forest, with the worm count in the corner](docs/images/game.jpg) | ![An electric bus depot built from three.js primitives, with pantograph chargers over the buses](docs/images/quick-prototype.jpg) |
+| **Live embed** | **Stage cameras in a live app** |
+| ![A transit company dashboard with the 3D depot view inside it, a bus card open and a live status mark](docs/images/live-embed.jpg) | ![A metro app with the stage bar at the top and the speed controls at the bottom](docs/images/stages.jpg) |
Every live app has stage cameras on number keys, a guided tour, follow camera and playback from 0.25x to 10x, as in
the metro app above.
-There are twelve looks:
-
-| Look | Fits |
+## Looks
+
+The twelve looks fall into four families. Put the look word in your command, or leave it out and the agent uses the
+default look for the mode.
+
+| Family | Look | Word | Fits |
+|---|---|---|---|
+| Clean product | Clean ops world | `ops` | The default for a system that runs: a white-grey world with one accent colour, framed like a real operations product |
+| | Toy isometric | `toy` | A friendly diorama of a place or system |
+| | Lived-in isometric | `lived-in` | Ordinary buildings where people live or work and a crisis plays out inside |
+| Real and cinematic | Photoreal terrain | `terrain` | Something spreading over real land, such as a wildfire or a flood |
+| | Dark documentary | `documentary` | A case or an event told as a film |
+| | White model documentary | `white model` | A case told as an architect's white model |
+| | Layer build film | `layer build` | One locked aerial camera while a place is built up layer by layer |
+| Technical | Point-cloud survey | `point cloud` | A scanned, technical view of land, sea or a site |
+| | Illustrated cutaway plate | `plate` | One big object or building cut open, for the book mode |
+| Stylized art | Pixel diorama | `pixel` | Pixel-art sprites on a 3D stage, for battles, games and small worlds |
+| | Dither + ASCII showcase | `ASCII` | A film that shows off a model, a tool or a product: the model stays clean, the world around it turns to ASCII |
+| | Gradient glow ASCII | `glow` | A creature or object that is itself the art, drawn in glowing ASCII |
+
+| Layer build | ASCII |
|---|---|
-| Clean ops world | The default for a system that runs: a white-grey world with one accent colour, framed like a real operations product |
-| Toy isometric | A friendly diorama of a place or system |
-| Lived-in isometric | Ordinary buildings where people live or work and a crisis plays out inside |
-| Point-cloud survey | A scanned, technical view of land, sea or a site |
-| Photoreal terrain | Something spreading over real land, such as a wildfire or a flood |
-| Dark documentary | A case or an event told as a film |
-| White model documentary | A case told as an architect's white model |
-| Pixel diorama | Pixel-art sprites on a 3D stage, for battles and small worlds |
-| Illustrated cutaway plate | One big object or building cut open, for the book mode |
-| Dither + ASCII showcase | A film that shows off a model, a tool or a product: the model stays clean, the world around it turns to ASCII |
-| Gradient glow ASCII | A creature or object that is itself the art, drawn in glowing ASCII |
-| Layer build film | One locked aerial camera while a place is built up layer by layer |
-
-Name a look in your request, or let the agent pick one from the subject.
+| ![A city built up layer by layer, shown here at its white model stage](docs/images/layer-build.jpg) | ![An ASCII dungeon game: the hero and a spell drawn in glyphs inside a cave](docs/images/ascii.jpg) |
-## What is new
+Default looks: apps, prototypes, embeds and lessons use clean ops world. Films use dark documentary, showcases use
+Dither + ASCII and books use the cutaway plate. You can show the agent a reference video of a new look. It studies the
+frames and writes the look up for next time.
-- Films and stills render in [67js](https://github.com/codepawl/67.js) when it is installed. Films longer than one
- render job are split, joined and checked: tested on a 70 s film with no jump or sound gap at the joins.
-- Pictures of the action, book and game modes and of the layer build, glow and ASCII looks.
-- The `game` mode: a playable browser game, balanced by bot playtests.
-- Six more looks: clean ops world, lived-in isometric, white model documentary, Dither + ASCII showcase, gradient glow
- ASCII and layer build film.
-- A longer self-review fault list: contact and support checks, camera flights measured against every mesh, vehicles
- that steer and roll like the real ones, and sound faults.
-- A fast low-quality preview of the whole film goes to you first. The full render waits for your sign-off.
+## Real places
+
+A real place starts from its real layout. The agent draws the plan from OpenStreetMap data and builds the 3D world on
+the same coordinates, so the two line up. Things then work as they do in reality. Aircraft follow the taxiway centre
+lines and give way to each other. Jet bridges and service vehicles attach to the real doors and ports, and the agent
+measures every gap before it records.
+
+![Singapore Changi: the aerodrome plan drawn from OpenStreetMap on the left, the same layout in 3D on the right](docs/images/real-place.jpg)
+
+## How the agent works
+
+1. It writes a plan file: the real parts of the subject, what moves, the beats, the look and the camera.
+2. It gets the models: ready models and scans first, then Blender builds from reference pictures.
+3. It builds the app or the film from the plan file.
+4. It checks its own frames on contact sheets for up to three rounds and fixes what it finds.
+5. It sends you a fast low-quality preview of the whole film. The full render waits for your sign-off.
+
+The skill asks before it downloads anything, such as elevation data, map data or reference images.
## Install
@@ -146,30 +184,7 @@ Gemini CLI and OpenCode take slash commands from their own folders. To get `/viz
| Gemini CLI | `harness/gemini/viz3d.toml` | `~/.gemini/commands/` |
| OpenCode | `harness/opencode/viz3d.md` | `~/.config/opencode/commands/` |
-## Use
-
-Start it with the command, a mode and the subject:
-
-```text
-/viz3d film the 1906 San Francisco earthquake
-/viz3d app a container port
-/viz3d action two mechs fighting in a flooded city
-/viz3d book the Titanic
-/viz3d game a worm that eats its way through a city
-```
-
-| Mode | What you get |
-|---|---|
-| `app` | Live app with a dashboard and a 30 s film |
-| `lesson` | Lesson app that builds a real object step by step |
-| `prototype` | Quick prototype from three.js primitives, no Blender |
-| `embed` | Live embed for your dashboard, on your real data |
-| `film` | Documentary film |
-| `action` | Action short: creatures, machines or characters doing something |
-| `book` | Illustrated cutaway plate of one subject, or a page-turning book of several, with quizzes |
-| `game` | Playable browser game, balanced by bot playtests |
-
-Leave the mode out and the agent picks one from the subject. How you type the command depends on the agent:
+How you type the command depends on the agent:
| Agent | Command |
|---|---|
@@ -179,18 +194,7 @@ Leave the mode out and the agent picks one from the subject. How you type the co
| Cursor | `/viz3d` |
| Gemini CLI, OpenCode | `/viz3d`, after you copy the command file |
-You can also just ask for what you want to see, for example:
-
-- "Visualize how a container port works."
-- "Show how a city metro keeps its trains apart."
-- "Build Singapore Changi Airport from its real layout and show a turnaround."
-- "Make an Arduino lesson app that goes one circuit at a time."
-- "Make a documentary-style 3D film of the 1906 San Francisco earthquake."
-- "Make a quick 3D prototype of our warehouse for Monday's leadership review. Here is last week's CSV export."
-- "Put a live 3D view of our fleet in our ops dashboard. The feed is at /api/fleet/events."
-
-The agent writes a topic file first, then builds the models, then the app or the film. It checks its own film on
-contact sheets before it shows you anything.
+## Live embed
For a live embed, the agent builds a web component and an iframe page. Put the component in any page and point it at
your feed:
@@ -207,7 +211,7 @@ that only takes a URL, use `embed.html?source=...` in an iframe. To test without
## Films and stills with 67js
Apps, lessons, embeds and games stay in three.js, because people click and steer them. Documentaries, action shorts,
-cutaway films, showcase films and stills render in [67js](https://github.com/codepawl/67.js) when it is installed:
+showcases, cutaway films and stills render in [67js](https://github.com/codepawl/67.js) when it is installed:
- Terrain, scanned trees and grass, baked liquid, vehicles on paths, skinned characters, HDRI light and baked room
light come as addons.
@@ -215,6 +219,8 @@ cutaway films, showcase films and stills render in [67js](https://github.com/cod
three looks as branches and shows you the grid to pick from.
- A timeline of shots with fades and depth of field drives the clock, so any frame renders the same in any order.
- Render jobs export PNG and MP4 with the soundtrack and an audio sync check. Memory is planned before it is used.
+- Films longer than one render job are split, joined and checked. A 70 s test film showed no jump or sound gap at the
+ joins.
Set it up in your project:
@@ -245,7 +251,15 @@ The last command adds the 67js skills (`build-67js-scene` and `render-67js-media
prototypes and embeds never need it.
- [67js](https://github.com/codepawl/67.js) is optional. It renders the films and stills, as described above.
-The skill asks before it downloads anything, such as elevation data, map data or reference images.
+## What is new
+
+- viz3d now covers any subject, not only things that are hard to understand.
+- The `showcase` mode: a film or stills that show off one object, product or model.
+- `/viz3d` with nothing after it shows the menu. The menu groups the modes by what people do with them and the looks by family.
+- Films and stills render in [67js](https://github.com/codepawl/67.js) when it is installed.
+- The `game` mode: a playable browser game, balanced by bot playtests.
+- A longer self-review fault list: contact and support checks, camera flights measured against every mesh, vehicles
+ that steer and roll like the real ones, and sound faults.
## Also in this repository