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 !?
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!
- 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: Full thrust is applied via
applyLocalForce
at the booster's base, simulating the combined output of 33 Raptor engines. -
Slow Coasting via
applyLocalForce(0, slowCoastForce, mainThrust)
- Stage Separation: At approximately 60 km altitude separating Starship from the Super Heavy Booster.
-
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. - Booster Boostback Burn: Used quaternion 'slerp' ;) for booster reorientation and descent (for now!)
- Return-to-Launch-Site (RTLS) and Catch: In progress!
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