๐ Project Overview
Stardance is an interactive, browser-based gravity simulator built using p5.js.
The goal is to simulate orbital mechanics, planetary mass interactions, and cosmic chaotic systems through a clean, modern dashboard interface.
๐ ๏ธ Tech Stack
Frontend : HTML5, CSS3
Graphics/Simulation Engine : p5.js
Fonts : Orbitron & Inter
๐ Current Progress
Whatโs Working:
Core UI Layout : Implemented a sleek, responsive sidebar control panel using frosted glass visual effects (backdrop-filter).
Dashboard Telemetry: Real-time tracking elements ready for planet count, total mass, simulation runtime, and FPS.
Simulation Controls:Fully configured range sliders for dynamic adjustments to Spawn Mass, Simulation Speed, and camera settings (Zoom and Rotation).
Preset Engine Architecture: Buttons configured to swap between pre-calculated gravity scenarios: Solar System, Binary Stars, Galaxy Spirals, Planetary Rings, Black Holes, and Chaos.
Data Persistence: Hooks added for exporting state to JSON/PNG and importing custom orbital systems.
Recent Changes:
Applied a deep-space galaxy background across the canvas space to contrast against the bright orbital trajectories.
Structured modular JavaScript engine architecture (planet.js , presets.js,physics.js, sketch.js) to decouple physics math from render routines.
๐ Current Challenges & Next Steps
-
Orbital Physics : Fine-tuning the gravitational constant in
physics.jsso planets donโt immediately sling out of bounds or collapse into the central mass on spawn. -
Performance Tuning: Optimizing the $O(N^2)$ particle-to-particle attraction loops when the Chaos preset spawns high planet counts.
-
Tail rendering: Ensuring the p5.js canvas buffer correctly handles alpha-blended paths for smooth planetary trails.
๐ก Lessons Learned
When building canvas-heavy overlay interfaces, keeping a strict coordinate distinction between screen space (UI) and world space (simulation physics) is essential to keep zoom and pan gestures functioning correctly.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.