Hi guys, I have made a video that I would like to discuss with you. This is about the verlet integration in actionscript 3, how it is being implemented in flash and what’s the best approach of it, same that most of the physics engines are using out there.
The first time I heard about Verlets was about 10 years ago I think, when I was working on a C++ program building a dynamic animated bridge, at that time all documents and resources I found about Verlets were really confusing and at the end I gave up on it (sometimes people explain things in the most complicated way). Last year 2009 in flash on the beach (Brighton, UK) when I was attending the session of [URL=“http://www.bit-101.com/blog/”]Keith Peters, he came with some really good ideas about how to implement the “Verlet Integration” in flash using actionscript 3 in a very, very easy way that makes my imagination fly.
For people who haven’t heard about it. The “Verlet integration” consists in dots and links between these dots where each dot has remembered which was its previous position to determine its next step, the new position of x is equal to x + x – previous_x (same for y) and then each of these dots are associated (grouped) by pairs that try to keep same distance between each other as they were when the program started.
Does it sound simple? It’s because It is really simple! the whole practice doesn’t take longer than 10 mins, I think that it really worth watching it if you haven’t heard about anything and if you are familiar with it we could discuss about how can it be improved, I’m really up for it.
Here is the video I made (in youtube) explaning step by step how it works: http://www.youtube.com/watch?v=8bAQbJzqa-0
[URL=“http://www.youtube.com/watch?v=8bAQbJzqa-0”]
I have attached the source code of it in this post but the whole thing (including the compiled swf) can be found on http://www.yoambulante.com/en/labs/verlet.php
I’m not making advertising of it and it could be true that it is a quite old fashion thing but I think that it really worth going through it, cheers!