20 Dec 2007

Away3D Global Animation the easy way

by Fabrice Closier Away3D Global Animation the easy way

In order to animate in Flash3D you need to use pretty advanced 3D tools to generate and export animation data. For many it's just a bridge too far.
And even for the professionals, it often cost too much development time. And because of this, many choose not to animate at all. I think that's a shame.

During the last weeks I've worked on many new features for Away's native animation system, and together with other team mates have spend lots of time looking at ways to ensure easyness of use for the pro user as for the starter.

I've tried here to build in a few of those handy features in this demo:

- Path animation system. Both the camera are on a path in this case.
- The animated hummingbird is animated automatically by Away's animation system, (as you will see bellow with the cube example, it's very easy to accomplish the same thing natively now).
- Target following: The camera follows the bird according to its position.
- AlignToPath: Both camera is automatically oriented as it moves on the path.
- And of course the tiling feature in action.

Note that this demo is not using Away's 1.9 but my good old workhorse dev version of the engine, so expect about 30-35% more speed with the 1.9.x and higher! Why? Simply because we haven't ported the tiling in the latest version yet!

And of course i want to thank Peter Kapelyan for the HB model, Meowza for the bird texture and not to forget the beautifull music done by Atom(bang)

Here a little demo that shows how the bird is being animated. In this case i use cubes, just to show you how easy this is. Just click the cube to see it.

private function makeBoxeAnimation():void
var mat:IMaterial = new BitmapMaterial(myBitmadata, {});

var cube = new Cube({, , depth:350});
var cube2 = new Cube({, , depth:250});
var cube3 = new Cube({, , depth:50});
var cube4 = new Cube({, , depth:550});

_anim = new Animator(cube, [{vertices:cube2.vertices, prefix:"cube01"},
{vertices:cube3.vertices, prefix:"cube02"},
{vertices:cube4.vertices, prefix:"cube03"},
{vertices:cube2.vertices, prefix:"cube04"}] ,
{material:mat, y:0, x:0,z:0,bothsides:false});

_anim.play({prefix:"cube", smooth:true, loop:true, fps:.5});

//let the fun begin
stage.addEventListener(Event.ENTER_FRAME, this.refreshScreen);

private function refreshScreen(event:Event):void
_anim.rotationX += .5;
_anim.rotationY += 1.5;
_anim.rotationZ += .5;



21 Dec 2007 03:29 AM

Edin said:


23 Dec 2007 06:41 PM

Jarosia said:

this is fantastic, - can we see how the humming bird's wings is accomplished?

25 Dec 2007 10:59 AM

admin said:

We expect our extended documentation to be online soon...

02 Feb 2008 02:48 PM

EhhDawh is soundtrack for new Away3D tech demo | a said:

[...] and here is the full post regarding this demo from Fabrice, for those interested in the [...]

29 Mar 2008 08:17 PM

Manny said:

Where does the new Animator class come from I'm using Flex and dont see it.

I also have some 3DS Max characters I exported to Collada, but not sure how to access the animation frames like a walk loop, run loop etc. Same for MD2. Would be useful to know how to use the animation for collada mainly. Have a big platform game I am building and this is the only drawback.

30 Mar 2008 03:17 PM

Fabrice Closier said:

Hey many, I saw exact same question from you on my blog... there is an answer there smile

24 May 2008 11:08 AM

K Reg said:

Getting Error when I run the following. I can see my objects but no _anim.play() is triggered. Anyadvice.

private function boxAnim():void
var cube:Cube = new Cube({width:100, height:100, depth:200});
var cube1:Cube = new Cube({width:500, height:100, depth:200});
var cube2:Cube = new Cube({width:100, height:700, depth:200});
var cube3:Cube = new Cube({width:630, height:230, depth:600});

var vert1:Object = {verticies:cube1.vertices, prefix:'cube01'};
var vert2:Object = {verticies:cube2.vertices, prefix:'cube02'};

_anim = new Animator(cube,[vert1, vert2] );


_anim.play({prefix:'cube', smooth:true, loop:true, fps:10})

the onEnterFrame is being called when the app initializes.

private function refreshView(e:Event):void

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.animation::Animator/generate()
at away3d.animation::Animator$iinit()
at TestClass/::boxAnim()
at TestClass/::init_app()
at TestClass$iinit()
at start_fla::MainTimeline/start_fla::frame1()

24 May 2008 04:57 PM

Fabrice Closier said:

That might be because the property 'verticies' is not the expected 'vertices' in the objects... but this is the wrong place to ask/get answers, please register to our usergroup for technical support.

21 Jul 2010 08:04 AM

Talal said:

I have Imported .3ds shark model in Away3d. how can i set animation on shark.
can i import 3ds animation in away3d.. please give me suggession..


26 Oct 2010 07:16 PM

felix said:

Looks like this example code no longer works in Away3D 3.6. Getting an error when trying to add the animator to a scene.

Only registered members can comment. Click here to login or here to register