//calculates the bounding box of the whole model
private void ComputeBoundingBox(Model model, Scene scene)
{
Vector3 sceneMin = new Vector3(1e10f, 1e10f, 1e10f);
Vector3 sceneMax = new Vector3(-1e10f, -1e10f, -1e10f);
Matrix transform = Matrix.Identity;
ComputeBoundingBox(scene, scene.RootNode, ref sceneMin, ref sceneMax, ref transform);
//set min and max of bounding box
model.SetAABox(sceneMin, sceneMax);
}