Displaying a Collada file

Software: Away3D 4.x

kitfox, Newbie
Posted: 14 January 2015 09:12 PM   Total Posts: 2

I’m having some problems trying to render a Collada file.  The file containins a single cube with a single texture mapped to each face, as well as three point lights and a camera.  I’m using the following code to load the scene and add it to my view:

Parsers.enableAllBundled();
   var 
loader:Loader3D = new Loader3D(truenull);
   var 
token:AssetLoaderToken loader.load(new URLRequest("res/room.dae"));
   
token.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete);

  private function 
onAssetComplete(event:AssetEvent):void
  {
   
if (event.asset.assetType == AssetType.CONTAINER)
   
{
    
var mesh:ObjectContainer3D event.asset as ObjectContainer3D;
    
_view.scene.addChild(mesh);
   
}
  } 

During the load process the onAssetCompelete method is called several times, one of which is a reference to my root Scene object.  When added to the scene it does display my cube - however, it is unlit and has no textures applied.  Is there a way to get the loader to load everything and render it with lights and materials applied?

Also, I noticed that the onAssetComplete method seemed to be called once for every root level thing in the dae file except for nodes who’s names had a dot symbol in them.  Is away3d skipping these?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X