AS3Dmod, a modifier library for all Flash 3d engines

Meet AS3Dmod, a cross-engine 3d modifier library for Flash. Sounds cool? Yeah, I am sure it does! Just in case, however, let’s see what it does step by step.

A. Cross-engine. 3D in Flash is around here for some time now, and it resulted in quite a few engines available. Each engine has some cool features of its own, and sometimes having to choose between them can result in a headache. While AS3Dmod won’t solve this situation, it is an attempt to create some functionality that will be available across different engines.

B. Modifier library. The readers of this blog probably remember the Bend modifier I wrote for PV3D. Well, it is one of many possible modifiers. Classic 3d packages come equipped with at least a dozen of them, which include: taper, twist, noise, skew, etc. Modifiers are basically functions that can be applied to a 3d object to transform it in a certain way. They can be used separately, but when combined they become a very powerful tool. In this, they are much like filters in Photoshop.

C. Flash. Instead of explaining how modifiers work in Flash, here’s a short list of some of the possible uses: a sheet of paper, a ribbon, a waving flag, water, cloth, a tree or other plant, a butterfly, a birds wing… They could also be helpful in animating a human face, and in many other situations where animations exported from 3d editors might fall short.

Does it sound cooler now? It sounded to me when I had the idea a few days ago. As you can imagine I was not able to develop anything close to a full featured library in this short time. Nevertheless, I publish what I was able to come up so far, so that you can all see where I am heading. For the moment, here’s what’s in there:

- a framework for creating static and animated modifier stacks
- 3 basic modifiers: Noise, Bend and Perlin
- plug-ins for the most popular engines: Papervision3d, Away3d, Sandy3d and Alternativa3d
- a simple demo for each engine
- basic documentation not yet :)

Source files. The project is at Google Code. You can do a checkout from SVN or download a ZIP.

Demo. In the repository you can find 4 demo SWFs, one for each engine. It features a basic stack of 4 modifiers - Noise, Perlin and Bend x2. You can also compile the project yourself. Just follow the instructions I added in the document class code.

Notes.
1. There is no plug-in for FIVe3D - that is because this engine works in a quite different way and doesn’t use vertices which are fundamental to modifiers.
2. The Alternativa3d version works in a bit weird way. I think, it is because there’s something I don’t understand about this engine, but I will be figuring this out.

