PDA

View Full Version : Math algorithm for rope



freakdiver
02-26-2004, 06:16 PM
Do any of you experts outthere knows any algorithm for simulating rope? or even to simulate picking up a rope from one end where the rope curls (like a sin/cos curve)?

I couldn't figure out how. The only idea i got is:

1) the rope (made up 35 balls tighly together) is lying flat on the ground (y = 0, x: 0 - 35);

2) when we pick the rope up (y=20) from x0 end, that means, for BALL0, the y will be 20, BALL1 = 19, BALL2 = 18 and so on until maybe BALL7 = 1 and BALL* onwards is still lying on the ground.

Does anybody have a simple (not confusing) algorithm?

Thanks in advance

phobos
02-27-2004, 01:25 AM
There's a good lesson about rope phisics at nehe site (http://nehe.gamedev.net), should be lesson 40.
I hope this can help you.
bye

freakdiver
02-27-2004, 05:09 AM
yeah i've been there but it requires me to write a physics engine which is troublesome for such an 'easy' project..

thanks tho'

KuriousOrange
02-27-2004, 06:51 AM
Everything you need is here: http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm

chemdog
03-06-2004, 01:33 AM
Given two end points a rope will hang in a caternary between them. It's defined by a hyperbolic trig function. (cosh I think). The two end points determine the phase, and the weight of the rope (density) determines the constant factor out in front. factor * cosh( endpoint stuff)