ERROR: Bounding box missing in this mesh!

Started by Vziuh, June 12, 2011, 11:05:07 AM

Previous topic - Next topic

Vziuh

hi everyone.

i'm newbie in 3D graphic programming.

when i tried to load animated model and i've got such error:

ERROR: Bounding box missing in this mesh!

I would be grateful for the help.

here's the method i use to load animation.



public static void load_animation ( Context context , String model_address , String texture_address , int model_index )
{

Object3D model ;

Animation anim = new Animation ( 5 ) ;

anim.createSubSequence ( "bend" ) ;

for ( int i = 0 ; i < 5 ; i ++ )
{

String num = "models/bend/bend"   ;  
        num += String.valueOf( i ) ;
        num += ".3DS"              ;  

   model= model_laoder ( context , num) ;
   
   anim.addKeyFrame( model.getMesh() ) ; // i've get error in this line
}
}
//=================================================================================================
private static Object3D model_laoder ( Context context , String model_address )
{

Loader.setVertexOptimization(false) ;

InputStream is    ;

try
{
is  = context.getAssets().open( model_address ) ;

return Loader.load3DS( is , 1f ) [ 0 ] ;

}
catch ( IOException e )
{
Log.v   ("World_output", "error:"+e.getMessage() );
Log.v ("World_output", e.toString());
is    = null ;
return null ;
}
}



EgonOlsen

Just add two calls before adding the mesh to the animation:
model.calcBoundingBox();
model.calcNormals();


Vziuh

didn't have much time to test it till today.
thx  for answer, it works ! at last !