Settings

Theme

Show HN: N-Body simulation using WebAssembly

novoselrok.github.io

13 points by roknovosel 7 years ago · 6 comments

Reader

petermcneeley 7 years ago

Uses the Barnes-Hut algorithm to avoid O( n^2 ) force calculations in favor of O(n log n). Simple nearest neighbor tracking cannot be use in gravity simulations as gravity has an effective infinite ranged potential. https://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation

hazz99 7 years ago

I just get a blank, dark screen. Recent version of Firefox.

  • roknovoselOP 7 years ago

    Hey, author here. Any errors in the console? (Sometimes the Emscripten Module fails to load)

    • helb 7 years ago

      I got that too when i opened the tab in background. Chrome 70, console says:

      Active resource loading counts reached to a per-frame limit while the tab is in background. Network requests will be delayed until a previous loading finishes, or the tab is foregrounded. See https://www.chromestatus.com/feature/5527160148197376 for more details

      Works fine after page reload.

      • roknovoselOP 7 years ago

        Ok, I'll test it on Chrome 70. Emscripten Module loading is not still as reliable as I would like :/

    • hazz99 7 years ago

      I get two of:

          unreachable code after return statement[Learn More] js:74:1003
      
      I tried checking the line, but it's minified javascript (not super helpful).

Keyboard Shortcuts

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