A simple particle system with a flow field effect using HTML5 Canvas and JavaScript.
This project creates a flow field particle system on an HTML5 canvas. Each particle is influenced by a flow field, resulting in dynamic and visually appealing patterns. You can customize the number of particles, cell size, zoom, and curve parameters to create different effects.
-
Clone the repository:
git clone https://github.com/lexO-dat/flow-field-particle-system.git
-
Open
index.html
in your web browser.
- Open
index.html
in a web browser. - Experiment with the flow field parameters using the commented-out input elements (
zoomInput
andcurveInput
) in the HTML file. - Observe the mesmerizing patterns created by the flow field particle system.
Adjust the following parameters in the Effect
class to customize the visual output:
-
numberParticles
: Number of particles in the system. -
cellSize
: Size of each cell in the flow field. -
zoom
: Zoom factor affecting the flow field. -
curve
: Curve factor influencing the flow field. -
Adjust the trigonometric functions in the
Effect
class to influence the flow field (line 94):// Customize the trigonometric functions or experiment with another func this.xSpeed = Math.cos(angle); this.ySpeed = Math.sin(angle);