using the path animator

8 views
Skip to first unread message

desgraci

unread,
Jul 13, 2009, 6:04:03 PM7/13/09
to away3d.dev
i was wondering if i use the path animator on a plane (it has a car
painted by each side) that travels in x, y and z axis, how to keep it
with rotationX=90 always? i tried to use the path align false but i
stills it "falls" pararell to the ground, how to fix this?

Fabrice3D

unread,
Jul 14, 2009, 4:04:32 AM7/14/09
to away3...@googlegroups.com
there is a rotations property array for custom rotations per
CurveSegment
if you have seen RailAway demo, that's how the wagon stays following
the rail tracks in corners
The definition is a Number3D per segment, x,y,z value being the
rotation values.

if rotation 90 needs to be constant, I would first set car.rotationX =
90; then car.applyRotations()/;
then pass to the PathAnimator.

Internally the system assumes the objectSpace orientation was a choice
made by the dev
therefor no additional rotations other than y or z are affected if you
have set align to path to true
or if you have a lookat and a target.

note that if you need to change runtime like any other meshes, just
nest your mesh into a container
and pass the container to the animator, the mesh is then to be
affected in anyways you want.
That would be here for instance the car on a track that is allowed to
move/turn sidewards along the road freely
yet following the path.

Fabrice

desgraci

unread,
Jul 14, 2009, 11:30:38 AM7/14/09
to away3d.dev
excellent! it works perfect now, but in the bad side more answers
takes to more questions so i will experiment more with this class,
thanks for the suport.

desgraci

unread,
Jul 14, 2009, 11:53:59 AM7/14/09
to away3d.dev
and here goes the firs q,
http://www.ierafaelperez.co.cc/rotation 270 align false applyrot.swf

every time u refresh it gives a random route, the question is that it
worked before witha fixed rout, but with this one, well it sometimes
is moved 90 degrees on rotationY, but if i fix the val,ue is never
going to be rotated.

how could i solve this

btw i have copyrights on that car design :p

Peter Kapelyan

unread,
Jul 14, 2009, 12:10:56 PM7/14/09
to away3...@googlegroups.com
its goes to http://error.000webhost.com/

:/
--
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

ben

unread,
Jul 14, 2009, 12:13:42 PM7/14/09
to away3d.dev
you have to paste the whole line:
http://www.ierafaelperez.co.cc/rotation 270 align false applyrot.swf

the behaviour seems strange in more than one way, could you draw
segment so taht we can see the path, and not "feel"it,
that may help to help you (at least for me...)
thanks ;-)

Peter Kapelyan

unread,
Jul 14, 2009, 12:13:54 PM7/14/09
to away3...@googlegroups.com
Oh whoops, you need to paste the whole URL including spaces...sorry!

desgraci

unread,
Jul 14, 2009, 12:14:22 PM7/14/09
to away3d.dev
hi Mr. Peter long time dint see ya!

"http://www.ierafaelperez.co.cc/rotation 270 align false applyrot.swf
"

the whole line :p

it got some spaces in the name, or enter
http://www.ierafaelperez.co.cc/
its an open parent.

On 14 jul, 11:10, Peter Kapelyan <flashn...@gmail.com> wrote:
> its goes tohttp://error.000webhost.com/
>
> :/
>
> On Tue, Jul 14, 2009 at 11:53 AM, desgraci <ierafaelper...@yahoo.com> wrote:
>
> > and here goes the firs q,
> >http://www.ierafaelperez.co.cc/rotation270 align false applyrot.swf

desgraci

unread,
Jul 14, 2009, 12:16:35 PM7/14/09
to away3d.dev
ok im adding some lines to the scene

On 14 jul, 11:13, ben <benja...@agence-anonyme.com> wrote:
> you have to paste the whole line:http://www.ierafaelperez.co.cc/rotation270 align false applyrot.swf

desgraci

unread,
Jul 14, 2009, 12:47:01 PM7/14/09
to away3d.dev
the order is
red
blue
green
white

it got some time cause i rewrote the function and the clipping got to
be rectangular so the lines donest divide itself
and beside i noticed sometghing that i thought at first it was an as3
mistake

"http://www.ierafaelperez.co.cc/lines lines.swf"

i use this

car1M = new BitmapMaterial(Cast.bitmap(Charmapp1));
car1= new Plane({material:car1M,rotationX:270});
car1.width=640;
car1.height=480;
car1.applyRotations();
car1.bothsides=true;
car1.back=car1M;
scene.addChild(car1);
car1.ownCanvas=true;
car1.pushfront=true;

//animacion
rx2=(Math.round(Math.random() * (10000)) -5000);
ry2=(Math.round(Math.random() * (10000)) -5000);
rz2=(Math.round(Math.random() * (10000)) -5000);

var rx3:Number =new Number(Math.round(Math.random() *
(10000)) -5000);
var ry3:Number =new Number(Math.round(Math.random() *
(10000)) -5000);
var rz3:Number =new Number(Math.round(Math.random() *
(10000)) -5000);

