'Framing' a bounding volume

Most DCC applications allow you to select an object and make it fill the viewport.

Is there a standard, or at least efficient and stable way of doing this?

A method I think might be reasonable:

Perform a look-at

Solve M*v=v’, where v is a vertex of say, a bounding box, and v’ is near a corner of the viewport.

Transform the camera by M.

This is probably going to yield a ‘duh!’ solution, but it’s something I’ve never put much thought into.

Thanks.

that’s more or less how i do it. i get the bounding box around the volumne then adjust the near/far clipplanes to accomodate it.