Skip to content

jrzanol/nbody-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nbody-sim

An nbody gravity simulator that adopts a client-server architecture to separate the mathematical processing load from the graphical rendering. The calculation of gravitational interactions between celestial bodies is processed remotely on a server, while the client consumes this data via RPC (Remote Procedure Call) to render the simulation in real-time using OpenGL.

Features

  • N-Body Simulation: Accurate calculation of gravitational forces and state updates (positions/velocities) for multiple planets.
  • Distributed Architecture: Efficient client-server communication using RPC, allowing the physics simulation to run on dedicated hardware.
  • Graphical Rendering: Smooth, real-time 3D visualization using the OpenGL pipeline.
  • Synchronization: Latency handling and frame updates to keep the visual output synced with the server's calculations.

Architecture

The project is divided into two main components:

  1. Server (Physics Engine): Responsible for all the heavy lifting. It calculates the mutual gravitational attraction between all celestial bodies on every simulation tick and updates their state vectors (position, mass, and velocity).
  2. Client (Renderer): An OpenGL graphical application. It makes periodic requests to the server via RPC to fetch the updated state of the celestial bodies and draws them on the screen.

About

Distributed N-Body simulator: gravity physics processing handled on a server via RPC, with real-time graphical rendering using OpenGL.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages