Papervision 3D Programming Tutorial - Traer Physics

Posted Mar 02, 2009 by mcasperson / comments 0 comments / Print / Font Size Decrease font size Increase font size

See how to implement cloth physics in Papervision 3D. Demo and source code included.

VIEW THE DEMO
DOWNLOAD THE CODE

When I first player Hitman - Code name 47 I remember being impressed by the cloth physics in the game. The way the cloth moved around the character as he walked through a curtain gave the game a fluidity that I had never seen before. These days dynamic physics is almost expected in a 3D game. But while there are a few physics engines available for Flash (WOW and APE), they seemed quite basic or limited to 2D, and I never really saw an impressive physics demonstration.

I then came across a Java physics engine called Traer. The demos were simple, but kind of cool, and so I asked myself - why not do it in Flash? And so one Java decompiler and a few hours later and here is the result.

Unfortunately performance isn't great. The java version used a fast inverse function that I couldn't see how to replicate in ActionScript. However the code did port across with very few other changes, so you can use the documentation at the Trear homepage as a reference for the Actionscript version.

To test the physics I reproduced the cloth simulation example. Just click on the screen and you'll move one of the corners of the sheet. Even though it is slow, I think it is a pretty cool example of what is possible with Papervision and the Flash platform in general. Eventually I'd like to also replicate a few more of the java Traer examples.

Go back to Papervision Tutorials

Rate this Article:

Be the first to rate me.


* You must be logged in order to leave comments, please login or join us.

Comments

No comments yet.



Bookmark and Share
Sign up for our email newsletter
Name:
Email: