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.

June 24th, 2008 at 11:02 pm
woho! sweet!
June 24th, 2008 at 11:28 pm
a good combination of techniques.really nice!
June 24th, 2008 at 11:53 pm
Really, really nice. Thanks.
Lee
June 24th, 2008 at 11:55 pm
very cool use of the new stuff! very fun to play with and looks awesome!
June 25th, 2008 at 12:05 am
you made my day man.
pretty cool !!!
and thanks for the source - there are lots of things to learn from it.
June 25th, 2008 at 1:39 am
Great work man. It looks awsome and is very fun.
June 25th, 2008 at 2:29 pm
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!
June 25th, 2008 at 10:14 pm
@barret I updated the demo in the direction you mention, and it looks better now. Thanks for the tips!
June 26th, 2008 at 7:47 pm
Nice effect! :D
June 27th, 2008 at 10:27 am
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!
June 27th, 2008 at 1:07 pm
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
June 27th, 2008 at 1:24 pm
wow, beautiful and inspiring
July 3rd, 2008 at 10:19 pm
Very very nice. Bravo !
July 7th, 2008 at 2:50 pm
Bro’, you’re nuts! :)
July 29th, 2008 at 4:15 pm
You forgot to include mask.png?
July 29th, 2008 at 10:35 pm
@chris Thanks for noticing that, I updated the ZIP file.
August 20th, 2008 at 1:52 pm
can i have fla file for this plz
August 20th, 2008 at 1:58 pm
@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/