Help with Path Animation

Software: Away3D 4.x

Wucka, Newbie
Posted: 18 July 2012 08:08 PM   Total Posts: 23

I am looking for a bit of advice.

I am trying to come up with a concept to do a very precise path animation with the camera as the object. Basically creating a flythrough of sorts. I am curious what the best approach is to this. I am working with prefab3d, so I am used to its tooling, but the path animation is not in this version as of yet, so I am looking for another way to do this.

Can I work with curves built in blender for instance, or would creating tweens to numerous points to create a path be the best way.

Any help would be much appreciated.

Thanks,

Wucka

   

Richard Olsson, Administrator
Posted: 19 July 2012 07:42 AM   Total Posts: 1192   [ # 1 ]

There is a class in Away3D called PathAnimator. It may not have been implemented in Prefab 2 yet, but you can still use it in code, so that’s what I would recommend you to take a look at.

It will likely be refactored somewhat for 4.1, but still, it’s worth a shot!

   

Avatar
Fabrice Closier, Administrator
Posted: 19 July 2012 10:02 AM   Total Posts: 1265   [ # 2 ]

Note that to construct a QuadraticPath, if you generate from Prefab v1, you are just a simple copy paste away…

Path classes were updated for 4.0. Now that it’s done, I can start work on reimplementing paths features into Prefab v2.

   

Richard Olsson, Administrator
Posted: 19 July 2012 10:05 AM   Total Posts: 1192   [ # 3 ]

By the way, to answer your question about Blender. There is no format that I know of that lets you transfer paths from Blender to Away3D. However, you can of course create your own exporter using Python quite easily. I’ve done this for several projects where I’ve used Blender as an editor, and at least two or three of those included paths. You can export them in any format you like, as long as you can parse it yourself in AS3 and re-create the Away3D data structures for paths from them.

Blender uses cubic bezier paths, so you need to use the CubicPath class in Away3D to reconstruct them.

Doing this yourself in Blender might seem tedious, but see it as a great learning experience! If you use blender normally, learning to script it with Python is an invaluable thing to do!

   

Wucka, Newbie
Posted: 19 July 2012 01:39 PM   Total Posts: 23   [ # 4 ]

Thank you both for the quick response.

Fabrice, I have been very happy with the feedback you have given me about prefab2 and appreciate the work you are doing on it. Hearing that you will be re-implementing the path utilities is good news. I will test one the version 1 path things like you mentioned because that seems to be the quickest and simplest answer for the problem that I have.

The blender stuff is good to know, I will just have to learn a bit about python in order to get something going.

I will also look through the away path classes that are there in 4.1 and see what I can come up with there also.

Thanks again for the helpful info,


Wucka

   

Avatar
Baush, Sr. Member
Posted: 13 August 2012 12:07 PM   Total Posts: 135   [ # 5 ]

Is there a way to automatically generate a pathSegment’s control point coordinate? I only have a set of (x1,y1) (x2,y2) points to work with.

Thanks!

   

Avatar
Fabrice Closier, Administrator
Posted: 13 August 2012 04:15 PM   Total Posts: 1265   [ # 6 ]

define the PathSegments vectors during a loop. Using (x1+x2) / 2 give you position in between, do same for y and add a z = 0. It will generate straight segments, but if you then do Path smoothPath(), it will then be nicely curvy…

   

Avatar
Baush, Sr. Member
Posted: 13 August 2012 04:16 PM   Total Posts: 135   [ # 7 ]

Makes perfect sense! Thanks!

   

dustymax, Newbie
Posted: 30 December 2012 06:19 PM   Total Posts: 2   [ # 8 ]

Hi,

I’ve been trying for a while now, but I can’t figure out how to simply move a cube along a sequence of vertices with Away3D 4.0. I’ve found some examples that use 3.x, but API has changed a lot since then. Path class has been removed, but there’s SegmentPathBase that seems to fit, but is an abstract class. Also there’s CubicPath and QuadraticPath but they are barely documented and I couldn’t find any example or even a mention of them on the web. Those classes require a Vector.<Vector3D> but feeding them a vector of my path’s vertices throws an error “Path Vector.<Vector3D> must contain series of 4 Vector3D’s per segment”.

So my question is how to move a cube along a path if I have coordinates of vertices of the path?

   

dustymax, Newbie
Posted: 31 December 2012 10:08 AM   Total Posts: 2   [ # 9 ]

Looks like Path class has been renamed to QuadraticPath and you need to path a control point to every segment. This tutorial helped a lot with figuring out how to work with paths.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X