
Project Demo
Project Description: Gravitational Field Simulation with Interactive Orbital Dynamics
This project presents a 3D simulation of a gravitational system, where a central object, existing like a sun, exerts a gravitational pull on surrounding particles of various masses and sizes. The simulation combines physics-based orbital dynamics with interactive user input, allowing exploration of mass accumulation and orbit formation in a virtual space environment.
Core Mechanics
- Central Gravitational Body: At the heart of the scene is a massive central object that serves as the primary gravitational source. This object continuously pulls on nearby particles, keeping them in orbital motion, mimicking how planets or debris orbit a star.
-
Orbiting Particles:
Surrounding this central body are randomly generated particles with varying:
- Masses (affecting how they move and interact)
- Sizes (affecting visual appearance & collision detection)
-
User Interaction:
Users can:
- Enter a targeting view
- Use keybinds to fire an object at the target that is launched toward the gravitational field with an initial velocity
Technical Implementation Highlights
- Gravity Simulation: I implemented Newtonian gravitational force calculations between the central object and the particles, and between the user-controlled object and the field particles. The simulation supports variable mass dynamics for realistic orbital variations.
- Randomized Field Generation: Initially, I attempted a spherical distribution but switched to a cylindrical formation for a more natural orbital belt effect.
- Collision Detection: Implementing collisions between the user object and both the central mass and orbiting particles was challenging. I simplified collision detection to focus on the core interactions and tweaked parameters like collision radius and velocity correction for stability.
Future Improvements
- Implementing Blinn-Phong shading with dynamic lighting from the central object.
- Refining collision detection and resolution for smoother interactions.
- Adding complex orbital physics, including mutual gravitational effects between particles.
Current Status
- Central gravitational field & orbiting particle system.
- User-controlled object with its own gravitational field.
- Functional (though rough) collision detection & mass accumulation.
- Interactive launching of objects with target view.
- Cylindrical random particle distribution.
This project simulates the process of mass accumulation and orbital dynamics around a gravitational center. Despite challenges—especially around physics-based collisions—it demonstrates engaging interactions and realistic gravitational systems. Future refinements will focus on enhancing visual fidelity and polishing physics interactions.