Original Post
In Excel when you draw a 3d graph, if you rotate the graph arbitrarily you can see that it recalculates the extents of the graph so that it always fits within the view frustum. For my software, that would be the equivalent of moving the camera towards or away from the origin (it's look-at point).
So, given an arbitrarily oriented bounding box, centred at the origin and assuming the camera always looks at the origin, how do I compute the distance the camera needs to be away from the origin in order to completely contain the box in the viewport?
This sounds like a simple problem, but I'm not sure how to proceed.
So, given an arbitrarily oriented bounding box, centred at the origin and assuming the camera always looks at the origin, how do I compute the distance the camera needs to be away from the origin in order to completely contain the box in the viewport?
This sounds like a simple problem, but I'm not sure how to proceed.