Water spring forces
The implementation is nearing completion, now. With this progress milestone, forces between the metaballs have been added.
Each metaball now acts as a particle at the end of a spring attached to every other metaball in the scene. This means that all the balls will smoothly attract and repel each other so that they lie within some minimum distance from each other. The implementation of this was as simple as applying the well-known Hooke's Law, and assuming a mass of 1 kg for each ball to get acceleration from the calculated force using Newton's Second Law. In order for metaballs far away to not be attracted to the other balls, a threshold maximum distance was also added, beyond which no spring force is applied. The minimum and maximum distances were tuned to achieve a good behavior. The image below shows a still image of the current state of the project.
A playable demo is also available through the following URL: https://geodropstudios.github.io/misc/metawaterDemos/second/index.html
Github commit for this progress: fcb04e1aeb472b947e1a135f6242c837a174a1e3
Each metaball now acts as a particle at the end of a spring attached to every other metaball in the scene. This means that all the balls will smoothly attract and repel each other so that they lie within some minimum distance from each other. The implementation of this was as simple as applying the well-known Hooke's Law, and assuming a mass of 1 kg for each ball to get acceleration from the calculated force using Newton's Second Law. In order for metaballs far away to not be attracted to the other balls, a threshold maximum distance was also added, beyond which no spring force is applied. The minimum and maximum distances were tuned to achieve a good behavior. The image below shows a still image of the current state of the project.
A playable demo is also available through the following URL: https://geodropstudios.github.io/misc/metawaterDemos/second/index.html
Github commit for this progress: fcb04e1aeb472b947e1a135f6242c837a174a1e3

Kommentarer
Skicka en kommentar