More on Paths -> properly apply offset

Software: Away3D 4.x

bardo, Member
Posted: 29 October 2013 02:45 PM   Total Posts: 79

Hi all, how can i properly add offset to element duplicated with pathDuplicator, in a way that these object are near the side of the track ? i found that PathDuplicator.alignToPath = true add all elements in the same position!

  var cc:PlaneGeometry = new PlaneGeometry(512*4 , 512*4 );
  var _sVec2:Vector.<Mesh> = new Vector.<Mesh>();
  for (var j:int = 0; j < 1000; j++) {   
  var color:uint = (j % 2 == 0) ? 0xFFFFFF : 0x0000FF;
  trace(color)
  var mm:Mesh = new Mesh(cc, new ColorMaterial(color));
    //mm.positi Vector3D(-900 , 512, 0);    //mm.rotati   //mm.rotati
  //MeshHelper.applyRotations(mm);
  //MeshHelper.applyPosition(mm, -100,0,0);
  mm.material.bothSides = true; 
  _sVec2.push(mm); 
  }
 
  _pathDuplicator = new PathDuplicator(_path, _sVec2, _view.scene,10, true, false, null,false);


Even if i dont apply any trasformation to the mesh(and align to path=false), during duplication these mesh are slightly rotated ... it seems also that MeshHelper isn’t helping so much ( obviously i’m doing something wrong) .... How can i do?

   

bardo, Member
Posted: 29 October 2013 02:46 PM   Total Posts: 79   [ # 1 ]

some code was stripped ... but the problem remains wink

   

bardo, Member
Posted: 30 October 2013 09:36 AM   Total Posts: 79   [ # 2 ]

No one faced this problem before, or have a solution?

Anyway, i found that _pathDuplicator.meshes[n].scenePosition is always (0,0,0) ! How is it possible ?

   

Avatar
Fabrice Closier, Administrator
Posted: 30 October 2013 09:52 AM   Total Posts: 1265   [ # 3 ]

meshes is legacy from f10. Because of performance costs, it was handy to have an holder to toggle meshes depending on performance or path position.
Its position is not relevant as the meshes are relative to path into it.
for instance you could have road+trees+sand and say that when camera is not in given range that sand.meshes are removed/invisible.

   

bardo, Member
Posted: 30 October 2013 10:29 AM   Total Posts: 79   [ # 4 ]

Thanks Fabrice, in the meanwhile i have understand that i have to work on PathDuplicator.clones to get the ‘real’ meshes : now it will be (i hope) all easy wink .

Many thanks again!

   

bardo, Member
Posted: 30 October 2013 11:44 AM   Total Posts: 79   [ # 5 ]

Srry Fabrice, the last question : how to make ‘alignToPath’ param work ? if i set it to true, all duplicated meshes are added at (0,0,0) ! Is there something i need to add before duplicate meshes ?

   

Avatar
Fabrice Closier, Administrator
Posted: 30 October 2013 12:29 PM   Total Posts: 1265   [ # 6 ]

Sounds like a bug… align to path should orientate the meshes. I’m having zero free time atm, but will try look at this asap.

   

bardo, Member
Posted: 30 October 2013 12:48 PM   Total Posts: 79   [ # 7 ]

Thanks Fabrice, i’ll wait for you to check it! I will compose the scene b hands ( i have a really close deadline, next monday) . However, is there a way , in prefab2 , to free move the camera (like the hand cursor in photoshop) ?
I have a really big track model, is quite impossible to me atm to add primitives where i want !

   

bardo, Member
Posted: 30 October 2013 01:03 PM   Total Posts: 79   [ # 8 ]

Another bug (?) : in pathanimator, setting the offset X of a path aligned object will result in changing its X in world coord!

   

Avatar
Fabrice Closier, Administrator
Posted: 30 October 2013 01:12 PM   Total Posts: 1265   [ # 9 ]

set the camera to free (dropdown on top)

My version (the next update) has already keys, awsd, and free mode while in 3d mode as well. Indeed something that is missing for large sceneries in current public version. Unfortunatly, because of the many changes, addons and a busy life, I cannot release it yet.

   

bardo, Member
Posted: 30 October 2013 03:04 PM   Total Posts: 79   [ # 10 ]

Many thanks again! If you need an alpha tester, i’ll be glad to do it!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X