Yeah I know, this is maybe one more article speaking about Verlets physics in Flash but I think that it still worth going through it. The reason why I'm writing it is because of the people who wrote me and asked me about how the previous balloon logic was built and how the Verlet integration was applied on it (the balloon movement algorithm).
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 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 flights.
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! This tutorial explains step by step how Verlets physics works in flash (actionscript 3, flash player 10). In this example I'm creating a grid of 30 x 25 points, linking them by pairs, applying some gravity on each dot and making the stickers do the dirty work.
Take a look on this video I made explaning step by step the principals of the Verlet Integration; the whole practice doesn't take more than 9 minutes, try to do it by yourself, it is really simple to follow, all you need to have is the Flash Develop and the Open Source Flex SDK (you don't have to pay for any of them)
download the source code of it from yoambulante.com click here
I hope it is usefull to someone.
|» Level Basic|
Rating: 10 Votes: 1
|My bio... hmmm... what to say... I arrived on this crazy world clearly by mistake on March 81, in a far, far forgotten small town but with more problems than a whole nation, close to the pacific ocean in the Colombian territory, it is called Cali. Early I began playing with some gadgets like "telebolito", "intellivision", "Atari", and it was here when I started feeling interested in games and how they are being done but before start programming I've learned to play piano a guitar (I love music, can't live without it). Then I learned some programming languages such pascal with Borland Delphi, and C++ but I have to confess that it was Macromedia Flash who changed my life once we met each other in 98. I'm working with it since it didn't have support of mp3 audio format files, yes the version 3. And then together (Flash and I) started travelling around america looking for a better job opportunity and professional development than my hometown couldnt offer us at that moment. Special thanks to: Brazil, Costa Rica and Colombia for being a great school. At this moment I'm happily living and paying taxes in London, UK but like a salmon fish one day I will be back.|
|Download the files used in this tutorial.|
|Download (11 kb)|
|More help? Search our boards for quick answers!|