How can I make camera automatically change its location ,so that it would adjust to the models of different size?

Two main things that need tweaking are:

  1. It takes the vector to look at the object from the forward vector, that’s why it goes around the back of objects sometimes.

  2. It computes the view distance using the object’s bounds. But as the object gets bigger, the computation is a bit off, so that needs some attention…