Determine Loaded Model Size

I'll start by saying hi as this is my first post.



I am intending to use JME for a web application that loads/views a number of 3DS models - the application is to visualise advertising placement (eg on a bus).



My question is to how to determine the bounds of a loaded model so that I can scale its parent node accordingly.  I was hoping that:


BoundingBox bounds = new BoundingBox();
model.setModelBound(bounds);
model.updateModelBound();
            
System.out.print("Loaded Bounds: " + bounds);



Would do the trick but I get a zero bounds dimensions.

I call this after adding the model to the parent and also after final updateRenderState just to be sure.

I'm sure this should be easy...... :(

what u need to do is the following



model.updateWorldBound();
model.getWorldBound();



this world bound gives u the actual size of the bounding

thanks for quick response!


  • that worked once I'd added


model.updateGeometricState( 0, true );