+ glClearColor(0.8f, 0.8f, 1.0f, 0.0f);
+
+ /* Depth test */
+ glClearDepth(1.0);
+ glDepthFunc(GL_LEQUAL);
+ glEnable(GL_DEPTH_TEST);
+
+ /* Perspective */
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ double rad = atan(height/2*1000.0/dist); // 1px = 1000 meters
+ double deg = (rad*180)/M_PI;
+ gluPerspective(deg*2, width/height, dist-20, dist+20);
+
+ /* Camera position? */
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -dist);
+ //glRotatef(-45, 1, 0, 0);