Skip to content

Anshler/mars-location-marker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mars Location Marker

License Vanilla JS No build step Three.js Bootstrap Nominatim

An interactive 3D globe that shows the direction of Mars from any location on Earth, at any point in time.

Features

  • 🔴 Real-time Mars direction from any Earth location
  • 🌍 Interactive 3D globe with atmosphere & starfield
  • 🕐 Timelapse animation across any date range
  • 📡 Topocentric position with light-travel time correction

Running Locally

npm start

Serves the app at http://localhost:8080. No build step required.

About

Built with vanilla JavaScript and Three.js, no bundler, no framework. The app runs entirely in the browser as ES modules loaded directly from index.html.

Mars's position is computed from first principles using Kepler's equation to solve for the heliocentric orbital positions of Earth and Mars. The direction is then converted to a topocentric vector, accounting for the observer's exact position on Earth's surface, with two iterations of light-travel time correction, so the line points where Mars was when the light you'd see today left it.

Earth's orientation uses Greenwich Mean Sidereal Time (GMST) so the globe rotates to match the real sky at any given moment. The atmosphere glow is a custom GLSL shader with Fresnel and sun-scattering terms, rendered with additive blending. A bloom post-processing pass (Three.js UnrealBloomPass) adds the final glow.

The orbital calculations are approximate, suitable for visualization, not navigation. If you spot a significant error in the math, please open an issue.

For Developers

See CLAUDE.md for architecture details, module structure, and rendering concepts.

Releases

No releases published

Packages

 
 
 

Contributors