problem parsing big obj files

Software: Away3D 4.x

pool338, Jr. Member
Posted: 19 March 2012 09:16 AM   Total Posts: 37

Hi,
is there still a problem parsing “big” obj files? I have two very similar files…one is around 1.5MB and is parsed perfectly the other one is around 3.0MB and isn’t displayed.

Loader3D.enableParser(OBJParser);
   
//Parsers.enableAllBundled()
   
_loader = new Loader3D();
   
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete);
   
_loader.addEventListener(AssetEvent.MESH_COMPLETEonMeshComplete);
   
_loader.load(new URLRequest(fileName)); 

The files are attached.

 

File Attachments
models.zip  (File Size: 820KB - Downloads: 164)
   

Avatar
Fabrice Closier, Administrator
Posted: 19 March 2012 09:28 AM   Total Posts: 1265   [ # 1 ]

Just tried. They both load without a hitch.

 

   

pool338, Jr. Member
Posted: 19 March 2012 10:00 AM   Total Posts: 37   [ # 2 ]

The problem is:
if i do the following:

Loader3D.enableParser(OBJParser);
   
_loader = new Loader3D();
  
//_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
   //_loader.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
   //_loader.addEventListener(AssetEvent.MESH_COMPLETE, onMeshComplete);
   
_loader.load(new URLRequest(fileName));
   
   
_view.scene.addChild(_loader); 

The file is loaded completely and displayed correctly. But when i enable the “onResourceComplete” Event, to set the material of each loaded mesh inside a loop, i get only each second mesh.

private function onResourceComplete(event LoaderEvent) : void
  {
    
var mesh Mesh;
    var 
objectsContainer:ObjectContainer3D = new ObjectContainer3D;
   if (
_loader.numChildren  0)
   
{
    
var int 0;
    while ( 
_loader.numChildren
    
{
     
     mesh 
Mesh(_loader.getChildAt(i));
     
     
mesh.material _material;
     
mesh.geometry.scale(10);
     
     
objectsContainer.addChild(mesh);
     
1;
     
    
}
    
   }
   _scene
.addChild(objectsContainer);
  

I put a screenshot of the result as attachment

 

   

pool338, Jr. Member
Posted: 04 April 2012 06:53 AM   Total Posts: 37   [ # 3 ]

Finally i fixed it. I just had to remove

_scene.addChild(mesh

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X