View Full Version : Fitting a model appropirately

02-26-2013, 10:20 PM
Hello All,

i have what might be a trivial question. But, i would like to know if my approach is correct. So, here is the
I have a 3D model(arbitrary) and i need to fit it appropriately in the viewport.

My approach:
I calculate the bounding box of the model, fit it into some place within the view frustum such that it would be visible. But calculation of this would be slightly heavy. Is this the right way or is there a better way to achieve the same?


02-27-2013, 12:40 AM
Yes i think it's the good way (BBox and fitting the view frustum).

But i can't see how this can be a 'slightly heavy' calculations ^^ (for 1 object -> 1 (AA)BBox and a frustum camera).

But for optimizing: you can use a simply Bounding-Sphere and simplify calculations of Near Plane, Far Plane, field of view angle (defined by the Projection Matrix).


02-27-2013, 09:16 PM
Thanks YoYo! yeah, using a bounding sphere would simplify the calculations.