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.


That’s awesome Bartek, do you think it would work with NullDesign’s ND3D one as well?
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.
Very nice (and quick - you know what I mean :) )
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
great job.
do you plan to implement physics aswell?
[...] from Everyday Flash started writing a crossplatform package with great modifiers. You should checkt it [...]
Very nice work and the four examples work fine too.
Looking forward to experimenting with it.
[...] More info here. [...]
impressive! love it!
wow. this is genius. Don’t kill yourself trying to keep up with every 3d flash lib out there:)
Hi.
nice nice! waiting for documentation :)
impressive !!!
Awesome work Bartek! Crossed-engine 3D modifier is a very helpful project which makes pv3d and other engines easy to work with! :) Outstanding! Breathtaking..!
[...] 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: [...]
superb
AS3Dmodではためく布や北斗神拳を受けた人の頭を実現。…
AS3Dmodって言うライブラリが面白い。AS3用のクロスシミュレーション?とか言う種類のライブラリ、つまり布の動きを出してくれる。元からあったデモは布を意識したのかPlaneだったが、ち…
Need this: import alternativa.types.Matrix3D; to compile the Demo. Can somebody help??
@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.
Great Stuff!
Thanx for sharing.
great work!! thank you for sharing. here is my demo with Away3D.
http://www.tres-graficos.jp/away3d/elephant102_a3d/
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 :)
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?
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?
@Dan yes, I am working on it :)
Really excellent package, thanks kindly for sharing :D
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
@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?
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
I have two planes superposed, with one sided material on each. One plane is turned 180 degrees.
Works wonderfully, thanks a lot!
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?
@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();
that rocks :)
looking forward for more!
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
ok i saw another post with the same issues, so multiple stacks it is, for now…
thnax for a great pv3d addon !
[...] 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 [...]
Finally I a chance to play around with the library. Check the results here:
http://blog.reyco1.com/applying-modifiers-to-3d-objects-in-papervision3d-using-as3mod/
[...] the documentation, wiki, download etc here. As far as I can see the creator is Bartek Drozdz from everydayflash - very clever actionscript [...]
[...] Papervision3D instead of my usual engine choice of Away3D. It also uses a relativly new library, AS3DMod, and works with the 4 most popular engines. Now this library is a modifier library which can do [...]
[...] AS3Dmod [...]
[...] AS3Dmod, a cross-engine 3d modifier library for Flash, was developed by Bartek Drozdz as a way to interact with several 3D Flash engines. [...]
dear god!! you’re brilliant
love u man ;)
[...] To bend objects in Papervision3D we need a 3rd party library called AS3Dmod. [...]