Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - rope physics (wave)

Author
Message
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 16th Feb 2012 14:25 Edited at: 16th Feb 2012 18:32
i made this quite accidentaly and i was quite astonished over the results :

it simulates a "rope" that you can grab and stretch.
oh and as always it requires advanced 2d and perhaps matr1x utils

the cool thing is that the waves that form follow the laws of physics!
when they reach the end of the rope, which is locked to a wall, it will not only bounce back but also it will inverse itself! which is what happens in real life. quite useless but cool. not sure how it will work on other computers as it requires a quite high framerate to look good and work like it should. i have restricted it to 1000 fps but it runs 2500 on my comp with theese settings.



haha! remembered the code!
Millenium7
19
Years of Service
User Offline
Joined: 13th Dec 2004
Location:
Posted: 23rd Feb 2012 10:47
My suggestion would be to expand on the math to account for time elapsed, rather than for each loop. So that the results will be approximately the same regardless of framerate

That would certainly help a lot in setting up a physics engine
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 23rd Feb 2012 22:51
Yeah it probably would if i were trying to do one, its just a doodle i made

Login to post a reply

Server time is: 2024-04-19 19:40:11
Your offset time is: 2024-04-19 19:40:11