@MrParrot on BlackHole simulation
Event Horizon — a gravity sandbox
A live, in-browser simulation of gravity around a black hole, built with plain HTML and python 3. No build step, no dependencies — just open the file.
Try it live → (recomended, way easier then the file!)
What it does
Event Horizon models Newtonian gravity (not full general relativity) to let you drop matter, launch planets, and spawn extra gravitational bodies into a warped spacetime grid. Watch matter get consumed, planets stretch as they approach the event horizon, and light rays bend as they pass close to mass.
Features
- Two body types — black holes (swallow anything that crosses the event horizon) and neutron stars (matter sticks to their surface and grows their mass; enough accreted mass causes a collapse into a black hole)
- Mutual gravity — toggle it on and every body pulls on every other one, including merging on collision
- Vector spawning — click and drag to set the launch direction and speed of anything you place, instead of just dropping it at rest
- Preset scenarios — Single hole, Binary black holes, Hole + neutron star, and Three-body chaos
- Pause and time-speed controls — slow down or freeze the simulation to study a moment
- Live telemetry — matter count, light-ray count, FPS, and closest approach to a body
Controls
Action Effect Click / tap Drop the selected body at rest Click + drag Set a launch vector (direction + speed) Shift + click Launch a planet (desktop) Ctrl + click Spawn a black hole (desktop) Right-click a body Delete it Right-click empty space Lock / unlock the primary hole Scroll Adjust the primary hole’s massTech
Python 3 using for the physics and main brain
HTML to make it look good and a site
Netlify for the site upload
Notes
This uses a simplified Newtonian gravity model (inverse-square law) rather than true general relativity — it’s a fun approximation, not a physically accurate spacetime simulator. Built with some help from Claude for the physics-to-visuals translation and UI polish.
- 4 devlogs
- 6h