📚 Moonfall Blog

The Science Behind Lunar Impact Simulations

Published: May 5, 2025

What would actually happen if the Moon collided with Earth? While this scenario is purely hypothetical (the Moon is actually moving away from Earth at 3.8 cm per year), scientists have modeled similar impact events throughout solar system history. The Earth-Moon system is believed to have formed from a giant impact between proto-Earth and a Mars-sized body called Theia approximately 4.5 billion years ago.

Our simulation visualizes this cataclysmic scenario through several scientifically-inspired phases: tidal disruption, atmospheric heating, crustal fracturing, and finally complete planetary destruction. Each phase represents real physical processes, albeit dramatically accelerated for visual effect.

The simulation uses real NASA planetary textures and integrates live weather data to show how the target location's conditions evolve during the approach. While simplified for web performance, the multi-phase destruction sequence draws inspiration from computational astrophysics models of planetary collisions that scientists use to study the formation of our solar system.

In reality, if such an impact were to occur, the energy released would be equivalent to billions of nuclear weapons detonating simultaneously. The Earth's crust would melt, the atmosphere would be stripped away, and the resulting debris would likely form a new ring system around what remained of our planet.

How We Built a 3D Planet Simulator in the Browser

Published: April 28, 2025

Building an interactive 3D solar system simulation that runs entirely in a web browser required combining several powerful technologies. At its core, our simulation uses Three.js, a powerful WebGL library that enables GPU-accelerated 3D graphics directly in the browser without any plugins or downloads.

Three.js handles all the complex mathematics of 3D rendering: vertex transformations, lighting calculations, texture mapping, and shader programs. Our Earth globe uses a high-resolution 2048x2048 texture from NASA's Blue Marble collection, combined with specular maps for realistic ocean reflections and cloud layers for atmospheric depth.

For location searching, we integrated OpenStreetMap's Nominatim geocoding service, which converts city names to precise latitude/longitude coordinates. Real-time weather and air quality data comes from the Open-Meteo API, a free and open-source weather service. The most challenging aspect was creating the multi-phase destruction sequence with custom GLSL shaders and InstancedMesh for 10,000+ debris particles.

All of this runs on Cloudflare's global edge network, meaning the simulation loads quickly from anywhere in the world. The entire application is a single HTML file with no backend server required, making it incredibly portable and easy to host.

Understanding Planetary Collision Physics

Published: April 20, 2025

Planetary collisions are among the most energetic events in the universe. When two planet-sized bodies collide, the kinetic energy involved is almost incomprehensible. For context, the Chicxulub impact that killed the dinosaurs released energy equivalent to about 100 million megatons of TNT. A Moon-sized impactor would release roughly 10 billion times more energy.

Our simulation simplifies several aspects of the physics for visual clarity. In reality, tidal forces would begin tearing the Moon apart long before impact at the Roche limit, approximately 9,500 kilometers from Earth's center. The simulation's four phases represent the major stages of a real catastrophic impact event, compressed into a 60-second timeline. After a real impact of this magnitude, the Earth would likely be completely destroyed, with debris forming a new asteroid belt around the Sun.

Real-Time Data Integration in Web Simulations

Published: April 15, 2025

One of the unique features of our Moonfall simulator is its integration of real-time environmental data. When you select a target location, the simulation fetches current weather conditions, air quality metrics, and local time for that exact spot on Earth. This data then dynamically updates as the Moon approaches, showing how conditions would deteriorate during a real impact event.

The weather data comes from Open-Meteo's API, which aggregates data from multiple national weather services. Air quality information including PM2.5 and PM10 particulate matter levels is sourced from the same service. The location name and coordinates are resolved using OpenStreetMap's Nominatim reverse geocoding. During the approach phase, we artificially ramp up values to reflect scientific predictions: temperatures beyond 2,000°C, supersonic winds, and hazardous AQI levels.

How Real-Time Weather Data Enhances Space Simulations

Published: May 6, 2025

One of the most compelling aspects of modern web simulations is their ability to integrate real-world data. In Moonfall, we connect to the Open-Meteo API to fetch live weather conditions for any location on Earth. This means when you select a target city, you are seeing actual temperature, wind speed, humidity, and air quality readings for that exact spot at that exact moment. This connection between the virtual and real worlds adds a layer of authenticity that static simulations cannot match.

The Open-Meteo API is a free and open-source weather service that aggregates data from multiple national weather agencies, including NOAA, DWD, and JMA. During the simulation, we artificially amplify these values to reflect the catastrophic environmental changes a lunar impact would cause, based on real planetary science research and impact modeling studies.

The Technology Stack Powering Moonfall

Published: May 3, 2025

Moonfall is built on a carefully selected stack of modern web technologies. At its foundation is Three.js, the most popular WebGL library for creating 3D graphics in the browser. Our simulation uses Three.js version 0.157 with optimized instanced mesh rendering for the debris particle system. For geolocation, we use OpenStreetMap's Nominatim API to convert place names into geographic coordinates with remarkable accuracy.

The entire application is hosted on Cloudflare Pages, which deploys directly from GitHub. Cloudflare's global edge network ensures fast loading worldwide, with automatic HTTPS, DDoS protection, and bot mitigation. Because the simulation is entirely client-side with no backend server, hosting costs are zero and scaling is handled automatically.

Educational Applications of Planetary Impact Simulations

Published: May 1, 2025

Interactive simulations like Moonfall are increasingly being recognized as valuable educational tools. Research shows that students learn complex concepts more effectively when they can interact with visual models rather than passively reading about them. A planetary impact simulation allows learners to explore orbital mechanics, kinetic energy, atmospheric physics, and geological transformation in an engaging, hands-on way.

