GLfloat near = -10;\r
GLfloat far = 10;\r
\r
+static float zoomFactor = 1.0;\r
+\r
/**\r
* Prints out error message when file cannot be read\r
* @param fileName Name of file that could not be read\r
* @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
if (w <= h) \r
- glOrtho(near, far, near*(GLfloat)h/(GLfloat)w,\r
- far*(GLfloat)h/(GLfloat)w, near, far);\r
+ glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w,\r
+ zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far);\r
else\r
- glOrtho(near*(GLfloat)w/(GLfloat)h,\r
- far*(GLfloat)w/(GLfloat)h, near, far, near, far);\r
+ glOrtho(zoomFactor*near*(GLfloat)w/(GLfloat)h,\r
+ zoomFactor*far*(GLfloat)w/(GLfloat)h, zoomFactor*near, zoomFactor*far, near, far);\r
glMatrixMode(GL_MODELVIEW); \r
glLoadIdentity();\r
}\r
} else {\r
glBegin(GL_QUADS);\r
glVertex3f(x1, 0.0, y1);\r
- glVertex3f(x2, 0.0, y1);\r
- glVertex3f(x2, 0.0, y2);\r
glVertex3f(x1, 0.0, y2);\r
+ glVertex3f(x2, 0.0, y2);\r
+ glVertex3f(x2, 0.0, y1);\r
glEnd();\r
}\r
\r