The only way to accomplish this is to write the algorithm yourself, which is a very non-trivial algorithm, particularly if your scene consists of simple primitives AND meshes. It also depends on how exactly you want your zoom-to-fit to work. Does it fit to all of the objects in the scene, or just to the closest one? My only suggestion is to try and search for the algorithm that fits your needs on-line.