Doing springs
I''m currently hacking a test of a cloth animation thing. I have an array of particles, and I want to link these using springs? I''m already applying gravity to the particles, and I know how to do the collision stuff, but how do implement springs between my particles? Thanks,
David
Hmm, I think it would work something like this:
Let x be the distance between the two particles that are hooked by a spring (ie. the "desired" distance - the size of the spring). The force exerted by the spring between the particles is proportional to (the actual distance minus x). So if the particles are really close together and the spring is compressed, the force will be negative and push them apart. And the farther apart the particles the more force pulling them together.
Firebird Entertainment
Let x be the distance between the two particles that are hooked by a spring (ie. the "desired" distance - the size of the spring). The force exerted by the spring between the particles is proportional to (the actual distance minus x). So if the particles are really close together and the spring is compressed, the force will be negative and push them apart. And the farther apart the particles the more force pulling them together.
Firebird Entertainment
quote:Original post by Tron3k
Hmm, I think it would work something like this:
Let x be the distance between the two particles that are hooked by a spring (ie. the "desired" distance - the size of the spring). The force exerted by the spring between the particles is proportional to (the actual distance minus x). So if the particles are really close together and the spring is compressed, the force will be negative and push them apart. And the farther apart the particles the more force pulling them together.
Firebird Entertainment
Yep okay, but if one particle moves all the others that are attached to it may also move. How do I calculate this? Thanks,
David
Go to www.gamasutra.com and look under the articles section. There should be a list of articles, and a fairly recent one was on doing spring stuff. If you are not a member of gamasutra.com, sign up for it (its free).
Moe''s site
Moe''s site
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement