Position camera to view an entire 3d object

I wan to fit a 3d arbitrary model (loaded from file) into screen. That is, i want to translate the camera position until the model can be viewed in its full extension.
I suppose that the translation factor can be extracted from frustum dimensions and model dimensions, but i’m not good at mathematics and i need it “for yesterday”, you understand…:slight_smile:

Incredibily, I resolved it by myself.
Thanks anyway :slight_smile:

Care to help others on how you did it???