>> Looking for the source code? Just go the next post here<<
I managed to have some time to put together the simulation i was talking about last week: roughly based on a “Flade” (now APE) demo of that time, it makes use of APE for the physics and Papervision3D for the rasterization process.
Actually, using PV3D for merely rasterizing polygons its obviously an ugly solution if you, like me, don’t need all the scene management and just need to stretch bitmaps around: the real reason behind that choice is simply i was curious to see (1) how PV3D performed in a similar situation and (2) how to be able to bind APE and PV3D together.
Anyway, just modelling and simulating the carpet wasn’t enough: the motion were great and performing quite well, but it was lacking completely the sense and taste of realism one would expect from such a scene and the particular type of motion one can interact with.
I started by adding a (really) fake shadow that i’m too lazy to change and, since then, i liked the idea and adding a reflection was the next logical step for that context: it was still lacking some motion “feeling” so i also tried to mimic a directional blur simply by programmatically reducing the amount of blur on the slowest x-y direction.
I stopped experimenting with the blur thing, but i think it could be somewhat enhanced: i was thinking about a 3×3 / 5×5 kernel convolution filter in order to enhance angular motion, but i really have no time to try this out… do you know if this has been already attempted before?
Anyway, beside having a carpet pinned in a void chamber, although funny and nice to interact with, the scene lighting and colors weren’t so exciting, so i decided to play with bitmaps and filters with realtime compositing and post-processing in mind, eventually ending up with a bloom-like filter that seems to be able to enhance the imagery quite well.
The UI will permit to adjust the values of the simulation, output, effects and post-processing: since the computations can be really heavy and stopping the VM from working, an automatic adjustment of the physics integration timestep is enabled by default and it will look green/red when working for you, meaning respectively it’s raising/lowering the timestep.
During the development i’ve tried different versions of the Flash Player and here are the results:
- 9.0.45 - 9.0.47: on my machine i got something like 50fps with the default settings, some glitches can occur when changing the “Simulation” tab’s settings and i rarely got a Flash Player crash;
- 9.0.60.120: i got 60/65fps with default settings, no glitches occurs while modifying “Simulation” values and no crashes directly correlated with this have occured. There is a really odd behavior of the Flash Player btw, where a vertical band on the left can be seen when playing with the carpet smashing it from right to left: the vertical band’s width seems to be related to the position of the carpet but i’m still investigating that; playing with the carpet on the vertical band DOES hang the Flash Player. Hope to be able to tell more info on that: in the meantime, turning off the post-processing will prevent the problems from happening.
As a final note, i highly recommend to install the latest beta of the Flash Player since the performance really got a boost.
Let me know how it works for you: also, i plan to release the source code for both the demo and my modified version of APE (to let it to work with a fixed timestep expressed in Hz) so i’ll update these pages pretty soon.
53 Responses
Magic Carpet « Papervision3D
August 21st, 2007 at 10:07 1[...] Bua, a very talented software developer based in Trento (Italy), has created Magic Carpet, a carpet simulation demo powered by Alex Cove’s excellent APE physics [...]
Dennis
August 21st, 2007 at 12:35 2Man, this is really amazing!!! Respect!
Paul
August 21st, 2007 at 14:40 3Totally owsome! Man, you rule!
John Grden
August 21st, 2007 at 16:17 4Amazing only starts to cover it…this freaking ROCKS \m/
Manuel
August 21st, 2007 at 19:24 5Hey big thanks for your feedback!
Nate Chatellier
August 21st, 2007 at 19:48 6Brilliant work. Even the shadows/blurs/reflections look gorgeous. And the source code to boot! Excellent contribution.
admin
August 21st, 2007 at 20:37 7Its magic! Well done, didn’t see a lot using APE (yet) with PaperVision 3D.
katopz
August 22nd, 2007 at 5:33 8god…, don’t stop doing this!
Diogo Moutinho
August 22nd, 2007 at 10:05 9Great work!!! This is a great idea! I especially liked the fact that the simulation is “careful” not to crash flash and auto adjusts. Once again, great work, keep it up!
George
August 22nd, 2007 at 11:28 10great stuff
Fábio Pedrosa » Magic Carpet
August 22nd, 2007 at 19:59 11[...] new Papervision sample just got featured on their blog, and its certainly interesting. This code is Manuel Bua’s [...]
links for 2007-08-23 « Simply… A User
August 23rd, 2007 at 1:41 12[...] Manuel’s Coding Blog » The Magic Carpet (tags: flash actionscript papervision3d as3 ape 3d animation flex physics motion demo **) [...]
Ted
August 24th, 2007 at 15:46 13I’m incredibly impressed by the performance. The postprocessing is what really makes this demo shine– I’m curious about what you used for the bloom effect. That, in combination with the motion blur, really takes it to the next level. I’ve played around with APE and found the API pleasantly simple yet powerful. Still have yet to get in depth with PV3D though!
Kudos^100 to you!! And I must say, kudos to the new AVM developers, the performance boosts are some excellent work.
top paper vision demos - Graphic Design Forum and Web Design Forum
August 24th, 2007 at 23:51 14[...] The new Audi A5**/**//*/****/**/**/**/**A rhythm of lines loader Papervision3D - takes time to load Manuel’s Coding Blog » The Magic Carpet - scroll down the page to view magic carpet renderhjs 2k6 [...]
Bl4deRunner
August 27th, 2007 at 11:01 15This is really totally awsome! Adobe should have a talk with you!
John Tribble
August 27th, 2007 at 14:52 16alec cove not alex cove
Josh Strike
August 29th, 2007 at 2:35 17What I don’t get…what I’m trying to understand from the code, having not ever used APE…is how you’re deriving the z coordinates. Making a point mesh was a great call for fabrics, etc…. it’s a really fantastic demo. But how are you getting the z for the points, or are they just falling through z to zero at a static rate of acceleration irregardless of their adjoining points?
Fred
August 29th, 2007 at 8:18 18Beh, complimenti per la naturalezza del movimento e per la resa complessiva!
The Magic Carpet » Darren Richardson
August 29th, 2007 at 15:48 19[...] papervision - The Magic Carpet example [...]
The Magic Carpet
August 29th, 2007 at 16:06 20[...] This is a real-time cloth simulation coded in AS3 and later enhanced by post-processing the result. You can find the demo and the source code at here. [...]
Rafeo
August 30th, 2007 at 1:29 21All my respect ! Thanks for sharing it!
listtoday
August 31st, 2007 at 10:36 22[...] http://manuel.bit-fire.com/2007/08/10/the-magic-carpet/ ÃÂrta: astro 2007.08.31 trackback [...]
chafe nest
August 31st, 2007 at 20:55 23damn man. good work.
Ciccio
September 3rd, 2007 at 13:45 24You are an hero! Brao vecio
pioup
September 5th, 2007 at 16:27 25excellent !
good work.
Max Strebel
September 13th, 2007 at 17:02 26this is really excellent!
Zareste
September 18th, 2007 at 23:02 27I never thought this could be done with Flash. At first, I hated what Adobe did with Actionscript, but maybe it’s replacing Java once and for all
blog.nm-graefen » Blog Archive » Manuel Bua - The Magic Carpet
October 12th, 2007 at 21:32 28[...] Heute stiess ich auf den Blog von Manuel Bua, ein italienisches Action Script Genie, und was ich dort entdeckt habe hat mich wirklich beindruckt. Eine 3D-Simulation eines Teppichs mit PaperVision3D und APE. Unbedingt anschauen! [...]
b.asile
October 13th, 2007 at 15:03 29This is amazing! Great work!!!
think!!
October 14th, 2007 at 9:49 30amazing, respect.
Chris
October 30th, 2007 at 11:23 31blown away!
Y-man
October 30th, 2007 at 14:05 32really cool!
but why doesn’t thi carpet roll up when spinnin’ or i don get smth ?
anyway this’s awesome plz don’t stop )
Home of a Risktaker | Hikmat b. Iskandar - Malaysian Web Designer. Software Developer. » Holy %@#$, this is Flash!
November 9th, 2007 at 0:39 33[...] it out. Created using APE and Papervision3D. Both of these libraries emulates physics and 3D interpolation [...]
pv3d newbie
November 13th, 2007 at 1:09 34how do you open thsi file what is a project file and ACTIONSCRIPTPROPERTIES File
ryan
December 3rd, 2007 at 3:24 35where’s source code?thanks
vigo
December 5th, 2007 at 18:03 36Nice work. Keep going same way.
idefix
December 12th, 2007 at 15:10 37Man, this is just beautiful. I’m stunned. Really. You really got me enthusiastic to start working on 3d physics in flash. I haven’t done a lot of work with AS3 (my company wants me to work in AS2 for now), but I’m definitely going to dive deep into it now. Are you planning on releasing the source code anytime? It’s gonna be a really big help and inspiration for a lot of people I’m sure. Great work again. Compliments.
Manuel
December 13th, 2007 at 9:07 38@idefix and @ryan
I’m happy you’ll start digging into physics and Flash, and sure you can take a look to the source code at http://manuel.bit-fire.com/2007/08/11/carpets-sources/
Octopus
December 14th, 2007 at 23:10 39Finally, a papervision3D demo that is not disappointing! Of course it’s the (APE) physics that make this impressive. And after spending several hours perusing the web for Papervision3D demos this is the first one I’ve come across that truly impresses me! Great job!
Dr.flash
January 4th, 2008 at 21:40 40wow……………………………..
Jim
January 29th, 2008 at 17:26 41that is very, very good.
i stublemed onto this looking for carpet related blog posts.
my friend matt askey had a very different experience with the carpet on the floor of my kitchen this weekend.
That has very little to do with you post though so i appologise, but again the flash & Physics is impressive to say the least.
Jim
Christophe van Engelen
January 31st, 2008 at 15:10 42nice effect
Exey
February 5th, 2008 at 2:17 43Thanx, very inspiring!
Manuel, Xero. I tried to porting Magic Carpet on GreatWhite, it working but not right, because i got into muddle in new pv3d20’s center coordinates point, i hardcoded it:
in Simulator.as > CenterMesh():
var x: int = ( Configuration.OUTPUT_WIDTH - aWidth ) / 2. - Configuration.OUTPUT_WIDTH/2;
var y: int = 50 - Configuration.OUTPUT_HEIGHT/2;
in ParticlePicker.as > tick():
pickedParticle.px = Resources.theStage.mouseX - Configuration.OUTPUT_WIDTH/2;
pickedParticle.py = Resources.theStage.mouseY - Configuration.OUTPUT_HEIGHT/2;
Where is else need to fix coordinate point?
http://exey.ru/MagicCarpet_pv3d20.zip
blog.ad2.com » Blog Archive » Magic Carpet Ride
February 8th, 2008 at 23:20 44[...] http://manuel.bit-fire.com/2007/08/10/the-magic-carpet/ [...]
barato
March 3rd, 2008 at 0:07 45Nice work
Compiz-like wobbling windows in AS3 — Manuel’s Coding Blog
September 7th, 2008 at 20:52 46[...] of the actual wobble animator took inspiration from the previous Magic Carpet demo and some stuff i found on the net: if you come up with some other effects let me know, [...]
Burrows
September 11th, 2008 at 7:53 47awesome effect ,i like it
mxky
September 17th, 2008 at 16:28 48Great effect, where did you learned this dude
Ben Sumner
October 10th, 2008 at 6:27 49Wow, I just love this, and I cannot imagine the amount of work! I just got started with Papervision 3D. I am interested in getting something liek this on my site. if you go to http://www.blindmanstudio.com you will see my site’s logo/avatar ont he top. he is a collada model. There is a blindfold on him with a piece hanging off the back. I was wondering would it be at all possible to get a cloth sim going on that piece? and keep it attached to him?
if you could please give me some feedback on the possibility of this, I will be looking at the source code to try and figure it out int he meantime…
if you are willing to help, my contact info is on my site!
and thanks again for giving the source on this, SO much I can learn from it!
Keyanna
October 27th, 2008 at 16:51 50Great work.
Carpet Cleaning NJ
November 14th, 2008 at 5:50 51Thanks for the information. It would be nice if more people commented on this topic. It’s not too confusing if you read and understand then please teach what your learning..
Interface Design » Manuel Bua’s Magic Carpet
December 9th, 2008 at 21:07 52[...] etwas älter, aber immer noch kick ass: Der Magic Carpet von Manuel Bua, erstellt mit der Papervision 3d API und unter Zuhilfenahme von [...]
sonson
January 5th, 2009 at 1:11 53hello…
super!…
Leave a reply