explaingit

qunabu/gravity

Analysis updated 2026-05-18

45TypeScriptAudience · generalComplexity · 3/5Setup · easy

TLDR

A browser-based interactive solar system simulator built with Three.js that teaches how gravity works through a 24-step guided tour.

Mindmap

mindmap
  root((repo))
    What it does
      Solar system simulator
      Guided gravity tour
      Free explore mode
    Tech stack
      TypeScript
      Three.js
      Vite
    Physics modes
      Keplerian orbits
      N-body simulation
    Features
      Real astronomical data
      Procedural textures
      English and Polish narration

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Take the 24-step guided tour to learn how orbital gravity works from the ground up.

USE CASE 2

Switch to N-body physics mode to watch gravity simulated directly instead of following fixed paths.

USE CASE 3

Explore the solar system freely with camera controls after finishing the guided tour.

What is it built with?

TypeScriptThree.jsVite

How does it compare?

qunabu/gravityi4w7w4a/liquid_prnc_glass0xbennie/binance-smart-money-tracker
Stars454544
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity3/53/53/5
Audiencegeneraldeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
No license information given in the explanation.

In plain English

Gravity is an interactive solar system simulator that runs in a web browser. It is built with TypeScript, Three.js (a 3D graphics library for the web), and Vite (a build tool). The project uses real astronomical data for planet sizes, orbital shapes, and positions, with the only deliberate inaccuracy being the visual scale, which you can adjust so everything is visible at once. The main feature is a 24-step guided walkthrough that explains how gravity works, starting from two objects attracting each other and building up step by step to the full solar system with all eight planets, Pluto, and major moons. Each step animates a concept: why the Earth does not fall into the Sun, how the Moon stays in orbit, what happens when you add a third dimension, and how every planet's path through space is actually a helix because the Sun itself is also moving. You can jump between steps, deep-link to any step by pasting a URL fragment, and read the narration in either English or Polish. After the tour, a free-explore mode lets you control the camera and toggle settings yourself. The physics runs in two modes you can switch between. The Keplerian mode uses pre-calculated orbital formulas that are perfectly stable and always accurate. The N-body mode simulates gravity directly by computing the gravitational pull between every pair of objects on every animation frame, using a numerical integration method called leapfrog. This is slower but shows gravity actually working rather than following a prescribed path, the interface shows how much energy the simulation drifts over time, which is a measure of numerical accuracy. Planet and moon surfaces are drawn using procedurally generated textures, meaning no image files are needed. The visual style is described in the README as SpaceX-style: black background, thin borders, monospace numbers. To run it locally, you install dependencies with npm and start a development server.

Copy-paste prompts

Prompt 1
Explain the difference between the Keplerian and N-body physics modes in this simulator.
Prompt 2
Help me set up this Vite and Three.js project locally with npm.
Prompt 3
How does the leapfrog integration method work for simulating gravity between objects?
Prompt 4
Show me how to deep-link to a specific step in the guided tour using a URL fragment.

Frequently asked questions

What is gravity?

A browser-based interactive solar system simulator built with Three.js that teaches how gravity works through a 24-step guided tour.

What language is gravity written in?

Mainly TypeScript. The stack also includes TypeScript, Three.js, Vite.

What license does gravity use?

No license information given in the explanation.

How hard is gravity to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gravity for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.