Microphone controlled animation in Papervision3D

This time I have something less mind-twisting then the bend modifier and all that math. The idea was to create an animation of leaves flying around, propelled by wind controlled with the microphone. This little experiment was also a good occasion to work with some new Papervision3D features.

Effects. The Papervision3D team decided to merge the Effects branch with Great White earlier this month. All the detailed information about that can be found on by Andy Zupko’s blog. There is a lot of cool stuff, so be sure to check it out. One of those is a new property of the DisplayObject3D called ‘useOwnContainer’. When set to true, all the classic bitmap effects can be applied directly to a mesh. In this case I used the BlurFilter, and the ColorMatrixFilter for the depth-of-field effect. The inspiration came from the really cool depth-of-field experiments by Mr.doob.

SimpleLevelOfDetail. With this one, the idea is that the further an object is from the camera, the less faces it has. That way we can get an important performance gain without sacrificing the quality too much. I tried to implement it, but I ran into some trouble. Later, after a brief discussion on the PV3D forum, Andy Zupko added the ‘SimpleLevelOfDetail’ class that implements this concept. I used it here. Thanks a lot, Andy!

Bend modifier. Finally, I use the Bend class to give the leaves a slightly more natural look.

Now, the fun part. The leaves react to the activity level of the microphone, so if you take yours and start to blow into it, they will take off and fly around. Be careful, if you blow too hard you will get a head rush! :)

If you do not have a microphone use your mouse wheel to create wind. Keep in mind however that it isn’t as much fun as with a mic. Also, on Windows, the microphone volume settings are really tricky and well hidden in multiple places, so if something is not working - double check those in the first place.

Last but not least, here’s the source code.

18 Responses to “Microphone controlled animation in Papervision3D”

  1. imrahil Says:

    woho! sweet!

  2. felix Says:

    a good combination of techniques.really nice!

  3. Lee Felarca Says:

    Really, really nice. Thanks.

    Lee

  4. Andy Says:

    very cool use of the new stuff! very fun to play with and looks awesome!

  5. vitaLee Says:

    you made my day man.
    pretty cool !!!
    and thanks for the source - there are lots of things to learn from it.

  6. Juan Says:

    Great work man. It looks awsome and is very fun.

  7. barret Says:

    really great, awesome experience.
    May I add a little suggestion?
    Freeze the rotationY of the leaf as soon as it touches the ground; each leaf would stop rotating at a different time. Also, I would have the leaves closer to the screen (smallest Z) to rotate a bit faster than the ones away when the mic is blown. Great nevertheless!

  8. bartek drozdz Says:

    @barret I updated the demo in the direction you mention, and it looks better now. Thanks for the tips!

  9. Mr.doob Says:

    Nice effect! :D

  10. Animation Says:

    Hello!I got the most reliable knowledge about Animation is the process of linking a series of slightly different drawings especially, cartoons together to simulate movement.Thanks!

  11. Vincent Says:

    Hello,
    I’m in the as3 learning process and can’t seem to make it compile right, wether with flashdevelop or flash…i keep gettin Error #1007. Is it the embed of the external png? it seems the flex sdk allows things that flash don’t like… thanks for any help

  12. frank Says:

    wow, beautiful and inspiring

  13. stef Says:

    Very very nice. Bravo !

  14. Marcel Fahle Says:

    Bro’, you’re nuts! :)

  15. chris Says:

    You forgot to include mask.png?

  16. bartek drozdz Says:

    @chris Thanks for noticing that, I updated the ZIP file.

  17. julie Says:

    can i have fla file for this plz

  18. bartek drozdz Says:

    @julie unfortunately there is no FLA file for this project - it was done with FlashDevelop and compiled with a Flex compiler. I wrote a short note about this technique here: http://www.everydayflash.com/blog/index.php/2008/07/01/flash-on-free-software-flashdevelop-flex-sdk/

Leave a Reply