Live data from Hacker News

Show HN: Browser-based interactive 3D Three-Body problem simulator

trisolarchaos.com

91–100 of 119 posts

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#92

Earlier quoted context omitted.

For accuracy, time step can get smaller when bodies are closer.

Yes, but this would slow the simulation right down if 2 bodies are very close. I think people sometimes use a 'fudge factor', e.g. if distance < x then treat distance as x.

>'fudge factor'

Maybe that is what the 'softening' parameter relates to?

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#93

Excellent work. Is this based on simple Newtonian gravity applied over a uniform time-step, or something more sophisticated?

What you describe is the Euler method, which is well known for being a comparatively bad choice in most situations. The ODE solver can be selected, the default is RK4, which is a Runge–Kutta method of 4th order, it computes the next time step by combining the values at 4 previous time steps.

I see it now, under the 'Advanced' options.

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#95
post #85

Oh one question I have, when I messed around with ThreeJS line width was a problem, these curves look pretty nice/thick on mac, maybe that was updated recently. (lines as in orbit path) ThreeJS is awesome btw, I exported a GDB file I think from a CAD program and imported it into ThreeJS/able to animate each part pretty cool.

I'm using https://threejs.org/docs/#Line2 which does support variable thickness - you can change this via the Trail Thickness slider. I think older versions did have some issues with line width.

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#96
post #85

Oh one question I have, when I messed around with ThreeJS line width was a problem, these curves look pretty nice/thick on mac, maybe that was updated recently. (lines as in orbit path) ThreeJS is awesome btw, I exported a GDB file I think from a CAD program and imported it into ThreeJS/able to animate each part pretty cool.

You might be using the webgl lines (LINE_STRIP), those are always thin. The other way is to build a mesh that looks like a line (which Three.js also has functions for). select the line type here to see the difference: https://threejs.org/examples/?q=lines#webgl_lines_fat

oh yeah those look great

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#97

Earlier quoted context omitted.

Yes, but this would slow the simulation right down if 2 bodies are very close. I think people sometimes use a 'fudge factor', e.g. if distance < x then treat distance as x.

>'fudge factor' Maybe that is what the 'softening' parameter relates to?

Yes, the softening factor keeps the forces from getting too big when bodies get close together. Better for the visualization but not very accurate to leave it in.

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#98

Earlier quoted context omitted.

There’s a big one in the sky right now - the Earth-Moon-Sun system.

Give it time…

With full tidal locking and no external perturbations, it would be permanently stable. If that still bothers you, then consider L4/L5 orbits. An object orbiting around the L4/L5 points in a 3-body system will be perpetually stable so long as there is no external perturbations with total energy above the "hill" at the edge of the L4/L5 space.

Re: Show HN: Browser-based interactive 3D Three-Body problem simulator

#99
post #68
post #23

Earlier quoted context omitted.

> Is this with Gemini 3? An LLM couldn't provide results for a sim like this, compared to a relatively simple numerical differential equation solver, which is how this sim works. Unless you're asking whether a sim like this could be vibe-coded, if so, the answer is yes, certainly, because the required code is relatively easy to create and test. Apart from a handful of specific solutions, there are no general closed-f…

Well I was wondering if it was vibe coded because Gemini 3 loves Three.js and that's a main selling point of the model.

Yeah, I used Claude Code, definitely started as a vibe-coded thing. First pass was just basic physics + Three.js rendering. But once I saw it working, I spent some more time on better numerical stability and adding presets from stable 3D orbits, so it turned into more of a real project.
Post reply on HN