Thanks, I’ll try be more specific. Here it goes:
int initialize()
{
glClearColor( 0.0, 0.0, 0.0, 0.0 );
glOrtho( 0.0, 100.0, 0.0, 100.0, 0.0, 100.0 );
}
here I set the coordinate system to be between 0 and 100 for the three axis, right?
void reshape( GLsizei w, GLsizei h )
{
if(h == 0) h = 1;
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if( w <= h )
gluOrtho2D (0.0f, 250.0f, 0.0f, 250.0f*h/w);
else
gluOrtho2D (0.0f, 250.0f*w/h, 0.0f, 250.0f);
}
but in some programs, a reshape function is defined and the coord system is set by gluOrtho2D. Why?
void reshape(int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho( 0.0, 640.0, 480.0, 0.0, 0.0, 1.0 );
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
and here, a GL_MODELVIEW is set too…
Thanks