tags:

views:

31

answers:

2

Hello,

I am looking for a way to display my entire scene on the screen. This involves a call to glOrtho() with my clipping plane bounds.

However, the size of my scene is dynamic and as such, I need to find a way to determine a projection box that will contain the whole scene.

Any suggestions?

A: 

Why don't just update dinamically your ortho projection? Change it when you need it.

Matias Valdenegro
I don't know the maximum and minimum coordinates of my scene, so I don't know when to change the orhto projection.
Anne Nonimus
A: 

You will need to know the bounding boxes of every object in your scene. Then you can keep expanding your scene's bounding box by each object that is in it. You can see an example of this in OpenSceneGraph using their BoundingBox class.

If you need to get the bounding box for a particular object, you can just store the minimum and maximum values along each axis as you load the model (since bounding boxes are axis aligned).

insominx