Skip to content

August 11, 2007

17

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:

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:

17 Comments Post a comment
  1. kso
    Aug 21 2007

    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!

  2. Aug 21 2007

    Amazing work . Thx so much 4 sharing :)

  3. michael
    Aug 31 2007

    which format did you use in this example?collada or md2?
    i mean how to get the 3Dfiles with phsicx,thx,

  4. Sep 19 2007

    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…

  5. Jan 7 2008

    this is a great demo! thanx alot for sharing the sources. i’d like to see this redone it papversion3D 2.0!

  6. Jan 25 2008

    very eyecatching ;)

  7. Scubbatteve
    Dec 20 2008

    Site really resource

  8. Ces
    Jan 6 2009

    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!

  9. Manuel
    Jan 6 2009

    Hi Ces, you got mail ;)

  10. casimir
    Mar 4 2009

    Anyone knows how to run the Magic Carpet with FlashPlayer 10?

    How about the Full screen mode?

  11. casimir
    Mar 4 2009

    Anyone knows how to run the Magic Carpet in FlashPlayer 10?

  12. Manuel
    Mar 5 2009

    @casimir
    don’t know what problem you are experiencing: i’m running WinXP/Vista/Linux FP10 with no problems.

Trackbacks & Pingbacks

  1. Magic Carpet - APE
  2. Fábio Pedrosa » Magic Carpet
  3. actionscript microcosmos » Blog Archive » In shortness of time…
  4. The Magic Carpet at Manuel’s Coding Blog
  5. RIABG.org » Вълшебни килимчета и Papervision 3D

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments