Verlet Physics & Collision

Monkey Forums/Monkey Code/Verlet Physics & Collision

NoOdle(Posted 2011) [#1]
Taken from the article here:

http://archive.gamedev.net/reference/programming/features/verletPhys/default.asp

I have translated the code by Benedikt Bitterli. You can find a download to his source on the last page of the article.

There is however a translation error in this code, if you uncomment the line that creates triangles you will see what I mean. Hopefully someone can spot where I went wrong.

Hold the upkey to run the simulation or uncomment the keydown lines.





matt(Posted 2011) [#2]
Do you mean the triangle shooting off a bit at the start?

If you decrease the step of the triangle generation from 130 to 120 (so they're a little closer together) it doesn't do that.

Other than that it works for me, nice one.


NoOdle(Posted 2011) [#3]
The shooting off at the start is fine as thats the response to force the triangles into the screen area. The problem I've observed is the triangles floating unrealistically instead of sliding off.


matt(Posted 2011) [#4]
Ah right, I now see what you mean.


RENGAC(Posted 2013) [#5]
I know that this is a very old post, but it's very useful for me. The solid objects seems that there is not any friction between them, as they slides a lot. Modifing the number of iterations changes a lot the simulation results.
Any of you have delved more deeper into verlet physics?