So I've been learning opengl for some weeks now and managed to understand all the viewing pipelines. As far my understanding goes we need to bring the object to world space and then the world space to view space. After that the clipping is done by any of the two projections as we want. The clipping volume is then sent to the viewport which is mapped to the screen coordinates.
Now when I write this simple basic code below I don't use any of the matrixmode (GL_MODElVIEW or GL_PROJECTION) but still the primitive is displayed on the screen. So what am I missing here?
and also an extension to this question I would also like to know what exactly means to bring the object to world coordinates in theory. Does it means overlapping the axes of the object coordinates with the world coordinates.
With lot of opengl discussions out there I don't know where to look. Would be extra nice if someone refer me to some good articles.
void Di()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS) ;
glColor3f ( 1.0, 0.3, 0.2);
glVertex2f( -0.1, -0.1 );
glVertex2f( 0.1, -0.1 );
glVertex2f( 0.1, 0.1 );
glVertex2f( -0.1, 0.1 );
glEnd();
glFlush();
}
int main( int argc, char** argv)
{
glutInit( &argc, argv);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow("First Program");
glutDisplayFunc(Di);
glutMainLoop();
}