Doing springs

Started by
2 comments, last by redcliffe 21 years, 7 months ago
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
Advertisement
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
“[The clergy] believe that any portion of power confided to me, will be exerted in opposition to their schemes. And they believe rightly: for I have sworn upon the altar of God, eternal hostility against every form of tyranny over the mind of man” - Thomas Jefferson
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

This topic is closed to new replies.

Advertisement