Programming Rope Physics

Started by
4 comments, last by toXic1337 18 years, 8 months ago
Hello Everyone! I've finally decided to break my WoW binge and get back into programming! One of the things I've been thinking about are ropes... Like a rope hanging from a stationary position. If I wanted to make this rope swing (realistically), each point on the rope (infinitely) would have a different equation of rotation to the origin (the fixed location/pivot). Soooo, I'm wondering what you guys personal experiences with creating ropes for swinging/etc have produced and maybe some tips to how you accomplished what you did. I'm sure I could loop through a defined set of closely positioned points and draw sprites at each point, then move each point a given distance/rotation based on its distance from the origin... that seem inefficient? Anyways, I'm stumped! All help appreciated, toXic1337
toXic1337
Advertisement
Pendulum motion like what you describe is fairly well defined in Newtonian Physics. I'd just plot various point along the 'length' of the rope according to the equations, rendering a [small] circle there. Depending on how that looks, I might add extra 'weight' to each point in proportion to its closeness to the fixed attachment.

Sorry I can't be more help, but the actual math involved is 2nd-3rd semester calculus, and it's been a long time for me.
I've implemented a nice rope system using Verlet integration. It was really simple and produced nice results.

Here is a really good article on Verlet. It's written with ragdolls in mind, but it works great for ropes as well.

If you need more info about how my system works, just let me know and I'll make a more detailed post.
Aye!

I actually did think of doing this with some Calculus, was just avoiding it with fury.

Anyway, I'll get a subscription to Gamasutra and check out that article.

Thanks for the help guys! Also, if any of you have a way around using calculus please let me know, I'm 5 days from Calculus III, and I've sworn not to use the devil art again till it's needed [grin]

Thanks again guys!

toXic1337
toXic1337
I second Jakobsen physics.

But definitely not the only method out there.

Have you played the old worms games? Did you notice how the rope system worked? It was rather impressive in my opinion. A rigid swinging rope could bend at the exact point of contact and transfer of energy was believable.

Now about Calculus, I would be suprised if you found yourself needing it at this point. Usually the math for real-time applications that I have come across is fairly simple. That said, a more traditional approach to the topic might involve using it.
....[size="1"]Brent Gunning
That's what inspired my interest in ropes at the moment!

I know there is an easy way... time to break out the PS1 and see the ropes in an annalytical sense.
toXic1337

This topic is closed to new replies.

Advertisement