You are browsing as a guest. Sign up (or log in) to start making projects!

BlackHole simulation

  • 4 Devlogs
  • 6 Total hours

a simulation for black holes gravity

Ship #1 Changes requested

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 mass

Tech

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
Try project → See source code →
Open comments for this post

2h 0m 7s logged

i just made it a lot better, since i dont code html very well, i used some help from cluade, and turned it into a site! i added neutron stars, saved scenarios, a lot of option to pause time, vector spawning, opening page and more, i have been coding for servel hours in a diffrent app so it didn’t save most of the time (i know it sounds weird but belive me) , but it’s in the finals! any way, i will ship soon, that project teached me a lot!

2
0
8
Open comments for this post

1h 28m 8s logged

the black hole is working great! the simulation can: _____________________________________________1.) you can scroll you mouse wheel to change the blackhole’s mass and size . 2.) you can move it around with you mouse or you can lock it in place. 3.) you can summon matter and summon a planet like seen in the photo and see it going through spaghettification and fall in all with very good physics. _____________________________________________ now i am going to make it look more proffesional, and maybe more features. anyway, i will keep you tuned!

0
0
2
Open comments for this post

15m 37s logged

i just came back from vaction, i’m going to start a quick marathon, i hope to get better with the grahps and then get better with the physics, anyway, goodbye for now!

0
0
2
Open comments for this post

2h 42m 13s logged

i just started my black hole simulation, nothing to say really, it can show a simulation of a black hole (no animation , yet) the black hole has constant values .
anyway i will keep you tuned!

0
0
10

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…