Creating Rope help..

Topics: User Forum
May 15, 2009 at 3:56 AM

Now i have managed to make something like elastic using linear springs connected to circles all along the rope but i cant seem to get them to not strech so much ideally i would like them to not strech at all or a very very small amount (like 1% of its length)

anyway any help or even ideas to try would be a great help

May 15, 2009 at 4:15 AM

Hey danthekilla, I've got a rope that works reasonably nicely. You can use the Path class. This turned out to be the secret:

I have something that may meet your needs. I'm using a modified version of the farseer Path() class with Linear Springs. I give the path a new field called _linkWidth which is used in place of _width when determining the distance between links. The bodies are still created using _width. After the path is built (with _linkWidth = _width * 2), I go through all the springs and set their rest length to a pretty small value. This gives the effect of creating a stretched out rubber band that springs back, as opposed to the default behaviour of a compressed rubber band that unfurls

More info and ideas in this post: http://farseerphysics.codeplex.com/Thread/View.aspx?ThreadId=49501

If you want zero stretch, revolute joints are the way to go as they are much more stable than springs. You can probably get a small amount of stretch with springs by applying my above technique and setting the SpringConstant to something quite high. Also, for a really cool effect, use Curves when rendering the rope - it looks so much better and lets you reduce the link count. I'll hopefully get around to making a video of my rope in action some time soon.

 

May 15, 2009 at 5:15 AM

thanks for this do you have any idea on how to create a rope made of revolute joints

i tried it and it just gos crazy and then crashes with a NaN error

Coordinator
May 15, 2009 at 12:31 PM

@danthekilla: If you create the path in such a way that when the simulation starts, it contacts a lot with a high speed, this can make it explode and give you the NaN error. Also, if you use a low rectanglemass, it will also explode. I'll see what I can do to make the path class more stable.

@roonda: If you create any videos or tutorials, be sure to let me know. You might have noticed yobiv creating a lot of tutorials lately, it's great and need more of those. I've made a tutorial wiki page here: http://farseerphysics.codeplex.com/Wiki/View.aspx?title=Tutorials