A real-time, 3D simulation of a supermassive black hole and its accretion disk, built from scratch using Java and the LibGDX game development framework.
(Note: Upload a screenshot of your sim named 'screenshot.png' to your repo for this image to appear)
- High-Count Particle System: Simulates 8,000+ individual particles using 3D Decals for optimized performance.
-
Newtonian Physics: Implements gravity vector math (
$F = G \frac{m_1 m_2}{r^2}$ ) to calculate orbital velocities and trajectories. -
Visual Effects:
- Additive Blending: Creates the intense "white-hot" plasma effect where particle density is high.
- Simulated Redshift: Particles dynamically change color from blue (cold/far) to red/white (hot/close) based on distance and velocity.
- Procedural Textures: Glow textures are generated via code at runtime—no external assets required.
- Interactive Camera: Full 3D camera controls to explore the void from any angle.
- Language: Java
- Library: LibGDX (OpenGL wrapper)
- Rendering: 3D DecalBatch & ModelBatch
- Math: Vector3 cross products for orbital planes & relativistic clamping.
The simulation uses a simplified N-Body approach focused on a central massive attractor.
-
Gravity: Each frame, a centripetal force vector is calculated for every particle pointing toward the singularity
$(0,0,0)$ . - The Event Horizon: A Schwarzschild radius is defined. Any particle crossing this threshold is reset, simulating matter being consumed.
- Relativistic Clamping: To prevent simulation instability, a "speed of light" (Max Speed) is enforced on all particles so they don't glitch through the event horizon.
- Clone the repository:
git clone [https://github.com/arvindverma63/EventHorizon-Java.git](https://github.com/arvindverma63/EventHorizon-Java.git)
- Open the project:
- Open in IntelliJ IDEA or Eclipse as a Gradle project.
- Run:
- Locate
DesktopLauncher.javain thedesktop/src/...folder. - Run the
mainmethod.
- Locate
- Rotate Camera: Click & Drag Mouse
- Zoom: Scroll Wheel
- Speed: Press
1(Normal),2(Fast),3(Ultra) - Pause: Spacebar
- Exit: ESC
Created by Arvind Verma
