*/\r
void windowReshape(int w, int h) {\r
glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
- // **NOTE: windowReshape needs to be re-written using glFrustrum and perspective projection calculations\r
+ glMatrixMode(GL_PROJECTION);\r
+ glLoadIdentity();\r
+ if (w <= h)\r
+ glFrustum(-1.0, 1.0, -1.0*(GLfloat) h / (GLfloat) w,\r
+ 1.0*(GLfloat) h / (GLfloat) w, 2.0, 10.0);\r
+ else\r
+ glFrustum(-1.0*(GLfloat) w / (GLfloat) h,\r
+ 1.0*(GLfloat) w / (GLfloat) h, -1.0, 1.0, 2.0, 10.0);\r
+ glMatrixMode(GL_MODELVIEW);\r
}\r
\r
/**\r