First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Alex Nino | Website: http://www.yoambulante.com/
Verlet integration (actionscript 3), Try doing it by yourself, it is no longer than 10 mins...

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.

cheers!!

» Level Basic

Added: 2010-03-23
Rating: 10 Votes: 1
(10 being the highest)
» Author
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 couldn’t 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
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: doc_chin7
» Description:

The flash's horizontal road drive was done in CS4 and was upgraded to CS6. The car responds to right/ left key and flash will auto-generate the movement of roads from left-right or right-left based on random number. Have fun driving in this virtual environment and avoid other cars... :) If you are creative, a road driving game can be created from it.

Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.