var rx4:Number =new Number(Math.round(Math.random() *
(10000)) -5000);
var ry4:Number =new Number(Math.round(Math.random() *
(10000)) -5000);
var rz4:Number =new Number(Math.round(Math.random() *
(10000)) -5000);
linea1= new LineSegment({material:"#red"});
linea1.start=new Vertex(rx,ry,rz);
linea1.end=new Vertex(rx3,ry3,rz3);
scene.addChild(linea1);
linea2= new LineSegment({material:"#blue"});
linea2.start=new Vertex(rx3,ry3,rz3);
linea2.end=new Vertex(rx2,ry2,rz2);
scene.addChild(linea2);
linea3= new LineSegment({material:"#green"});
linea3.start=new Vertex(rx2,ry2,rz2);
linea3.end=new Vertex(rx4,ry4,rz4);
scene.addChild(linea3);
linea4= new LineSegment({material:"#white"});
linea4.start=new Vertex(rx4,ry4,rz4);
linea4.end=new Vertex(rx,ry,rz);
scene.addChild(linea4);
aPath0= [
new Number3D(rx,ry,rz),
new Number3D(rx3,ry3,rz3),
new Number3D(rx2,ry2,rz2),
new Number3D(rx2,ry2,rz2),
new Number3D(rx4,ry4,rz4),
new Number3D(rx,ry,rz),
];
path=new Path(aPath0);
pathanimator0 = new PathAnimator(path,car1,inito2);

the fact is that i have a cube of 10kx10kx10k,x=y=z=0, the random
shouldnt send me outside but it does, why? i traced the edges of the
cube (-5000,-5000)(5000,-5000), etc

desgraci

unread,
Jul 14, 2009, 12:47:57 PM7/14/09
to away3d.dev
btw i also added the "camera walking"

desgraci

unread,
Jul 15, 2009, 10:42:23 AM7/15/09
to away3d.dev
a last thing if u see a black screen in lines lines, move, with arrows
or wasd, and maybe im doing the question in a wrong way, what im
trying to do is to make that my paper is always pointing to the right
side and the car is always perpendicular to the floor, not inclining,
maybe fixing z, but the problem is rotation in Y, cause sometimes its
moves funny, and sometimes looks is going in reverse, the cars looks
upside-down, and havent figured a way to fix this (if i would i wont
be drawing ASCII >:''C )



-------------------------------------------------------------------
|
_____________________ |

| / \ |

| / \ |
|
----- / \-------¬ | The
movement is to this place
| |
____ ____ / |
|--------------------------------------------->
| | /
\ / \ | | |
| |---------/ O
\----------------------/ O \------\-| |

| |

| |

-------------------------------------------------------------------
believa a man that is drawing in ASCII, he's that desesperated...

desgraci

unread,
Jul 15, 2009, 1:13:17 PM7/15/09
to away3d.dev
ok the ascii dint help, well, heres a picture :D
as always i have the copyrights of this awesome vehicle

http://www.ierafaelperez.co.cc/1234.JPG

desgraci

unread,
Jul 15, 2009, 6:21:09 PM7/15/09
to away3d.dev
plis any idea!!!!!

desgraci

unread,
Jul 17, 2009, 1:39:42 PM7/17/09
to away3d.dev
Fabrice,

what i made at the end was to increase the points of the paths to
aproximate to a curve of bezier, it works so so by now, but im not
sure fi that was the right way to do it.

Any light?

btw:

http://groups.google.com/group/away3d-dev/browse_thread/thread/4a4654c7dbe340d4

not sure what is it, looks ike a bug.

Fabrice3D

unread,
Jul 17, 2009, 5:51:41 PM7/17/09
to away3...@googlegroups.com
the internal code looks at a fraction of time along the curve.
the time you pass should always be greater or equal to the actual
position.

like pa.time = pa.time+0.0001;

this means that if the position of the object is not altered (if in a
container and the container being the object3d)
if you allways do update with equal or increased time, the code will
never orientate otherway than ahead.
if the pivot of the object3d is altered or its objectspcae geometry,
you my get, at least in your perception, unespected rotations.
if you pass a lower one, you will reverse the fx.

Try trace your increases or pa.time values to see if they are logic
when the rotation takes place.

I'm off for 2 weeks at least, I hope this will help you a bit.

Fabrice

desgraci

unread,
Jul 18, 2009, 10:10:48 AM7/18/09
to away3d.dev
dint have problem with pivots or that, or containers, was a simple
plane, and im using a very small increment on my time variable
(0.001). the last test i was running was involving the updates, due to
the fact that if i increased the point too much it wont rotate
"naturally" but in a "too brute" way in corners even if it followed
the curves the way i wanted. Hope i fix it

btw i found that the second problem is because u cant use an object
container, add it to the PA, and then lookt at the position, it goes
crazy, i made it work using only meshes and now is perfect, just like
me (jejeje, right... :D)

tx again Fabrice, i have something that confirmed that i wasnt that
lost at least XD
Reply all
Reply to author
Forward
0 new messages