Back to browse
HelioSim – Real-time N-body simulator in WebAssembly

HelioSim – Real-time N-body simulator in WebAssembly

by JustClemens·Feb 26, 2026·1 point·0 comments

AI Analysis

●●SolidWizardryEye CandyRabbit Hole

C++ + OpenGL ES compiled to WASM—browser physics sim with predictive orbits.

Strengths
  • Full simulation and rendering pipeline in WebAssembly shows genuine WASM+graphics mastery
  • Predictive orbit trails and collision detection add physical accuracy beyond basic n-body
  • Live browser demo is immediately interactive and performs well
Weaknesses
  • Physics simulator is a solved category; many alternatives exist (three.js sims, desktop tools)
  • First WASM project by author—lacks polish in JS↔C++ bridging, limiting extensibility
Target Audience

Physics enthusiasts, visualization engineers, WebAssembly learners

Similar To

three.js physics demos · Gravity Simulator (mobile apps) · Processing gravity sketches

Post Description

Hi HN!

I built HelioSim, a real-time N-body gravitational system simulator running directly in the browser via WebAssembly.

It’s written in C++ and uses OpenGL ES 3.0, GLFW, and Emscripten. The entire simulation and rendering pipeline runs in WebAssembly.

Features: - Real-time N-body gravitational simulation - Predictive orbit trails - Collision handling - Time controls (slow motion / fast-forward) - Dynamic body spawning

This was my first larger WebAssembly project, and I was honestly surprised how well modern browsers handle a C++ + OpenGL ES pipeline compiled to WASM.

One interesting challenge was bridging events and state between JavaScript and C++, which can honestly be a bit exhausting.

Source code:https://github.com/clemenskoprolin/heliosim

I’d love feedback on performance on other machines. Thanks!

Similar Projects

Developer Tools●●Solid

ARB – A Differentiable Rigid Body Simulation Library Using C++23

C++ rigid body simulation with end-to-end automatic differentiation for ML.

WizardryNiche Gem
wbyates777
213d ago