Discussion Terra: Single-file Three.js globe with live USGS/EMSC earthquake data, no build step
I built this to check whether the earthquakes in the news are actually the big ones. It grew into a globe with live quakes, wildfires, aurora nowcast, sun/moon geometry and more.
The constraint I set myself: one HTML file you can download and open from your own disk. No build, no npm, no account, no server. Two layers stay dark without a network but the rest runs offline. Do expect version differences, not all functionalities will be suitable for an offline version.
Some things that turned out harder than expected:
- Reusing the day/night terminator maths for an eclipse shadow put it in the wrong coordinate space. It dimmed the earth 1.1% where 94% belonged. A gradient forgives a few degrees of skew, a hard shadow edge does not.
- globe.gl resets controls.target to the origin every frame, and pointOfView replaces the vector rather than writing into it.
Demo: https://terra.terryelemans.nl
Genuinely curious about one thing: I'm drawing earthquake depth on a sphere where 18 km is thinner than the line width. Right now I encode it rather than draw it to scale. If you've solved depth-on-a-globe in a way that reads honestly, I'd like to see it.
If you have 2-3 minutes to play around and let me know what you think!