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.

September 3rd, 2008 at 10:29 am
That’s awesome Bartek, do you think it would work with NullDesign’s ND3D one as well?
September 3rd, 2008 at 10:57 am
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.
September 3rd, 2008 at 10:59 am
Very nice (and quick - you know what I mean :) )
September 3rd, 2008 at 11:11 am
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
September 3rd, 2008 at 12:24 pm
great job.
do you plan to implement physics aswell?
September 3rd, 2008 at 12:32 pm
[…] from Everyday Flash started writing a crossplatform package with great modifiers. You should checkt it […]
September 3rd, 2008 at 12:43 pm
Very nice work and the four examples work fine too.
Looking forward to experimenting with it.
September 3rd, 2008 at 12:58 pm
[…] More info here. […]
September 3rd, 2008 at 3:00 pm
impressive! love it!
September 3rd, 2008 at 3:21 pm
wow. this is genius. Don’t kill yourself trying to keep up with every 3d flash lib out there:)
September 3rd, 2008 at 3:45 pm
Hi.
nice nice! waiting for documentation :)
September 4th, 2008 at 8:48 am
impressive !!!
September 4th, 2008 at 8:48 am
Awesome work Bartek! Crossed-engine 3D modifier is a very helpful project which makes pv3d and other engines easy to work with! :) Outstanding! Breathtaking..!
September 4th, 2008 at 5:17 pm
[…] 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: […]
September 5th, 2008 at 4:51 pm
superb
September 6th, 2008 at 6:22 pm
AS3Dmodではためく布や北斗神拳を受けた人の頭を実現。…
AS3Dmodって言うライブラリが面白い。AS3用のクロスシミュレーション?とか言う種類のライブラリ、つまり布の動きを出してくれる。元からあったデモは布を意識したのかPlaneだったが、ち…
September 8th, 2008 at 12:54 pm
Need this: import alternativa.types.Matrix3D; to compile the Demo. Can somebody help??
September 8th, 2008 at 1:10 pm
@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.
September 8th, 2008 at 7:39 pm
Great Stuff!
Thanx for sharing.
September 15th, 2008 at 11:59 am
great work!! thank you for sharing. here is my demo with Away3D.
http://www.tres-graficos.jp/away3d/elephant102_a3d/
September 22nd, 2008 at 9:51 pm
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 :)
September 30th, 2008 at 12:49 am
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?
October 5th, 2008 at 8:52 am
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?
October 7th, 2008 at 9:57 am
@Dan yes, I am working on it :)
October 7th, 2008 at 2:29 pm
Really excellent package, thanks kindly for sharing :D
October 9th, 2008 at 4:20 pm
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
October 10th, 2008 at 9:44 pm
@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?
October 10th, 2008 at 10:20 pm
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
October 10th, 2008 at 10:46 pm
I have two planes superposed, with one sided material on each. One plane is turned 180 degrees.
October 11th, 2008 at 10:48 am
Works wonderfully, thanks a lot!
October 16th, 2008 at 5:21 am
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?
October 17th, 2008 at 4:06 pm
@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();
October 18th, 2008 at 5:13 am
that rocks :)
looking forward for more!
November 19th, 2008 at 4:52 pm
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
November 19th, 2008 at 6:41 pm
ok i saw another post with the same issues, so multiple stacks it is, for now…
thnax for a great pv3d addon !
November 21st, 2008 at 11:50 am
[…] 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 […]
December 10th, 2008 at 5:41 am
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/
December 11th, 2008 at 2:05 pm
[…] the documentation, wiki, download etc here. As far as I can see the creator is Bartek Drozdz from everydayflash - very clever actionscript […]