https://github.com/astrogeekdk/starship-simulator
A Starship Simulator and Game written for the Web in Three.js
https://github.com/astrogeekdk/starship-simulator
game rocket simulator threejs
Last synced: about 1 month ago
JSON representation
A Starship Simulator and Game written for the Web in Three.js
- Host: GitHub
- URL: https://github.com/astrogeekdk/starship-simulator
- Owner: astrogeekdk
- Created: 2025-02-24T17:44:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-12T17:14:08.000Z (over 1 year ago)
- Last Synced: 2025-03-16T12:24:14.732Z (over 1 year ago)
- Topics: game, rocket, simulator, threejs
- Language: JavaScript
- Homepage:
- Size: 57.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rocket Launch Simulator
A nice little physics-based rocket launch simulation built using Three.js and Cannon.js - that runs on the browser!
The rocket model I used is SpaceX's iconic Starship - which I am so obsessed with - those 33 Raptors!
This simulator features a realistic launch sequence, gravitational dynamics, thrust vectoring, stage separation, Return-to-Launch-Site (RTLS) and in progress Mechazilla catch capabilities.
Here is a sneak peek, tell me it isn't beautiful !?

## Overview
This simulator 'replicates' the dynamics of a launch-to-orbit mission, with gravitational force modeling, thrust vectoring, and control Systems to achieve realistic flight behavior.
An 8K high-resolution Earth texture, a real Milky Way starmap, a nice Starship model (credits pending), and even an particle system for thrust visualization have been used!
### Features
- **Cannon.js** physics engine
- **Rendering** with Three.js, with an 8K Earth texture, a real Milky Way starmap, and a Starship model.
- **Gravitational Model**: Implementation of gravitational force to simulate realistic orbital mechanics.
- **Thrust Vectoring**: Simulated via `applyLocalForce` at the booster's base
- **Particle Effects**: Thrust visualization using particle systems.
- **Control Systems**: Basic algorithms for attitude control and trajectory changes.
## Launch Sequence
1. **Launch**: Full thrust is applied via `applyLocalForce` at the booster's base, simulating the combined output of 33 Raptor engines.
2. **Slow Coasting** via `applyLocalForce(0, slowCoastForce, mainThrust)`
3. **Stage Separation**: At approximately 60 km altitude separating Starship from the Super Heavy Booster.
4. **Starship Orbit Insertion**: Simulated using $`F = m \frac{\Delta v}{\Delta t}`$ to achieve orbital velocity, with basic control system for nose alignment along the velocity vector.
5. **Booster Boostback Burn**: Used quaternion 'slerp' ;) for booster reorientation and descent (for now!)
6. **Return-to-Launch-Site (RTLS) and Catch**: In progress!
## Accuracy and Realism
Tried to make it super real! So used real parameters:
- **Masses**: Super Heavy Booster at 3000 metric tons (fully fueled), Starship at 2000 metric tons (fully fueled).
- **Thrust**: Simulated a total of 70,000 kN thrust - total from 33 Raptors!
- Scaled the 3d models so as to match ~120m height
- Even added a model of launch tower
- Added 4 different cameras
- Slider to change the simulation speed