# WIRE , CHAIN

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

## Recommended Posts

Simple question: how do i simulate a wire , roupe or a chain in 2d simulation? () if you have any ideas, suggestion i'd like to hear them

##### Share on other sites
Before answering this, I need to know a little about your background. How much programming experience do you have? Do you know how to use vector math? Have you done other physics simulations?

cheers,
Mike

##### Share on other sites
Well i know to use vector matrices, and for example: the last thing done for engine is to calculate the angle rotation between too balls; so i know some..

##### Share on other sites
You divide the chain in links, create distance constraints between adjacent links and put it all in a physic solver.

##### Share on other sites
Nehe has a very simple tutorial (get's quickly unstable though) about rope physics link (nehe lesson 40), maybe that can give you some inspiration (a rope = chain of springs).

##### Share on other sites
I would try relaxation first. It's very simple. You iterate over the chain multiple times. For each segement you compute the difference between the intended length and the actual length between the segment vertices. Then you move the vertices slightly towards the intended length. This will violate the neighboring segments, but then you adjust those as well. You continue this until all the segments are within some tolerance of the intended length.

It works very well. It works well with verlet integration also.

##### Share on other sites
@bzroom

AFAIK this relaxation method, where you change positin directly, conserves energy very poorly. If you use this method, a swinging rope will come to a halt quite fast, even if no damping or friction is added to the simulation.

If you want the rope to be able to swing as-good-as ifinitley, you will probably need to do something along the lines of the NEHE spring simulation tutorial linked to earlier.

##### Share on other sites
You're right. I was thinking more along the lines of just finding a solution, not necessarily a real time interactive simulation of the rope. Modifying the velocity with forces would be much more satisfying to play with.

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633759
• Total Posts
3013720
×