News for hackers. Stuff that matters.

jgchaos

Re: on Wednesday November 19, 2025 @02:54PM (#45984264)
I just added that option. It wasn’t there when you initially looked :). Are you using one of the 3D presets/random config or are you using a 2D preset?
Re: on Wednesday November 19, 2025 @02:32PM (#45983972)
I do not currently have a set of those glasses so I can't test it, but three.js has this and it's pretty easy to add. There should be an "Anaglyph 3D" checkbox at the bottom of the configuration settings. Let me know if you are able to test it out.
Re: on Wednesday November 19, 2025 @01:32PM (#45983153)
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.
Re: on Wednesday November 19, 2025 @01:26PM (#45983041)
This is cool thanks for sharing. I hadn't seen this.
Re: on Wednesday November 19, 2025 @01:23PM (#45982988)
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: on Wednesday November 19, 2025 @01:15PM (#45982848)
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: on Wednesday November 19, 2025 @12:47PM (#45982446)
This should be fixed!
Re: on Tuesday November 18, 2025 @11:17PM (#45975797)
It might be fun to add some kind of visualization showing when a body has enough energy to escape the system. Would save people from waiting 15 minutes to see if it comes back!
Re: on Tuesday November 18, 2025 @11:10PM (#45975767)
Thank you! Your 2D version is great, I love seeing how different people approach this stuff. As for integrators, I currently only have Velocity Verlet and RK4 (can change in the advanced settings). I started with just Verlet, but to get some of the presets to behave properly I ended up needing RK4 as well. I’ve been thinking about adding adaptive methods next, but I'll take a look at the methods you've got listed too. Everything is still running in plain JS for now. I started moving some of the work into web workers but haven’t finished that part yet.
Re: on Tuesday November 18, 2025 @10:57PM (#45975698)
The link points to one of the stable solutions, and there are actually quite a few of those. The problem is that there’s no general closed form that tells us exactly where the bodies will be in the future, so we rely on numerical methods to approximate the motion. If you hit Reset All a few times or add more bodies, you’ll start to see the chaos
Re: on Tuesday November 18, 2025 @10:02PM (#45975363)
Thanks so much, really appreciate it! I’ve been focusing the presets on stable or interesting solutions that aren’t tied to real systems, but adding a few real examples like Alpha Centauri would fit in nicely. I’ll keep that on the list for future updates.
Re: on Tuesday November 18, 2025 @09:48PM (#45975309)
Thanks! The Three-Body series definitely helped spark the idea, and the URL is a little nod to the books. I also took some simulation classes back in college, so the math and physics side pulled me in too. It’s crossed my mind that it could be fun to add a kind of Trisolaran mode that tracks a small planet and how habitable its position is throughout the orbits.