We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all,
I want to make a grid of particles where each particle gets attracted to it's initial position. Then I want to repel these particles with the position of my mouse. When I leave my mouse out of the area, the particles will return to their initial state.
Thanks in advance!
Answers
Thanks! I also looked into some of the older video's of Dan Shiffman where he explains more about steering and arriving behaviour. Going to look into that too ;)
For a non-particle-based immediate rendering of this mouse-repels-points effect, you could also modify the Processing Distance2D or Array2D examples
Here is an example using PVector:
...although i believe you could also achieve this effect using arctangent:
Note however that this rendering is immediate and almost based on the latest mouse position -- making these dots displace in messy ways or "drift back" might be quite complex compared to the particle-based approach.