PavelDoGreat / WebGL-Fluid-Simulation

Play with fluids in your browser (works even on mobile)
https://paveldogreat.github.io/WebGL-Fluid-Simulation/
MIT License
14.58k stars 1.67k forks source link

Unable to assign random action #1

Closed borgqueenx closed 5 years ago

borgqueenx commented 6 years ago

Hello Pavel, and thanks for this beautiful script that made alot of people play around with. Recently this html/java script has been converted to a iphone wallpaper because it's alot of fun to play around with.

Forgive me as these are not really issueses with your code, but rather issueses from us trying to understand the code and altering it, to make it a even better wallpaper, and failing to do so.

Im trying to get the code to drop the fluid effects at random times, where we can select the min and max values, and trying to get the code to make us able to select fade ins, and the speed of the effects. What would be the best, if the effects would pop in from outside the canvas/the screen. sometimes.

If you could help us, it would be great! Many people are using your code as their iphone wallpapers now already.

Thanks alot!

PavelDoGreat commented 6 years ago

@borgqueenx yeah I've seen this project, it's really cool!

Everything with spawing many fluids lies in the multipleSplats function. It's pretty simple - x, y is a position; dx, dy is a velocity. I think you can figure out the rest