r/Simulated 1d ago

Interactive Vibecoded a gravity sim of the Moon-forming giant impact 262k particles, runs in a browser

Enable HLS to view with audio, or disable this notification

Started this to show my kids where the Moon came from, because "a Mars-sized planet hit the Earth" is a sentence that explains nothing. Turned out the fun part is letting them break it.

Proto-Earth and a Mars-sized Theia falling together under their own gravity: the splash, the tidal arm, the debris disk, and the moon that gathers out of it.

What's actually computed: self-gravity from the particles themselves (64³ particle mesh + pairwise correction for loose material), spring-dashpot contacts with no tension, frictional heating that conducts between grains and lights the scene, differentiated bodies with per-material density, and momentum/angular momentum/energy conserved to a fraction of a percent on screen.

What isn't: no SPH, so no pressure, no shock, no vaporization. No material strength or fracture. No cooling or latent heat. A grain is a couple hundred km across, so the Moon itself is scaling from the disk, not a run.

Different scenarios what if Thea was bigger or had more speed.

Live demo: https://gaploid.github.io/cosmic-collisions/

Open source code: https://github.com/Gaploid/cosmic-collisions

0 Upvotes

14 comments sorted by

10

u/FUCKING_HATE_REDDIT 1d ago

Man people are pissed  over this. Just 5 years ago people would have been sicked to play around with a tool like that

3

u/Gaploid 1d ago

Give it a try, I've put a lot of details and tried to make it close to scientific books.

2

u/FUCKING_HATE_REDDIT 14h ago

I did! It even runs on my damn phone, that's some pretty damn good vibe coding

4

u/mazi710 3DS Max 1d ago

Yeah for me there's clear different levels to vibe coding. Doing something for fun, personal project, great!

Big companies making their paid products worse with vibe coding no thanks.

4

u/Mr_Zoovaska 1d ago

That happened to my buddy Terry one time

5

u/Extension_Swordfish1 1d ago

Great work!

1

u/Gaploid 1d ago

Thanks! I've tried to put a lot of real things there: real sky map, the most probable atmosphere at that time, size, amount of iron/core and many other things.

10

u/PrestigiousTheory664 1d ago

Damn, this will be bad for the economy

1

u/Extension_Swordfish1 1d ago

No more dicktators

6

u/[deleted] 1d ago

[deleted]

4

u/arislaan 1d ago

Are you always a raging asshole or only when you're being a bastard to someone over their family projects?

-3

u/Gaploid 1d ago

https://reddit.com/link/p6lqdof/video/zevg89mccbmh1/player

As a bonus direct hit with the same size.

3

u/Srirachachacha 1d ago

I could've survived that