Some questions about paths

Software: Away3D 4.x

bardo, Member
Posted: 23 October 2013 02:43 PM   Total Posts: 79

Hi all, i’m creating a track with Prefab 1 ( can’t find Path creator/extruder in Prefab 2 ! ) , and i have a couple of question.

1. In prefab, how can i limit the extrusion segment ( in Path Extruder) , to have a width of X ? I’d like to have its width 512px .

2. In Away, how can i get the real width of the path ? I need this cause i have to add sprite3d on the side of the track (trees etc )

3. Using for the first time Prefab2 ( is MARVELLOUS) , i noticed that i can export also a test project, and a whole scenery : do you think is it worth (performance side) to compose all the track, with side elements too, directly in prefab ( i prefer to do it with code only, but is more simple to show the finished track BEFORE approval)?


Many thanks in advance!

   

Avatar
Fabrice Closier, Administrator
Posted: 23 October 2013 08:36 PM   Total Posts: 1265   [ # 1 ]

You cannot yet edit or generate any of the Path related classes within Prefab 2.0 as you were able in v1. Its high on my todo, but not yet in.

What you could do is generate the path in v1 and export as awd1, in order to load it in v2. Where you could inspect it as mesh object. Ideally you do not want to do this for the final piece. For the required data simply export from the path editor the .awp xml, copy paste the path data and use this into your away 4.x code.

The width of the path is defined by the profile that you define. during development you can ask the position of a segment at a given time. (check the PathAnimator methods). Also keep in mind that there is an handy class automating what you want to do, made to add other elements along the path: PathDuplicator. You can also pass variation of the path to this class to distribute your elements along the track such as trees, buildings, security stuffs etc..

Glad you like Prefab. An update should be released in a not so far future…

   

bardo, Member
Posted: 24 October 2013 08:31 AM   Total Posts: 79   [ # 2 ]

Many thanks Fabrice, i’m taking a look at the path duplicator, but i don’t find offset param! and, i’d like to duplicate sprite3d, but it accept a vector of meshes! using a Plane in the place of a sprite3d, is the same Performance side ?

   

bardo, Member
Posted: 24 October 2013 08:58 AM   Total Posts: 79   [ # 3 ]

There must be something wrong. It seems that all Meshes are duplicated in the same point . Path animator with this path works like a charme,  ....  im surely doing something wrong!

var _path:QuadraticPath = new QuadraticPath(Costant.getPathVertexVector()); 
  var _sVec:Vector.<Mesh> = new Vector.<Mesh>(); 
  for (var i:int = 0; i < 100; i++) { 
  var c:CubeGeometry = new CubeGeometry();
  var m:Mesh = new Mesh(c, new ColorMaterial(Math.random() * 0xFFFFFF));
  _sVec.push(m); 
  }
  _pathDuplicator = new PathDuplicator(_path, _sVec, _view.scene, 5,true,false);
  _pathDuplicator.build();
   
  _pathAnimator = new PathAnimator(_path, _camera, new Vector3D(0,200,0));
  _pathAnimator.alignToPath = true; 
  _pathAnimator.updateProgress(_progress);

   

bardo, Member
Posted: 24 October 2013 09:17 AM   Total Posts: 79   [ # 4 ]

the problem is given by the alignToPath = true option ...

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X