Start animation on mouse move?
Thank you for this great animation! Absolutely amazing! I like to use this for our website background.
https://www.zahmundzornig.de/zuz
I change some issue for our needs. Her is one thing I can´t solve on desktop view: Actually the animation starts with a mouse click (mousedown). But I like to start the animation one mousemove. The animation should be start directly after loading only with mouse moving. Any ideas? Thank you!
this line, move it to the bottom of a function and change it to pointer.moved = Math.abs(pointer.deltaX) > 0 || Math.abs(pointer.deltaY) > 0;
There is also can be a problem when deltaX and deltaY can be very high on first frame mouse move which can destroy simulation.
Thank you, that works! I aware of the high deltaXY. Most of the time it works fine. Sometimes it destroys the simulation. But thats ok for now.
Simulation will crash if mouse is moving in the begining. Which can be solved by delaying the mousemove event listener. It's worth making it configurable:
import WebglFuild from 'webgl-fluid'
WebglFuild(document.querySelector('canvas'), {
TRIGGER: 'hover', // Can be change to 'click'
})