Voulez-vous connaître l'étendue maximale sur votre écran dans pixles?
Si c'est le cas, le plus simple est d'appeler gluProject pour tous vos sommets et de stocker les positions x et y maximales et minimales.
pourrait ressembler à ceci:
GLdouble modelview[16], projection[16]
GLint viewport[4];
glGetDoublev(GL_MODELVIEW_MATRIX, *modelView);
glGetDoublev(GL_PROJECTION_MATRIX, *projection);
glGetIntegerv(GL_VIEWPORT, *viewport);
double tx, ty, tz;
for(i = 0; i < VertexCount; i++)
{
glProject(vertices[i].x, vertices[i].y, vertices[i].z,
modelview, projection, viewport,
*tx, *ty, *tz);
// now, the 2d position of the ith Vertex is stored in tx, ty, tz.
// you can now use these values to determine the 2d-extends on your screen
}