how to get the bounding box...


Is there a way to retrieve the 6 parameters used to define a orthogonal projection (glOrtho())? It seems that the 3th, 7th, 11th floats in the array returned from glGet() with argument GL_PROJECTION_MATRIX are the 3 dimensions of the bounding box. It may fail if glOrtho() was called twice although it’s unusual, right?

Please advise. Thanks.


Don’t mix bounding box and viewing volume.
BBox is smallest box shaped volume around your object.
Viewing volume set by glOrtho defines what you gonna see.
The glOrtho “sets” projection matrix (view volume). See
for details how does it work. You can recover the arguments to glOrtho from this matrix by few math operations.