36 Responses to “AS3Dmod, a modifier library for all Flash 3d engines”

  1. Og2t Says:

    That’s awesome Bartek, do you think it would work with NullDesign’s ND3D one as well?

  2. Ralph Hauwert Says:

    Great work Bartek! Let me know if there’s anything we (Papervision3D) can do to help you integrate better.
    We’ve been talking about a plugin enabling system amongst the core team a bit already, your system might be an ideal way to start testing it.

  3. Proti Says:

    Very nice (and quick - you know what I mean :) )

  4. Thomas P Says:

    Excellent work Bartek :)

    Thanks for pushing your effort to a cross-library project! Community would appreciate.

    As Ralph, is Sandy team can help you in any way, let us know.

    Cheers,
    Thomas

  5. alex Says:

    great job.
    do you plan to implement physics aswell?

  6. Flash 3D - the next level / CODEISPOETRY Says:

    […] from Everyday Flash started writing a crossplatform package with great modifiers. You should checkt it […]

  7. dehash Says:

    Very nice work and the four examples work fine too.
    Looking forward to experimenting with it.

  8. AS3Dmod: Cross Engine Modifier Library « Papervision3D - Developers Says:

    […] More info here. […]

  9. katopz Says:

    impressive! love it!

  10. hebchop Says:

    wow. this is genius. Don’t kill yourself trying to keep up with every 3d flash lib out there:)

  11. farmazone Says:

    Hi.

    nice nice! waiting for documentation :)

  12. Paweł Schedler Says:

    impressive !!!

  13. Grzegorz Says:

    Awesome work Bartek! Crossed-engine 3D modifier is a very helpful project which makes pv3d and other engines easy to work with! :) Outstanding! Breathtaking..!

  14. AS3DMod - modifier for 3D Flash | dehash Says:

    […] Made a quick start on a sandbox for it to get ideas on how best to use it. A first usage of AS3Mod is a sandbox example to play with that can be found here. Tags » Trackback: […]

  15. Willem Van den Broeck Says:

    superb

  16. タロタローグ ブログ Says:

    AS3Dmodではためく布や北斗神拳を受けた人の頭を実現。…

    AS3Dmodって言うライブラリが面白い。AS3用のクロスシミュレーション?とか言う種類のライブラリ、つまり布の動きを出してくれる。元からあったデモは布を意識したのかPlaneだったが、ち…

  17. Sandro Says:

    Need this: import alternativa.types.Matrix3D; to compile the Demo. Can somebody help??

  18. bartek drozdz Says:

    @Sandro if you checkout the latest version from SVN this has been removed - it was an unnecessary import that slipped into the code. If you do not use SVN, I will try to updated the ZIP with the sources later today.

  19. Mark Barcinski Says:

    Great Stuff!

    Thanx for sharing.

  20. tg_jp Says:

    great work!! thank you for sharing. here is my demo with Away3D.

    http://www.tres-graficos.jp/away3d/elephant102_a3d/

  21. Eric B Says:

    This is great Bartek. The demo works fine in pv3d, but the away3d demo renders the primitive but doesn’t seem to animate or apply any of the modifiers. I then updated to the latest away3d release (701) and get the error: “1004: Namespace was not found or is not a compile-time constant.”

    They discussed the solution to this issue at http://groups.google.com/group/away3d-dev/browse_thread/thread/6629c4c20c130a87/548cf9f6cb0d05de. I guess it’s an issue with the Flash CS3 app, but not Flex.

    …of course this error may be completely unrelated to AS3Dmod and my own fault :)

  22. Colton Says:

    This is great!
    One thing though - caurina engine and Phases dont seem to mesh very well… do you have any thoughts or suggestions on the best way to implement the two?

  23. Dan Says:

    Very impressive!

    How would you bend a corner of a plane? I’m trying to make it appear as though a piece of paper is being bent from one of the corners. It seems that you can’t rotate the bend axis. I tried combining multiple bends on the X and Y axes, but the sides are being bent completely along the length of the sides…. Any ideas?

  24. bartek drozdz Says:

    @Dan yes, I am working on it :)

  25. Inductible Says:

    Really excellent package, thanks kindly for sharing :D

  26. Espy Says:

    Hello there! Thanks for as3dmod, I’m having lots of fun with it. One question though: How did you get the texture to stay so smooth during the bending? I use a bitmapMaterial with smooth:true, but the texture is still distorted in a weird way along the edge of each vertex. This is what that looks like:

    http://www.24fps.de/temp/as3dmod_problem.jpg

    Your dollar note isn’t doing that. Are you just using huge amounts of vertices or is there some other trick at work here?

    Thanks a lot in advance!
    Espy

  27. bartek drozdz Says:

    @Espy hm, I didn’t do any special tricks, and I did use a rather reasonable amount of vertices. What 3d engine did you use?

  28. Espy Says:

    Papervision 2, but I used a flattened cube so I could have different material on each side of the plane, when using an actual plane the material looks really good. I suppose that’s the problem, bending a flat cube is just not the same as bending a real plane.

    Papervision 2 doesn’t seem to support 2 different materials on a plane, how did you solve that?

    Or I could just try bending two planes separately simultaneously :D

  29. bartek drozdz Says:

    I have two planes superposed, with one sided material on each. One plane is turned 180 degrees.

  30. Espy Says:

    Works wonderfully, thanks a lot!

  31. David Pasieka Says:

    Hello Bartek.
    Excellent work on this. It saves a lot of headaches, that’s for sure. One thing though, the “Bloat” class doesn’t have a constructor. Is this intentional? And if it is, how do you apply a bloat to an object?

  32. bartek drozdz Says:

    @David Pasieka you have to add the modifier to the stack - Bloat or any other. If you use Pv3D it would go something like this:

    var b:DisplayObject3d = some 3d object
    var m:ModifierStack = new Modifierstack(new LibraryPv3d(), b);
    m.addModifier(new Bloat);
    m.apply();

  33. 360panorama Says:

    that rocks :)
    looking forward for more!

  34. vingtcentimes Says:

    Hello, just a quick noob question : i can’t seem to be able to apply the ModifierStack to a DisplayObject3D that has several children ( in this case, a character with independent head, waist, legs and arms, all included inside a CharacterObject). The library accepts the primitives but throws an error( at com.as3dmod.plugins.pv3d::Pv3dMesh/setMesh()) if i try to apply it to the whole character… has anybody had a similar issue ?
    thanks

  35. vingtcentimes Says:

    ok i saw another post with the same issues, so multiple stacks it is, for now…
    thnax for a great pv3d addon !

  36. Pv3d News #1 - Nohama napevno v oblacich | Feet firmly on the cloud Says:

    […] potřebujete něco ohýbat modifikovat, či měnit je tu pro vás AS3Mod. Začalo to u classy Bend na ohýbání objektů a momentálně podporuje všechny 3D engins na […]

Leave a Reply