WIRE , CHAIN

Started by
7 comments, last by bzroom 14 years, 6 months ago
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
Advertisement
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
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..
You divide the chain in links, create distance constraints between adjacent links and put it all in a physic solver.
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).
good. i will thing about this; thanks for reply! :)
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.
@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.
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.

This topic is closed to new replies.

Advertisement