Archived

This topic is now archived and is closed to further replies.

Doing springs

This topic is 5587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites