#### Archived

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

# Doing springs

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

## 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 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 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 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

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 19
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633362
• Total Posts
3011531
• ### Who's Online (See full list)

There are no registered users currently online

×