This project simulates a Solar System (Sun + 7 Planets) using Three.js and WebGPU Compute Shaders. It features real-time interaction using hand gestures captured via the webcam to control the position of the Sun, affecting the orbits of the planets.
- WebGPU Compute Shaders: High-performance physics simulation for planetary orbits.
- Three.js TSL: Uses the new Three Shading Language for materials and compute logic.
- Hand Tracking: Real-time control using MediaPipe HandLandmarker.
- Visuals:
- Sun and 7 Planets (Mercury to Neptune) with relative sizes and colors.
- Orbital paths visualization.
- Dynamic text labels.
- A browser with WebGPU support (Chrome 113+, Edge, etc.)
- A webcam for interaction
Since this project uses ES Modules and WebGPU, you need to serve it with a local web server.
- Install the "Live Server" extension.
- Right-click
index.htmland select "Open with Live Server".
Run this command in the project directory:
python -m http.serverThen open http://localhost:8000.
npx serve .- Click Start Camera to enable gesture control.
- Allow camera access.
- Move your hand: The Sun follows your hand position in 3D space.
- Pinch (Thumb + Index): Zoom In.
- Open Hand: Zoom Out.
- Closed Fist: Stop/Freeze the Sun's position.
- Planets: The planets will gravitationally react to the Sun's new position.
- Mouse Control: If the camera is not active, the mouse can be used to move the Sun.
- Action Buttons: Use the on-screen buttons to manually Zoom In, Zoom Out, or Freeze the simulation. These buttons override gesture inputs.