Carpet’s sources
Here is the source code for the Magic Carpet demo, just unpack it in your project directory of choice and import the project in Flex Builder, making sure to resolve the dependancies as it makes use of the following packages:
- PaperVision3D in its head revision;
- ASWing in its 1.0 A3 Flex compiler release;
- APE in its v0.45 alpha release (provided w/ modifications);
Let me explain the modifications in APE: i just wanted the engine to perform the timestep in a fixed fashion, so i initially modified it to accept a value, expressed in Hz, that represents the integrator’s timestep to be used, this way no matter if different machines have different framerates, animating will be the same everywhere.
Then i was in need to rebuild the mesh at runtime since i wanted to be able to define tesselation and spacing directly from the UI: by trying to modify the values i got huge slowdowns and hangs that i have no clue of what that was, until later on i realized that APE was creating and attaching hundred of Sprite objects to its container. I tried to use a NullSprite object since i thought it would be ok to provide a reference to a common null-painter object, but that won’t did the trick, so i just settled things once and for all and removed most of the “presentation” logic in it as also i really had no need to have Sprite objects instanced and added for every particle and spring.
Download Magic Carpet v1.0b5 src
*UPDATE*
I uploaded a video on YouTube if you just want to take a look at it:
| Print article | This entry was posted by Manuel on August 11, 2007 at 16:20, and is filed under as3. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

about 2 years ago
Sorry for this newbie’s question :) but I’m trying to test your application and I have problems with it. I created a Flex project, I unzip your file in this project, I downloaded all the missing libraries (papervision and aswing) and I put these lines in my mxml file.
And of course it doesn’t work (it stays in the ‘initializing’ state).
Is it possible to make a brief tutorial for newbies like me? :D
Congratulations for your job is really impressive!
about 2 years ago
Amazing work . Thx so much 4 sharing :)
about 2 years ago
which format did you use in this example?collada or md2?
i mean how to get the 3Dfiles with phsicx,thx,
about 2 years ago
http://smallfly.com/ … this carpet would be fun to play with on a multitouch screen…
Not sure how well performance would hold up…. but man would it be fun…
about 2 years ago
this is a great demo! thanx alot for sharing the sources. i’d like to see this redone it papversion3D 2.0!
about 2 years ago
very eyecatching ;)
about 1 year ago
Site really resource
about 1 year ago
May I use this source code for commercial purposes?
I need to add a hanging arabian carpet to a website I’m working on.
Thanks! That’s a great job you’ve done!
about 1 year ago
Hi Ces, you got mail ;)
about 1 year ago
Anyone knows how to run the Magic Carpet with FlashPlayer 10?
How about the Full screen mode?
about 1 year ago
Anyone knows how to run the Magic Carpet in FlashPlayer 10?
about 1 year ago
@casimir
don’t know what problem you are experiencing: i’m running WinXP/Vista/Linux FP10 with no problems.