- glScalef(10., 10., 10.);
-
- gdk_gl_drawable_gl_end(gldrawable);
+ /* Tessellation, "finding intersecting triangles" */
+ /* http://research.microsoft.com/pubs/70307/tr-2006-81.pdf */
+ /* http://www.opengl.org/wiki/Alpha_Blending */
+ glAlphaFunc(GL_GREATER,0.1);
+ glEnable(GL_ALPHA_TEST);
+
+ /* 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);