Add a rotatable 3-D globe and a tectonic-plates layer toggle - #3
Merged
Conversation
The global map can now be drawn as an orthographic globe the user turns by
dragging (or with the arrow keys), and the per-plate colour wash has its own
checkbox alongside the other layers.
Both global views draw the same datasets in the same order and colours:
EarthCanvasNode owns everything they share, and each subclass supplies only
what depends on the shape of the world — the clip, the base map, and how a
polyline of lon/lat becomes a canvas path. Anything that draws geography,
including the plate labels and motion arrows, goes through the new
EarthProjection interface, whose project() reports whether a point is visible
as well as where it goes.
Three hazards are peculiar to the globe and are handled in GlobeCanvasNode:
- The limb. Polylines are cut where they cross it; filled outlines detour to
a ring outside the disc and skirt round to where they reappear, which the
disc clip trims into a clean edge.
- Long segments. The data was shaped for a flat map, where a straight line
between vertices is right — the Pacific plate's eastern edge climbs 66° of
latitude in one step, which on a globe is a chord straight through the
Earth. Segments are now sampled along their great circle every 5°.
- Dataset seams. Plates that straddle ±180° are stored slit open along it,
and polar plates closed off along the pole. Invisible at the edge of a flat
map; bright lines up the Pacific on a globe, so they are filled but not
stroked.
The relief raster is equirectangular, so the globe un-projects each pixel of
the disc and samples it into a texture, rebuilt only when the camera moves.
The globe's camera lives in the view and is reset by Reset All; the choice of
globe or flat map is model state, so the screen summary describes it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013LZwLXenFAnHm6QiVYK8Ld
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
The global map can now be drawn as an orthographic globe the user turns by
dragging (or with the arrow keys), and the per-plate colour wash has its own
checkbox alongside the other layers.
Both global views draw the same datasets in the same order and colours:
EarthCanvasNode owns everything they share, and each subclass supplies only
what depends on the shape of the world — the clip, the base map, and how a
polyline of lon/lat becomes a canvas path. Anything that draws geography,
including the plate labels and motion arrows, goes through the new
EarthProjection interface, whose project() reports whether a point is visible
as well as where it goes.
Three hazards are peculiar to the globe and are handled in GlobeCanvasNode:
a ring outside the disc and skirt round to where they reappear, which the
disc clip trims into a clean edge.
between vertices is right — the Pacific plate's eastern edge climbs 66° of
latitude in one step, which on a globe is a chord straight through the
Earth. Segments are now sampled along their great circle every 5°.
and polar plates closed off along the pole. Invisible at the edge of a flat
map; bright lines up the Pacific on a globe, so they are filled but not
stroked.
The relief raster is equirectangular, so the globe un-projects each pixel of
the disc and samples it into a texture, rebuilt only when the camera moves.
The globe's camera lives in the view and is reset by Reset All; the choice of
globe or flat map is model state, so the screen summary describes it.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_013LZwLXenFAnHm6QiVYK8Ld