tss web 3d viewer

This commit is contained in:
FURRO404
2026-06-21 07:29:45 -07:00
parent 2e75909f2d
commit 38c11d83ee
8 changed files with 14792 additions and 22 deletions
@@ -36,16 +36,12 @@ captureState, tickets, teamNames, winnerSlot)
→ cached + served at `GET /api/tss/games/:id/replay-canvas`
`ReplayCanvasEngine` (in `frontend/src/ReplayCanvas.jsx`).
The raw rows already carry `y` (confirmed: e.g. `[29031, -10218.59, 69.74,
-2626.99]`); the renderer drops it. The map coords needed by 3D are already in
`replay_canvas.json`.
### Change
`render_replay.py`: include `y` in each emitted canvas path point (add a `y`
field, e.g. `{t, x, y, z}`). Backwards compatible — the 2D engine reads only
`t/x/z`. Cached JSONs without `y` regenerate on next `mtime` mismatch; until
then 3D falls back to `y = 0`.
**Update (verified during implementation):** `render_replay.py` *already* emits
`y` per canvas path point (`render_replay.py:4237``{t, x, z, y}`), and
`replay_canvas.json` already includes `captureAreas` (with `x/z/radius/center`),
`captureState` (cap timelines keyed `A/B/…`), `kills` (with `killerPos`/
`victimPos` in world coords), and all map coords. **No backend change is
needed.** 3D still falls back to `y = 0` if a point is missing.
### Runtime flow
@@ -66,9 +62,8 @@ then 3D falls back to `y = 0`.
## Components
### 1. `BOT/render_replay.py` (in `GitHub/BOTS/TSSBOT`)
Emit `y` per canvas path point. Single-field additive change at the point where
path points are serialized for the canvas JSON.
### 1. Backend / `render_replay.py`
No change — `y`, capture data, and kill positions are already emitted.
### 2. `frontend/src/ReplayCanvas3D.js` (new)
The ported three.js renderer as a UI-less class.