C.R.A.S.H.: Building a NASA Asteroid Impact Simulator in 32 Hours
Postmortem of the NSAC2025 hackathon project where we built a 3D asteroid impact simulator using real NASA data, CesiumJS, and Three.js in just 32 hours.
The Challenge
NSAC2025 (NASA Space Apps Challenge) - 32 hours to build something meaningful with NASA's open data. Our team chose the "Asteroid Impact Simulation" challenge.
The Stack (Chosen for Speed)
- CesiumJS - 3D globe visualization (NASA's choice for geospatial)
- Three.js - Custom asteroid/impact visualizations
- React + TypeScript - Frontend framework
- FastAPI + Python - Backend for NASA API integration
- MapBox - Base maps and terrain
- TailwindCSS - Rapid UI development
Architecture Decisions
1. Split Rendering: Cesium for Globe, Three.js for Effects
Cesium handles the Earth, terrain, and satellite imagery. Three.js overlays custom asteroid trajectories, impact effects, and particle systems.
// Cesium viewer setup
const viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain(),
imageryProvider: new Cesium.IonImageryProvider({ assetId: 3954 })
});
// Three.js overlay for custom effects
const threeScene = new THREE.Scene();
const asteroidMesh = createAsteroidMesh(data.diameter);
2. NASA Data Pipeline
Real-time data from:
- NASA CNEOS API - Near Earth Object data
- JPL Small Body Database - Orbital parameters
- SENTRY Risk List - Impact probabilities
# FastAPI endpoint
@app.get("/api/asteroids")
async def get_asteroids():
neo_data = await fetch_nasa_neo()
sentry_data = await fetch_sentry_risk()
return combine_and_enrich(neo_data, sentry_data)
3. Impact Physics Simulation
Simplified but visually accurate:
- Kinetic energy calculation:
E = 0.5 * m * v² - Crater diameter scaling (based on published models)
- Ejecta particle system with Three.js Points
What Went Well
- Pre-hackathon prep - We set up the Cesium + Three.js integration the week before
- Clear data contracts - TypeScript interfaces matched Python Pydantic models
- Parallel workstreams - One person on data, one on 3D, one on UI
- Scope discipline - Cut features ruthlessly (no user accounts, no saving)
What We'd Do Differently
- Better state management - React Context got messy with 3D scene state
- Automated deployment - Manual Vercel + Railway deploys wasted time
- More NASA data caching - API rate limits hit during demo
The Result
- Functional simulator with real asteroid data
- Interactive 3D globe with impact visualization
- Risk assessment panel showing probability, energy, crater size
- Live at: crashnasa.earth
Key Takeaways for Hackathons
- Pick boring tech you know well - Now is not the time to learn a new framework
- Design the data flow first - Frontend/Backend contract saves hours
- Deploy early, deploy often - Catch integration issues immediately
- Demo > Code quality - Judges see the demo, not the Git history
Links
- Live: crashnasa.earth
- GitHub: C.R.A.S.H.