Loader 3D

Software: Away3D 4.x

Gralcio, Newbie
Posted: 16 July 2011 07:29 PM   Total Posts: 6

Hey!

I have some questions regarding how Loader3D works.

The first question is related to a fact that when I use a loader (e.g. to load the turtle from one of the examples) and I actually want to get the loaded Mesh, it’s hidden pretty deep inside. I end up doing something like this if I need to clone it:
_myMesh = (Mesh)(_loader.getChildAt(0).getChildAt(0).getChildAt(0).clone());

Is that how I’m supposed to reach it or is there some different function in Loader3D that I didn’t notice?


The other thing. I used the loader to load a model of dodecahedron stored in .ac file. 60 vertices, 36 triangles, nothing fancy. The way it was parsed resulted in a mesh inside Loader3D with 36 triangles, yes, but with 108 vertices. It created separate vertices for each triangle, even if they were shared in the model.

Is that a desired behaviour and is there a reason behind it? I really hoped to obtain the same amount of vertices in the geometry compared to what I had originally in the model (especially as I’m planning to manualy access and reposition some of vertices from time to time).

Cheers,
G.

   

Richard Olsson, Administrator
Posted: 16 July 2011 10:46 PM   Total Posts: 1192   [ # 1 ]

Listen for ASSET_COMPLETE or MESH_COMPLETE to get the mesh as it comes in. Or use the asset library if the plan isn’t to just show a single representation of the loaded file (which is really just what Loader3D is a short-hand of.)

The dodecahedron may have been “exploded” to allow for separate vertex normals on all faces, which is required for flat/faceted shading. So this is expected behavior.

   

Gralcio, Newbie
Posted: 17 July 2011 05:13 AM   Total Posts: 6   [ # 2 ]

Thanks, Richard.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X