PDA

View Full Version : generate zoom all extents matrix



07-20-2004, 06:56 PM
can anyone give me an idea of how yoou would go about calculating a modelview matrix, that you could multiply that would zoom to the extents/all of a loaded model.

currently loading vrml and 3ds models

07-20-2004, 08:51 PM
You have a bounding radius of the model and the camera's fov, just solve what the distance is for one side of the right angle triangle.

07-20-2004, 09:05 PM
that's the half-triangle in the camera's frustum, btw. All you need is right-angle trigonmetry to solve it.