Skip to main content
100%

Mars on a WebGL globe

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Oct 5, 2019
Created on Sep 8, 2016

This interactive visualization presents a rotating Mars globe rendered on a canvas using WebGL, with the planet’s surface displayed as a color mosaic from USGS imagery. Users can drag to spin the globe, which is overlaid with white markers, semi-transparent polygons, and red links depicting mission-related paths and regions. The implementation relies on D3 v5, including `d3.geoPath` and its projection tools, to compute the orthographic projection and mouse event handling. A custom WebGL fragment shader performs the inverse projection and pixel blending directly on the GPU, while SVG layers for polygons, links, and mission highlights sit atop the canvas.

AI-generated description

Preparatory work for <a href="http://bl.ocks.org/Fil/1c2f954201523af16280db018ddd90cc">Missions to Mars</a>.

 

Problems solved:

-- invert geoOrthographic (instead of geoStereographic).

-- what to do for pixels outside the globe

-- white artifacts on the boundary of the jpg image (they were on the original image!)

-- upgrade to d3 v4.

-- made sure the image's center has lonlat = [0,0]

-- got rid of the pesky dot in the center on iPhone (reported by Harry Stevens)

Forked from @mbostock's Milky Way block. License GPL-3.

Image: <a href="http://astrogeology.usgs.gov/search/details/Mars/Viking/MDIM21/Mars_Viking_MDIM21_ClrMosaic_global_232m/cub">USGS</a>.

mit Licensed

Similar vizzes