Repository navigation
feat(examples): compare input and output pixel error in the reprojection explainer - #712
Merged
Merged
Conversation
Everything specific to the NLCD image (the image, its projections, the 49th parallel, the panel subtitles, kilometers per pixel, tolerance choices, and the text of steps 1 and 3) moves into an NLCD `Scenario`, which the scene builder, story, HUD, tuning panel and app take as input. The default explainer is unchanged; a test pins its hand-written text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xplainer A band of NASA Blue Marble imagery from 30°N to 85°N in longitude/latitude, rolled into a ring on a north polar stereographic map (EPSG:3413). Its two corners per side land on one meridian, so the 2-triangle mesh collapses the whole image onto a line: a far more dramatic first attempt than NLCD's. Its step 1 and step 3 text is a draft, marked "[Draft]". The tuning panel gets a Scenario select, and `?scenario=arctic` opens the explainer on it. Outline samples are set per image edge, since a band's top edge is a small circle on the map and its bottom edge a large one. The default-tolerance triangle count now runs up to 100,000 iterations: the library's 10,000 stopped the Arctic at 19,826 triangles of 33,830. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tuning panel's "Error measured" select, the M key, and `?metric=output` switch the explainer between the reprojector's two error spaces (`_errorSpace`): input pixels and output pixels. Each mode draws the gap it measures: input mode adds, in the input image, a line from each test point to where the GPU's drawn position maps back, and labels it there; output mode labels the gap on the map. In output mode the counter says "output px" and step 3 "output pixels". Step 3 now names where the 2-triangle mesh is worst instead of assuming the image center: in output pixels, NLCD's worst point is the middle of the top edge, where Web Mercator stretches the map most. The NLCD text is unchanged in input mode. Error labels sit past the true end of their gap and move beside their dot when that would cover the panel titles, the counter or the description, and the counter no longer wraps under a narrow map. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The closing caption's library-default count needs about 17,000 iterations for the Arctic band, the largest case. 100,000 left far more room than any scenario needs; the lower cap also bounds how long a scenario that never converges can block the page. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tuning panel is now a sidebar beside the slide instead of a panel floating over it, so it never hides the animation: open, the slide resizes into the space left. It starts collapsed to a slim rail, so viewers can find it without knowing to press H. On screens narrower than 700 px it floats instead, which would otherwise leave the slide too small. The keys are drawn as keycaps, and picking from a select hands focus back to the page so the presenter keys work right away. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mplemented Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
P for "panel" is easier to remember than H. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tion When the map fills its panel, as the Arctic ring does, the counter under it ended right where the description began. The description now starts 30 slide units lower; the longest one still ends well above the control bar. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kylebarron
marked this pull request as ready for review
October 14, 2026 20:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written by Claude (Claude Code) on behalf of @kylebarron, not by @kylebarron.
The reprojection explainer can now show the reprojector's two error spaces, input pixels and output pixels (
_errorSpace, from #711), and a second scenario where they differ strongly.Scenarios. The explainer is driven by a scenario: an image, its projections, a reference line and its text. NLCD (Albers → Web Mercator) stays the default and looks the same.
?scenario=arcticin the URL.Error space. The "Error measured" select, the M key, or
?metric=outputswitch between the two modes. Each mode draws and labels the gap it measures:Step 3 names where the 2-triangle mesh is worst, because that moves with the mode: in output pixels, NLCD's worst point is the middle of the top edge, not the center. The library-default triangle count in the closing caption is computed per scenario and mode, capped at 25,000 iterations.
Tuning panel. It's now a sidebar beside the slide, so it never covers the animation. It starts collapsed to a slim rail, and P (for "panel", formerly H) opens it. On screens under 700 px wide it floats instead. The keys are drawn as keycaps.
Layout fixes. Error labels stay clear of the panel titles, the counter and the description; the counter no longer wraps under a narrow map; and the description sits lower, clear of the counter when the map fills its panel.
README: the scenarios, the error metric, the keys, and commands that regenerate the Arctic image from NASA's source.
The Arctic image is NASA Earth Observatory's Blue Marble Next Generation (July 2004), which is free to use with credit, cropped and resampled to 2048×313 px.
To try it:
pnpm install pnpm build cd examples/explainers/reprojection-explainer pnpm devThen open
?scenario=arctic,?metric=output, or both.Closes #708
🤖 Written by Claude Code