I am reading sample code GLVideoFrame from WWDC2010. In this sample, it has code like below:
static const GLfloat squareVertices[] = {
-0.5f, -0.33f,
0.5f, -0.33f,
-0.5f, 0.33f,
0.5f, 0.33f,
};
...
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), 0.0f);
transY += 0.075f;
...
glVertexPointer(2, GL_FLOAT, 0, squareVertices);
Notice that this code does not call any function like glFrustum or glOrtho for openGL projection setting.
By only calling gLoadIdentity(), what will be the “default” view volume?
it wil be a perspective project or orthographic projection?
edited:
to be more specific,
is the view volume a cube that “ranging from -1 to 1 in all three axes” ?
OpenGL assumes that after the ModelView and Projection transform, all visible elements are in clip space (or NDC space); it uses the cube
[-1;+1]^3. The matrices contents is entirely your responsibility. Since you load the identity matrix, there is no Projection at all.