shortest distance form boundingbox to camera

Hello, In a 3D scene, I want calculate the Near/Far planes of “gluPerspective” function in order to obtain a optimal ratio.
Then I want calculate the shortest distance of the every boundingbox’s entities of the scene to the current positon/direction camera.

How I do?
thanks in avance.