up axis

Software: Away3D 4.x

mole, Newbie
Posted: 27 November 2013 03:14 PM   Total Posts: 29

I’m importing DAE files, and it seems that depending on which application exported them, either the Z or the Y axis are the up axis.
Is there a way easily change which axis is the up axis of a loaded model?

   

Avatar
Mu Duck, Newbie
Posted: 27 November 2013 08:39 PM   Total Posts: 20   [ # 1 ]

I guess no. I also use DAE, because it is the only common format, which supports geometry sharing by away3d. There is no option to control this in DAEparser, so I just decided that it is quite convenient to prepare everything in your 3D editor.

Also I found out, that there is an option in DAEparser source to configure whether you have LEFT_HAND coordinates or RIGHT_HAND coordinates. But there is no way to change it from LEFT one right now.

   

Avatar
theMightyAtom, Sr. Member
Posted: 28 November 2013 06:55 AM   Total Posts: 669   [ # 2 ]

The way to do it inside Away3D is to rotate your loader.
Some Collada exporters have the option to decide which axis is up.
DAE, or Collada is not recommended as a runtime format, but more for moving 3D data from one program to another. On the web and mobile a binary format is easier for Flash player to parse, and generally fills alot less.

I would recommend loading your files into AwayBuilder or Prefab and exporting to AWD. At the same time you can sort out your Y-axis…

Good Luck!

   

mole, Newbie
Posted: 28 November 2013 10:40 AM   Total Posts: 29   [ # 3 ]

The problem is I’m making a tool, where people can upload their own 3D file. So collada makes sense, because we don’t know from which application the 3D file is coming.
Rotating the loader is indeed something I can try.
I’m also having difficulties figuring out how to re-center a model. I know there’s a utility function somewhere… but that doesn’t work if you have a complex model made out of different meshes and submeshes.

   

Avatar
theMightyAtom, Sr. Member
Posted: 28 November 2013 12:14 PM   Total Posts: 669   [ # 4 ]

I see, that is a special situation where Collada does make sense.

Within your viewer you could then add the option to choose up axis.
It should also be possible to read this from the DAE which is plain XML.

You could also find your own bounds by looping through the vertex position in the file.

Good Luck!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X