Particle Simulator - Physics Engine v2


Experience the beauty of fluid dynamics and interactive physics in this high-performance visualizer.

Particle Simulator - Pro is a mesmerizing, browser-based physics experiment built with HTML5 Canvas. It blends mathematical precision with aesthetic "glassmorphism" UI to create a relaxing yet reactive digital playground. Watch as thousands of particles react to your touch, flow through invisible fields, and transform based on their kinetic energy.

Interactive Modes

The simulator features three distinct mathematical environments that you can toggle in real-time:

  • Flow State (SERBEST AKIŞ): Particles move through a mathematical noise field, creating organic, wind-like patterns. Mouse movement introduces localized turbulence.
  • Black Hole (KARADELİK): Your cursor/touch point becomes a gravitational singularity, pulling all active particles toward a central point.
  • Repulsor Field (İTİCİ ALAN): Create a high-energy kinetic barrier that pushes particles away, perfect for testing edge-collision physics.

Technical Features

  • Dynamic Particle Density: Automatically scales the particle count based on your screen resolution for an optimized performance (up to 2,500 particles).
  • Energy-Based Visuals: Particles change color and brightness dynamically based on their current velocity—shifting from cool blues at rest to fiery reds at "Critical" energy levels.
  • Real-time Physics Engine: Simulated friction, acceleration, and bounce-back collision mechanics.
  • Kinetic Trails: Each particle leaves a short-term mathematical trail, visualizing the flow of energy over time.
  • Responsive Glassmorphism UI: A sleek, semi-transparent control panel providing real-time data on active modes, particle count, and global energy levels.

Controls

  • Mouse Move / Touch: Interact with the particles and guide their flow.
  • Click / Tap: Cycle through the three interaction modes (Turbulence, Gravity, Repel).
  • Resize: The simulation automatically adjusts to fit any window size or orientation.

Behind the Code

This project is a pure JavaScript implementation utilizing the HTML5 Canvas API. It requires no external libraries, ensuring ultra-fast load times and offline compatibility. It is designed to demonstrate how simple mathematical formulas (Sine, Cosine, and Pythagorean distance) can result in complex, emergent behaviors.

Leave a comment

Log in with itch.io to leave a comment.