Author Topic: ERROR: Bounding box missing in this mesh!  (Read 4198 times)

Offline Vziuh

  • byte
  • *
  • Posts: 13
    • View Profile
ERROR: Bounding box missing in this mesh!
« on: June 12, 2011, 11:05:07 am »
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.

Code: [Select]

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 ;
}
}



Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: ERROR: Bounding box missing in this mesh!
« Reply #1 on: June 12, 2011, 03:50:46 pm »
Just add two calls before adding the mesh to the animation:
Code: [Select]
model.calcBoundingBox();
model.calcNormals();

Offline Vziuh

  • byte
  • *
  • Posts: 13
    • View Profile
Re: ERROR: Bounding box missing in this mesh!
« Reply #2 on: July 11, 2011, 06:26:41 pm »
didn't have much time to test it till today.
 thx  for answer, it works ! at last !