* @param h New height\r
*/\r
void windowReshape(int w, int h) {\r
- zoomFactor = zoomFactor - 1;\r
glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
glMatrixMode(GL_PROJECTION);\r
glLoadIdentity();\r
+ GLfloat x = 2.0f*(200 + 0.5)/w-1.0;\r
+ GLfloat y = 2.0f*(200 + 0.5)/h-1.0;\r
+ glTranslatef(-x,-y,0.0f);\r
if (w <= h) \r
glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w,\r
zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far);\r