objectcontainer3d set as global transform value

Software: Away3D 4.x

incubus, Newbie
Posted: 22 January 2014 05:36 PM   Total Posts: 21

Hey, I want to set global transform value. But ObjectContainer3D’s transfrom value just allow to getter value.

here is transfrom value only allow get value doesn’t allow to set that value.

http://away3d.com/livedocs/away3d/4.0/away3d/core/base/Object3D.html#transform

is there anybody know how to setter that value ?

   

John Brookes, Moderator
Posted: 22 January 2014 06:37 PM   Total Posts: 732   [ # 1 ]

?
myMesh.transform = someMatrix3D

 

   

incubus, Newbie
Posted: 22 January 2014 10:54 PM   Total Posts: 21   [ # 2 ]
JohnBrookes - 22 January 2014 06:37 PM

?
myMesh.transform = someMatrix3D

thank you for you quick response. But I want to assign ObjectContainer3D container’s transform. is there any way?

 

   

John Brookes, Moderator
Posted: 22 January 2014 10:57 PM   Total Posts: 732   [ # 3 ]

same way

var obj:ObjectContainer3D = new ObjectContainer3D();

obj.transform = someMatrix3D

edit..

you want to set the transform same as the parent container?

obj.transform = obj.parent.transform

edit 3 (confused as to what you want smile )
maybe

obj.transform = obj.parent.inverseSceneTransform

 

   

incubus, Newbie
Posted: 22 January 2014 11:23 PM   Total Posts: 21   [ # 4 ]
JohnBrookes - 22 January 2014 10:57 PM

same way

var obj:ObjectContainer3D = new ObjectContainer3D();

obj.transform = someMatrix3D

edit..

you want to set the transform same as the parent container?

obj.transform = obj.parent.transform

edit 3 (confused as to what you want smile )
maybe

obj.transform = obj.parent.inverseSceneTransform

Thanks again. I would like to share my code to be more clear. Please look at my model & code and please tell me what’s wrong my code.

Firstly import “rail_duz_ortaparca.dae” model file and open it. You can see plain axes at top of the plane geometry. That’s holds my next rail pice’s coordinates. I get this “ExitObject”(which is holds my next rail pice’s coordinate as I said before) plain axes with if-else conditions(102. line).

So here is my trouble I just want to assign my ExitObject Plain axes transform value to ObjectContainer3D transform value for to make endless road with curve.

 

 

 

File Attachments
railpiece.rar  (File Size: 135KB - Downloads: 0)
   

John Brookes, Moderator
Posted: 22 January 2014 11:27 PM   Total Posts: 732   [ # 5 ]

Sorry looks like issue with forum i cant download that

 

   

incubus, Newbie
Posted: 22 January 2014 11:40 PM   Total Posts: 21   [ # 6 ]
JohnBrookes - 22 January 2014 11:27 PM

Sorry looks like issue with forum i cant download that

Ok i will try it again different way smile can you please try link below ?

https://dl.dropboxusercontent.com/u/54591390/railpiece.rar

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 23 January 2014 12:50 PM   Total Posts: 669   [ # 7 ]

Is this what you are trying to achieve?
http://www.videometry.net/away3d/track/

I took a look through your code. There were a few issues.
Firstly, your “ExitObject” was never getting loaded, it is stripped by the DAEparser, as it contains no geometry.

The model itself was in a different orientation to Away3D, a common problem with Collada files.

I swapped it with a 3DS file with material included.
Instead of trying to copy the piece of track to an empty container, I just wrote a simple function to draw a ring of track, given a radius and the length of a single segment.

Hopefully this is what you were attempting smile
I’ll send you the amended code.

Cheers!

 

   

John Brookes, Moderator
Posted: 23 January 2014 01:04 PM   Total Posts: 732   [ # 8 ]

Thanks mighty smile
looked at the code last night saw dae and went to bed wink

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 23 January 2014 01:16 PM   Total Posts: 669   [ # 9 ]

You’re a wiser man than me John :O)

 

   

incubus, Newbie
Posted: 23 January 2014 01:49 PM   Total Posts: 21   [ # 10 ]
theMightyAtom - 23 January 2014 01:16 PM

You’re a wiser man than me John :O)

Thank you. I was use DAE format because other formats didn’t support “Plain Axes”

 

   

incubus, Newbie
Posted: 23 January 2014 02:13 PM   Total Posts: 21   [ # 11 ]
theMightyAtom - 23 January 2014 12:50 PM

Is this what you are trying to achieve?
http://www.videometry.net/away3d/track/

I took a look through your code. There were a few issues.
Firstly, your “ExitObject” was never getting loaded, it is stripped by the DAEparser, as it contains no geometry.

The model itself was in a different orientation to Away3D, a common problem with Collada files.

I swapped it with a 3DS file with material included.
Instead of trying to copy the piece of track to an empty container, I just wrote a simple function to draw a ring of track, given a radius and the length of a single segment.

Hopefully this is what you were attempting smile
I’ll send you the amended code.

Cheers!

i’ve look at 3DS model but there is no plain axes in it. I just want to apply plain axes coordinate to my objectContainer3d. PlainAxes decide other piece where should be( it up, down or uprightly piece).

Sorry my question I’m really new to away3D and English smile

—Edit:
here is my what I want to do smile

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 23 January 2014 03:27 PM   Total Posts: 669   [ # 12 ]

OK, if you really, really want to do it that way you need to include an object with the orientation you want to copy, not just an empty dummy object.
For example you could add a box, and remove it once you read its position.

Personally I would have to say it is much easier and more flexible to handle the positions in code. You can create any profile you want to, I just made a ring because I thought that was what you were after. With the same code you could make a ring the other way, just rotate on the x axis instead of the y axis, and adjust placement accordingly.

Good Luck!

 

   

incubus, Newbie
Posted: 23 January 2014 10:29 PM   Total Posts: 21   [ # 13 ]
theMightyAtom - 23 January 2014 03:27 PM

OK, if you really, really want to do it that way you need to include an object with the orientation you want to copy, not just an empty dummy object.
For example you could add a box, and remove it once you read its position.

Personally I would have to say it is much easier and more flexible to handle the positions in code. You can create any profile you want to, I just made a ring because I thought that was what you were after. With the same code you could make a ring the other way, just rotate on the x axis instead of the y axis, and adjust placement accordingly.

Good Luck!

i will try add box my model. i don’t need to create any ring because i have lots of road piece different transform in it smile thank you guide me.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X