Hmm... "spring3.js" is not in the repo it seems. The only solution I could come up with to replicate the spring+gravity+collision is to add gravity to 2 of the particles, but not the 3rd. I thought that all particles would need springs between every other particle to kind of force any given particle away from BOTH of its neighbors. However, even doing that just had all three particles of the structure collapse to the bottom of the screen. Without gravity, they show proper tension to form an equilateral triangle, but the inclusion of gravity on all particles doesn't maintain that when at rest on the "ground". Removing gravity from one particle kept the 3-sided tension again, but somehow this doesn't feel "accurate" to me. And in fact, in running multiple simulations I see strange artifacts where the non-gravity particle is below the other two and gets "forced up" to the top of the resting structure by its separation value. This may (?) be a limitation of the particle system at this stage of its development, but I cannot check the repo to verify my answer.
This is the basics behind a 'force directed graph layout' algorithm.
This is indeed wicked pissah, thanks a lot Keith.
Use two particles attached to a point, and add collisions and gravity. Boob physics!
Once again, great lesson!
thanks!
This is so great! Thank you for sharing your knowledge!
Incredable lessons, I love it)
Cant help but wonder why you didnt make a "draw" method in the particle object.
Hmm... "spring3.js" is not in the repo it seems. The only solution I could come up with to replicate the spring+gravity+collision is to add gravity to 2 of the particles, but not the 3rd. I thought that all particles would need springs between every other particle to kind of force any given particle away from BOTH of its neighbors. However, even doing that just had all three particles of the structure collapse to the bottom of the screen.
Without gravity, they show proper tension to form an equilateral triangle, but the inclusion of gravity on all particles doesn't maintain that when at rest on the "ground". Removing gravity from one particle kept the 3-sided tension again, but somehow this doesn't feel "accurate" to me. And in fact, in running multiple simulations I see strange artifacts where the non-gravity particle is below the other two and gets "forced up" to the top of the resting structure by its separation value.
This may (?) be a limitation of the particle system at this stage of its development, but I cannot check the repo to verify my answer.