Files
lilygo-t-deck/tron-room-demo/README.md
T
Dejvino 897361c881 Add tron-room-demo: orbiting top-down 3D view of the NetDeck demo map
Copy of the tron-demo emulator-only template with a new RoomView sketch
that renders the real demo floorplan (src/netdeck/nd_demomap.h, consumed
through MapSource) as an orbiting pseudo-3D flythrough: extruded shaded
boxes for walls/crates/door/terminal, network pylons with link packets,
patrolling entities, distance fog and checker floor. Makefile adds an
include path to ../src/netdeck instead of copying the map headers.
2026-11-16 21:45:56 +01:00

74 lines
2.7 KiB
Markdown

# tron-room-demo — RoomView
A top-down "3D" flythrough of **NetDeck's demo map**, built on the same
emulator-only template as `tron-demo` (SDL3 host, 320x240 ABGR8888
framebuffer, `setup()`/`loop()` sketch contract — see the original
template README below).
What makes this one different: the sketch renders the **real** Breach &
Board demo floorplan from the firmware tree (`src/netdeck/nd_demomap.h`,
consumed through the generic `MapSource` interface). There is no local
copy of the map — edit the demo map in `src/netdeck` and this view
follows it.
## What you see
- A true 3D orbiting camera (position + look-at basis, perspective
divide) drifting over the deck on a slow orbit with breathing
radius/height.
- `#` walls, `o` cover crates, the `+` blast door and the `T` terminal
as solid shaded boxes: backface culling, painter's-algorithm depth
sort, lambert lighting from above, distance fog, bright top rims.
- Floor tiles as lit quads with a subtle checker.
- The demo map's **network graph** as glowing pylons with teal link
lines and cyan packets traveling along the edges.
- Every entity from the demo spawn list walking its patrol route
(marines cyan, droids orange, heavy red, turrets magenta), plus a
pulsing halo over the airlock.
## Keys
| Key | Action |
|-----|--------|
| `a` / `d` | orbit faster / slower (or reverse) |
| `w` / `s` | zoom in / out |
| `r` / `f` | raise / lower the camera |
| `space` | pause the camera drift + patrols |
| `q` / ESC | quit |
## Build & Run
```bash
make run # build + open a window
make smoke # headless: 240 frames -> smoke_frame.bmp
make clean
```
The Makefile is the template's, with two changes: `APP ?= RoomView`
and `-I ../../src/netdeck` on the include path.
## Safety hatch / CLI options
Same as the template: `--user-run` (run indefinitely), `--timeout MS`,
`--frames N`, `--dump PATH`. By default the emulator exits after 10 s;
use `./RoomView-emu --user-run` for interactive viewing.
---
# T-Deck Emulator-Only Template (original README)
A minimal, self-contained SDL3 emulator template for prototyping 320x240
graphics/engine experiments without any hardware. No TFT_eSPI, no SPI,
no I2S, no GPIO — just SDL3 and a framebuffer.
**Do not** edit `src/main.cpp` or `shim.h` — they are the host and are
app-agnostic. The sketch lives in `examples/$(APP)/$(APP).cpp` and is
compiled as a single translation unit with the host via `-DAPP_SRC=…`.
| Flag | Description |
|------|-------------|
| `--user-run` | Disable the 10 s auto-exit (interactive use) |
| `--timeout MS` | Auto-exit after MS milliseconds (default 10000) |
| `--frames N` | Exit after N frames instead |
| `--dump PATH` | Save the last frame to PATH (BMP) |