www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Vziuh on June 12, 2011, 11:05:07 am

Title: ERROR: Bounding box missing in this mesh!
Post by: Vziuh 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 ;
}
}


Title: Re: ERROR: Bounding box missing in this mesh!
Post by: EgonOlsen 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();
Title: Re: ERROR: Bounding box missing in this mesh!
Post by: Vziuh 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 !