For classroom use, Moonfall can serve as a springboard for discussions about the history of our solar system. Scientists believe the Earth-Moon system formed from a giant impact 4.5 billion years ago. By visualizing a similar impact, the simulation helps make this abstract scientific theory tangible and memorable. The entire project is open-source, making it an accessible starting point for anyone interested in creative coding or educational technology.

Understanding the Roche Limit: When Moons Break Apart

Published: May 7, 2025

The Roche limit is one of the most fascinating concepts in planetary physics. Named after French astronomer Édouard Roche, it describes the distance at which a celestial body held together only by its own gravity will disintegrate due to tidal forces from a larger body. For the Earth-Moon system, this critical distance is approximately 9,500 kilometers from Earth's center.

In our Moonfall simulation, we take creative liberty by allowing the Moon to remain intact until impact. However, the real physics is equally dramatic. Tidal forces would create enormous stress fractures throughout the lunar crust, followed by catastrophic disintegration. The resulting debris would form a temporary ring around Earth, similar to Saturn's rings but composed of rocky material. Understanding the Roche limit helps astronomers predict exoplanet behavior and explains planetary ring formation throughout our solar system.

The Role of WebGL in Modern Scientific Visualization

Published: April 25, 2025

WebGL has revolutionized how scientific concepts can be communicated to the public. Before WebGL, creating interactive 3D visualizations required plugins like Flash or Java. Now, any modern browser can render complex 3D scenes with hardware acceleration. Three.js sits on top of WebGL and provides an intuitive API, democratizing 3D web development.

The impact of WebGL extends far beyond entertainment. Medical researchers visualize complex biological structures, architects present designs in interactive 3D, and climate scientists create global temperature models. Moonfall represents just one example of how this technology can make abstract scientific concepts tangible and engaging for a global audience.

Why Open Data Matters for Science Education

Published: April 18, 2025

Moonfall would not be possible without the growing movement toward open data. NASA's planetary texture library, OpenStreetMap's geocoding service, and Open-Meteo's weather API are all freely available. NASA's commitment to open access through the Blue Marble project and Planetary Data System has made decades of space imagery available at no cost.

The open data movement extends beyond government agencies. OpenStreetMap, maintained by a global community of volunteers, processes millions of location queries daily without charging a cent. Services like these demonstrate that freely shared data can power an entire ecosystem of applications, from navigation apps to scientific simulations like Moonfall.

How NASA Captures Planetary Images from Space

Published: May 8, 2025

NASA's planetary images are among the most stunning visual achievements of the space age. The iconic Blue Marble image of Earth was captured by the Suomi NPP satellite using VIIRS, an instrument that scans in multiple spectral bands. The images of Jupiter used in our simulation come from the Juno spacecraft, which orbits the gas giant at speeds exceeding 200,000 kilometers per hour.

The process of turning raw spacecraft data into polished images is equally fascinating. Raw images contain sensor noise, calibration artifacts, and geometric distortions that must be corrected by imaging specialists. The result is images that are both scientifically accurate and visually stunning, freely available for projects like Moonfall.

The Physics of Impact Craters on Earth and Beyond

Published: May 4, 2025

Impact craters are among the most dramatic geological features in our solar system. On Earth, approximately 190 confirmed impact structures have been identified, from the tiny 15-meter Haviland Crater in Kansas to the massive 300-kilometer Vredefort Crater in South Africa. Each crater tells a story of cosmic violence frozen in stone.

The process of crater formation occurs in distinct stages: contact and compression, excavation, and modification. While Earth's active geology has erased most ancient craters through erosion, the Moon's surface preserves a more complete impact record. By studying these features, scientists can estimate the age of planetary surfaces and reconstruct the history of solar system bombardment.

Why Simulations Are Powerful Tools for Learning

Published: April 22, 2025

Educational research consistently demonstrates that interactive simulations are more effective than passive learning methods. When students can manipulate variables, observe outcomes, and explore scenarios at their own pace, they develop deeper conceptual understanding. Moonfall applies these principles by letting users choose impact locations and watch real-time data change.

Simulations provide immediate visual feedback, reduce cognitive load, engage multiple senses, and allow safe exploration of impossible scenarios. Moonfall was designed with these principles in mind, with real-time weather integration, multi-phase destruction, and geographic targeting that makes each simulation unique and educational.

From Concept to Launch: The Development Journey of Moonfall

Published: April 12, 2025

Every software project has a story, and Moonfall's development journey spans months of experimentation and breakthrough moments. The project began with a simple question: could a realistic planetary impact be simulated entirely in a web browser? The initial prototype was crude — a simple sphere with a texture against a black background.

The first major breakthrough came with Three.js's advanced material system, transforming the Earth model into a photorealistic globe. The destruction sequence presented the greatest challenge, requiring careful orchestration of crack propagation, atmospheric transitions, particle effects, and the final debris explosion with over 10,000 particles rendering at 60 frames per second.

The Future of Web-Based Space Simulations

Published: April 5, 2025

Web-based space simulations are evolving rapidly, driven by advances in browser technology, cloud computing, and open data availability. Upcoming technologies like WebGPU will enable real-time ray tracing, volumetric effects, and advanced particle systems. Cloud-based GPU computing will enable collaborative simulations where multiple users interact with the same virtual environment simultaneously.

Future versions of Moonfall could incorporate live satellite imagery, real-time seismic data, or feeds from space telescopes. Machine learning models could predict impact effects with greater scientific accuracy. As browser capabilities expand and data sources become more accessible, the line between simulation and reality will continue to blur, creating ever more immersive educational experiences.