{"id":16323661,"url":"https://github.com/im-rises/nbodysimulator","last_synced_at":"2026-04-17T13:33:02.553Z","repository":{"id":166601846,"uuid":"642099907","full_name":"Im-Rises/NBodySimulator","owner":"Im-Rises","description":"N-Body simulations made in C++ with OpenGL (Bruteforce, Barnes-Hut, GPU)","archived":false,"fork":false,"pushed_at":"2023-10-19T02:17:24.000Z","size":3633,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-15T01:19:00.883Z","etag":null,"topics":["cplusplus","cpp","engine","imgui","n-body","n-body-simulator","nbody","opengl","particles","simulation"],"latest_commit_sha":null,"homepage":"https://im-rises.github.io/nbody-simulator-webgl/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Im-Rises.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-05-17T20:26:48.000Z","updated_at":"2023-09-26T00:29:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"e11752ce-aaac-40cf-aeee-a4668d90f434","html_url":"https://github.com/Im-Rises/NBodySimulator","commit_stats":{"total_commits":131,"total_committers":2,"mean_commits":65.5,"dds":0.007633587786259555,"last_synced_commit":"c0e8843f560dbc0c72d18c6f807912b6c6609e39"},"previous_names":["im-rises/nbodysimulator"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FNBodySimulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FNBodySimulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FNBodySimulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FNBodySimulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Im-Rises","download_url":"https://codeload.github.com/Im-Rises/NBodySimulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254170059,"owners_count":22026219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","engine","imgui","n-body","n-body-simulator","nbody","opengl","particles","simulation"],"created_at":"2024-10-10T22:55:22.176Z","updated_at":"2025-10-05T13:20:44.325Z","avatar_url":"https://github.com/Im-Rises.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NBodySimulator\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://user-images.githubusercontent.com/59691442/183268126-b3d19e66-8f2d-463a-805e-ae6ef7cc6c01.png\" alt=\"cmakeLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://img.shields.io/badge/C%2B%2B-00599C?style=for-the-badge\u0026logo=c%2B%2B\u0026logoColor=white\" alt=\"cppLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://img.shields.io/badge/OpenGL-FFFFFF?style=for-the-badge\u0026logo=opengl\" alt=\"openglLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://user-images.githubusercontent.com/59691442/190315147-ec9dc33f-0090-4f0d-98ab-514eb1463e01.png\" alt=\"glfwLogo\" style=\"height:60px;\"/\u003e\n\u003c/p\u003e\n\n## Description\n\nThis is a simple n-body simulator using bruteforce made with OpenGL in C++ with the help of the ImGui library for the\nUI.\n\nYou can choose between different types of simulation:\n\n- CPU\n- GPU\n- Barnes-Hut algorithm\n\nThe different algorithm still need some work to be optimized, but they are currently working.\n\nYou can also test the webgl version 🚀🚀 [here](https://im-rises.github.io/nbody-simulator-webgl/) 🚀🚀\n\nThe source code of the webgl version is available [here](https://github.com/Im-Rises/nbody-simulator-webgl).\n\n## Videos\n\nhttps://github.com/Im-Rises/nbody-simulator-docker/assets/59691442/622717a8-b508-4221-a79e-f00c07475979\n\nLonger video 🚀🚀 [here](https://www.youtube.com/watch?v=OisxyKE_ioU) 🚀🚀\n\n## Dependencies\n\n- OpenGL version: 4.6.0\n- GLSL version: 4.60\n- GLFW version: 3.3.8\n- Glad version: 0.1.36\n- ImGui version: 1.89.4 WIP\n- GLM version: 0.9.8\n\n## How to use\n\nTo download the app, you can click one of the icons below (depending on your operating system). You can also click the\nrelease section of the GitHub page.\n\nDepending on you `operating system` you will need to install some libs, they are installed differently depending on your\nsystem, please follow one of the section below `Windows` or `Linux` or `MacOs`.\n\nFor the compilation, follow the section `Compilation`.\n\nThe controls are described in the section `Controls`.\n\n\u003e **Warning**\n\u003e Be sure to put the `imgui.ini` file in the same folder as the executable.\n\u003e You can find it in the `root` of the project. If you don't do this, the UI will not be displayed correctly.\n\n### Windows\n\n\u003ca href=\"https://github.com/Im-Rises/NBodySimulatorSSBO/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor Windows users you don't need to install the libs. You can just download the app and run it.\n\n```bash\n.\\NBodySimulator.exe\n```\n\n### Linux\n\n\u003ca href=\"https://github.com/Im-Rises/NBodySimulatorSSBO/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor Linux users, you need to install the GLFW lib, to do so type one of the following commands:\n\n```bash\nsudo apt-get install libglfw3\n```\n\nor if you're a developer and want to compile the app, please install this version of GLFW:\n\n```bash\nsudo apt-get install libglfw3-dev\n```\n\nThen you can start by double-clicking the executable of typing the following command next to it:\n\n```bash\n./NBodySimulatorLauncher\n```\n\n### MacOs\n\n\u003ca href=\"https://github.com/Im-Rises/NBodySimulatorSSBO/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor macOS users you will need to install Brew, please follow the instruction in the link below:  \n\u003chttps://brew.sh\u003e\n\nOnce it is installed, you can type the following command to install GLFW.\n\n```bash\nbrew install glfw\n```\n\nThen you can start by double-clicking the executable of typing the following command next to it:\n\n```bash\n./NBodySimulatorLauncher\n```\n\n## Compilation\n\nTo compile the app, the first thing you need to do is install a C++ compiler:\n\n- Visual Studio (MSVC)\n- Mingw\n- ...\n\nYou also need to install Cmake:  \n\u003chttps://cmake.org\u003e\n\nOnce your environment is set up, depending on your operating system you'll need to install some libs before compiling\nthe project. Refer to the section below `Windows` or `Linux` or `MacOs`.\n\n### Windows\n\nWindows users can directly compile the project by typing the following command at the project root folder:\n\n```bash\ncmake -B . -DCMAKE_BUILD_TYPE=Release\n```\n\nthen\n\n```bash\ncmake --build . --config Release\n```\n\n### Linux\n\nLinux's users need to install some libs before compiling the project:\n\nFirst thing to do is to install CMake, type the following command to install it.\n\n```bash\nsudo apt-get install cmake\n```\n\nYou also need to install the GLFW lib. Type the following command at the project root.\n\n```bash\nsudo apt-get install libglfw3-dev\n```\n\nYou are now able to compile the project. Go to the project root and type the following command:\n\n```bash\ncmake -B . -DCMAKE_BUILD_TYPE=Release\n```\n\nthen\n\n```bash\ncmake --build . --config Release\n```\n\n### MacOs\n\nFor macOS user, you should install brew package manager by following the instructions in the link below:  \n\u003chttps://brew.sh\u003e\n\nThen type the following command to install cmake:\n\n```bash\nbrew install cmake\n```\n\nand this one to install GLFW\n\n```bash\nbrew install glfw\n```\n\nYou are now able to compile the project. Go to the project root and type the following command:\n\n```bash\ncmake -B . -DCMAKE_BUILD_TYPE=Release\n```\n\nthen\n\n```bash\ncmake --build . --config Release\n```\n\n## Controls\n\nThe speed and some parameters can be modified directly in the ImGui windows.\n\n| Action              | Key                                 |\n|---------------------|-------------------------------------|\n| Translate camera    | WASD (← → ↑ ↓)                      |\n| Pause/Resume        | P                                   |\n| Move up/down camera | SPACE/SHIFT                         |\n| Rotate camera       | Right Mouse Button + Mouse movement |\n| Fullscreen          | F11                                 |\n| Exit app            | ESC                                 |\n| Show/Hide UI        | U                                   |\n\n\u003e **Note**\n\u003e You can the inputs by changing their attribution in the `InputManager.cpp` file,\n\u003e if so you'll need to compile the project.\n\n## Github-Actions\n\n[![CodeQL](https://github.com/Im-Rises/NBodySimulator/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/Im-Rises/NBodySimulator/actions/workflows/codeql.yml)\n[![CMake](https://github.com/Im-Rises/NBodySimulator/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Im-Rises/NBodySimulator/actions/workflows/cmake.yml)\n[![Cpp Cmake Publish](https://github.com/Im-Rises/NBodySimulator/actions/workflows/cpp-cmake-publish.yml/badge.svg?branch=main)](https://github.com/Im-Rises/NBodySimulator/actions/workflows/cpp-cmake-publish.yml)\n[![flawfinder](https://github.com/Im-Rises/NBodySimulator/actions/workflows/flawfinder.yml/badge.svg?branch=main)](https://github.com/Im-Rises/NBodySimulator/actions/workflows/flawfinder.yml)\n[![cpp-linter](https://github.com/Im-Rises/NBodySimulator/actions/workflows/cpp-linter.yml/badge.svg?branch=main)](https://github.com/Im-Rises/NBodySimulator/actions/workflows/cpp-linter.yml)\n\nThe project is set with a set of different scripts:\n\n- CodeQL: This script is used to check the code for security issues.\n- CMake: This script is used to build the project.\n- Cpp Cmake Publish: This script is used to publish the project on GitHub.\n- Flawfinder: This script is used to check the code for security issues.\n- Cpp Linter: This script is used to check the code for security issues.\n\n## Libraries\n\nglfw:  \n\u003chttps://www.glfw.org/docs/latest/\u003e\n\nglm:  \n\u003chttps://glm.g-truc.net/0.9.9/index.html\u003e\n\nglad:  \n\u003chttps://glad.dav1d.de/\u003e\n\nDear ImGui:  \n\u003chttps://github.com/ocornut/imgui\u003e\n\nOpenGL:  \n\u003chttps://www.opengl.org/\u003e\n\nglm:  \n\u003chttps://glm.g-truc.net/0.9.9/index.html\u003e\n\n## Documentation\n\nlearnopengl (OpenGL tutorial):  \n\u003chttps://learnopengl.com/In-Practice/2D-Game/Particles\u003e\n\nOpenCL NBody example:  \n\u003chttps://github.com/KhronosGroup/OpenCL-SDK/tree/f510201a092363b66969888df49c68721ca2c4fb/samples/extensions/khr/nbody\u003e\n\n## Contributors\n\nQuentin MOREL:\n\n- @Im-Rises\n- \u003chttps://github.com/Im-Rises\u003e\n\n[![GitHub contributors](https://contrib.rocks/image?repo=Im-Rises/NBodySimulator)](https://github.com/Im-Rises/NBodySimulator/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-rises%2Fnbodysimulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fim-rises%2Fnbodysimulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-rises%2Fnbodysimulator/lists"}