Looks very nice! I think I found a bug: after pausing, moving a body and unpausing, I cannot move the camera. Changing "follow" to something and back to "none" helps.
Show HN: Browser-based interactive 3D Three-Body problem simulator
91–100 of 119 posts
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#92Earlier 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.
Maybe that is what the 'softening' parameter relates to?
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#93Excellent 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.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#94Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#95Oh 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.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#96Oh 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
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#97Earlier 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?
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#98Earlier quoted context omitted.
There’s a big one in the sky right now - the Earth-Moon-Sun system.
Give it time…
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#99Earlier 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.