Away3D: Physics with WOW
March 1, 2008
I’ve been very busy these days. In addition to starting a new music project, I’ve been doing quite a bit of Actionscript 3.0 coding as part of the build-out for the new atombang.com and soundemitter.com websites.
This is an experiment in realtime physics, using the Away3D and WOW frameworks. It also incorporates some other features, such as dynamic depth-of-field, dynamic motion blurring, camera tweening, and object mouseover tracking.
Warning: the rest of this post is geek-talk. If you don’t get into this sort of thing, skip to the next post!
The system is kept ‘alive’ by adding random forces to each of the spheres every 100ms. If you want to agitate the system further, press and hold the mouse button.
:: Update: There are now controls in the upper-left that will allow you to adjust some of the physical scene properties in realtime!
In order to integrate the two engines, I wrote a wrapper class around an Object3D instance to allow for calculation of its physical properties once each time through the main rendering loop. It’s a quick & dirty solution that seems to work very well. However, I’m currently in the process of writing a more robust solution—which also includes my own physics classes as a compliment to what is available in WOW.
I’ll be happy to open the sources up for anyone who wishes to have them. I just need to clean up the code and pull out some stuff not pertinent to the experiment.
Filed under: Designlogic |


Woah it’s nice
Thanks, Seraf… both for the kind words, and the excellent WOW engine. Great work. Looking forward to seeing what direction you take the code in the future.
Very very amazing, when are you releasing the code?
How about… today? ;)
Here is a zip containing the a stripped-down version of this example. I’ve removed some things not pertinent to the experiment, so that the focus is soley on the integration of Away3D and WOW.
http://www.atombang.com/flashlab/phys/source/away3d-wow-1.zip
Enjoy!
thank you for you great example !
can you show me another example to drag wow-engine ?thank you !
My pleasure, Lovedog.
I’m working on an example that shows dragging, but this is a tricky thing to do while keeping the interface simple. I could just place UI widgets or force arcane key-combos on the user. That’s lame. I would rather a more fluid, elegant, and intuitive way to grab and position an object in space. I am close to a working solution and will keep you posted.
In the meantime, you can alter the position of your WOW object (in this case, a WSphere), by changing its px, py, and pz parameters.
HTH,
atom(x)