Away3d 4 PathAnimator: How to Animate A Group of Object3D Along A Path?

Software: Away3D 4.x

Concept Z, Sr. Member
Posted: 16 June 2011 01:04 PM   Total Posts: 124

Hi, Away3D team !


How to animate a group of Object3D along a path ?


I don’t want to use ObjectContainer3D to wrap a group of Object3D, then animate the ObjectContainer3D along a path . it’s not the effect i want.

i mean, every object animate along the path separately .


currently , i initialize a group of PathAnimators, then updatePosition for each PathAnimator Instance…


I’m afraid , it’s not a right and effective way .


Could you please give me some advice or sample ? 

 

 Signature 
signature_image

Anyone can cook but only the fearless can be great

   

Avatar
Fabrice Closier, Administrator
Posted: 16 June 2011 02:41 PM   Total Posts: 1265   [ # 1 ]

Animating multiple objects along a path is not there as out of box functionality. But is very easy to be achieved.

You simply need to make a PathAnimator once. instead of using it as the drive of a unique entity, simply ask it to return you the positions.

For instance, public function getPositionOnPath( t:Number, out:Vector3D):Vector3D

so say you have 2 spheres, one would say “myprogress += myincrease”, sphere1.position = getPositionOnPath(myprogress); while this other would have its own increase as well.

Note the second parameter. to prevent a return of a new instance Vector3D, simply declare a class _holderPosition:Vector3D = new Vector3D

then reuse for every call & every object,  getPositionOnPath(myprogress, _holderPosition);

If you think in terms of duration, use then public function getPositionOnPathMS( ms:Number, duration:Number, out:Vector3D):Vector3D

if you use a complex path, composed of many segments, you might want to check on which segment you are, use then a methods such as getTimeSegment. Ideal to trigger sound or location specific events.

All these methods are accessible with no need of having multiple PathAnimator instances.

   

Concept Z, Sr. Member
Posted: 16 June 2011 04:19 PM   Total Posts: 124   [ # 2 ]

Fabrice, thank you very much for your soon reply !

It really helps me a lot !

 Signature 
signature_image

Anyone can cook but only the fearless can be great

   

Concept Z, Sr. Member
Posted: 17 June 2011 07:34 AM   Total Posts: 124   [ # 3 ]

Hi,Fabrice, How to get the Object3D’s rotation informaiton (rotationX,rotationY,rotationZ) from the PathAnimator when pathAnimator.updateProgress(progressincreasement) ?


I mean , I want to update a group of Object3D’s position and the rotation both in the ENTER_FRME Loop.

PathAnimator is really a robust engine ! even if initialize 50 PathAnimators, it really runs very smoothly !

 Signature 
signature_image

Anyone can cook but only the fearless can be great

   

Avatar
Fabrice Closier, Administrator
Posted: 17 June 2011 09:55 AM   Total Posts: 1265   [ # 4 ]

I’m not sure to understand your question regarding rotations, can you develop a bit? you mean alignment to path?

PathAnimator is really a robust engine !
I have rewrited a bit bunch of it for 4.0, glad to hear this!

   

Concept Z, Sr. Member
Posted: 18 June 2011 01:16 AM   Total Posts: 124   [ # 5 ]

You had rewrited a bit bunch of it? happy to hear that!


Thanks again for you great works, But, Fabrice, I still have some other adivce for PathAnimator when you rewrite for that:


(1): GroupPathAnimator, GroupPathAnimator(trackPath,[Obj3D1,Obj3D2….],...) some features like that ?


(2): PathAnimator & Tween Engine, How to tween one Object3D or a group of Object3D in the PathAnimator using a Tween Engine?


(3):How to input Cubic Bézier curves information for Path constructor to describe the path, how to accept Maya or 3dsMax’s path information for Away3d use ? also , the Flash Player 11 can draw Cubic Curve ,if you can support Cubic Bézier curves , that will be magic !

 

 Signature 
signature_image

Anyone can cook but only the fearless can be great

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X