Settings

Theme

Show HN: I also made a three-body simulation

three-bodies.sulami.xyz

12 points by sulami 2 years ago · 7 comments · 1 min read

Reader

Somewhat inspired by a recent post here, I also made a three-body simulation on a whim, meaning to try out macroquad[0] (verdict: really nice!). Thanks to the engine I could trivially target wasm as well, so others can get mesmerized too.

The source is available here: https://github.com/sulami/three-bodies

[0]: https://docs.rs/macroquad/latest/macroquad

awinter-py 2 years ago

I don't understand how the aliens weren't able to lie but they were able to falsify scientific results

that's like the third most common form of lying

  • bugbuddy 2 years ago

    Plot holes so numerous and large that it reminds me of all the other Sci-Fi works I have read. /s

nico 2 years ago

So nice to look at, thank you for posting this, really cool

Would love to be able to zoom in/out and rotate, I kinda was expecting to be able to do it with the mouse and was a bit surprised that clicking just restarted the animation/simulation

Great work

  • sulamiOP 2 years ago

    Thank you.

    The clicking to restart is there mainly for phone users, I realized after sharing with a friend that hotkeys aren't very mobile-friendly. I don't have a good way to detect desktop vs. mobile clients, and technically one can also have a keyboard connected to a phone.

    I've also been thinking about zooming, I'll see what I can do over my next lunch break :D

pointlessone 2 years ago

Interesting choice of modular coordinates. I wonder how gravity works here. Does it reach across the edge or is it confined to the modulo?

UI is a bit unfriendly on mobile. It doesn’t seem there’s a way to interact with it on a phone.

DigitalHackOp 2 years ago

I think this is very cool, but the edge warping negates a lot of the chaos imho. It keeps things interacting in the center of the screen, but it prevents the chaos of bodies being yeeted out into the void.

gaws 2 years ago

How was your experience working with WASM and implementing it on the page?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection