# Compass in the fused viewers; web-optimized stack MP4s

2026-10-29 · Claude Code chat `cc5ffe8f` (dispatched by domain-manager `c1192f49`) · Stephen: "add a north compass rose that I can click on and that always shows direction to north"

## 1. Compass rose, fused viewers

Files: `artifacts/rop/lynn-shore-nahant-circle/v2/index-fused.html` and `../index-fused-v1.html`. The v1 change set is identical to v2's. Backups are `*.bak-20261029-pre-compass`. `../index-fused.html` is only a redirect, so it is unchanged.

The CSS, button SVG, 3D click (orbit to face north) and per-frame rotation are the same as in `v2/index.html`. True north in the grid frame is `(cb, 0, -sb)`. The fused 2D view is not three.js; it is a canvas `drawImage` of the ortho tile (column along +X, row down = grid -y). So:

- The 2D transform is now `screen = (ox, oy) + s·R(rot2)·(i, j)`. Wheel zoom and drag pan are unchanged, since they hold for any rotation.
- At rot2 = 0, north is `atan2(cb, sb)` clockwise from up (43.93° for bearing 46.07).
- A click toggles `rot2 = -atan2(cb, sb)`, rotating about the screen centre at the same zoom.
- `fit2d` (double-click) fits the rotated bounding box.
- `__rop.compass()` exposes `{deg, z2, grid}` for tests.

Chrome verification (stephenguerin.live, cache-busted):

| check | v2 fused | v1 fused |
|---|---|---|
| 3D rose at load (camera az 190°) | -10° | -10° |
| 3D after click | 0° | 0° |
| 2D rose | 43.9° | 43.9° |
| 2D pixel north from the canvas transform and `grid.json` enu_affine | 43.930° | 43.930° |
| 2D after click (rose / pixel north) | 0° / 0.00004° | 0° / 0.00004° |
| console errors | none | none |

As a cross-check, a placed Google 2D tile's north edge in `v2/index.html` (NW minus SW, `atan2(dX, -dZ)`) is 43.930°, so the fused 2D frame agrees with the Google tiles.

## 2. Web-optimized stack MP4s

Command (libx264, `-preset slow -bf 0 -sc_threshold 0 -profile:v high -level:v 5.1 -pix_fmt yuv420p -movflags +faststart -an`, same size and fps):

- 8K and fused stacks: CRF 23, `-g 15 -keyint_min 15`.
- Nahant: CRF 23 with GOP 15 grew the file 4.6x (59.0 MB), because the source is a 276 kbps webcam stream. CRF 28 with GOP 30 was smaller and seeked faster, so it is the `.web.mp4`.

Originals are untouched. Viewers point `<video src>` at `.web.mp4`; the meta row links the original as "MP4 (master)".

| file | master MB / Mbps / keyframes | web MB / Mbps / keyframes | SSIM (PSNR dB) |
|---|---|---|---|
| v2/stack_PT0.033S | 20.0 / 10.9 / 2 | 19.8 / 10.8 / 30 | 0.9887 (42.1) |
| v2/stack-fused_PT0.033S_kz7w | 25.3 / 13.8 / 2 | 23.3 / 12.7 / 30 | 0.9874 (41.3) |
| stack_PT0.033S (v1) | 22.4 / 12.2 / 2 | 21.8 / 11.9 / 30 | 0.9883 (41.8) |
| stack-fused_PT0.033S_kz7w (v1) | 29.1 / 15.9 / 2 | 26.7 / 14.6 / 30 | 0.9869 (40.9) |
| stack-nahant_PT0.033S_kz7w (shared) | 12.9 / 0.28 / 45 | 24.9 / 0.54 / 370 | 0.9911 (43.3) |

Seek time in Chrome, from setting `currentTime` to `seeked`, over 10 fixed pseudo-random frames, median / mean / max ms:

| file | master | web |
|---|---|---|
| v2/stack (fully buffered) | 157 / 193 / 494 | 23 / 24 / 51 |
| v2/stack-fused (fully buffered) | 144 / 174 / 455 | 17 / 20 / 41 |
| nahant (within the buffered first 15 s) | 66 / 57 / 110 | 12 / 12 / 14 |
| nahant (cold, across 370 s, network-bound) | 456 / 557 / 1510 | 345 / 249 / 419 |

Arrow-key steps in the v1 fused viewer, measured to `seeked`, took 10 to 25 ms. All-intra (`-g 1`) was not needed. The root 8K and fused web files were not seek-timed, because the shared Chrome restarted twice. Their encodes match the v2 ones.

Not done: no mirror and no wrangler deploy (the devops replica-refresh lane will pick the files up).
