]> Pileus Git - grits/blobdiff - src/opengl.c
renaming to plugins
[grits] / src / opengl.c
index c943c796b00a17b52d5beba7fc0b88462352cbf2..e9d4a7e3a0a6d44ea35d6f361e4b8ec1f4db4f8d 100644 (file)
@@ -53,7 +53,12 @@ static gboolean configure_start(GtkWidget *da, GdkEventConfigure *event, gpointe
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glClearColor(0.8f, 0.8f, 1.0f, 0.0f);
-       glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+
+       /* 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);
@@ -65,7 +70,7 @@ static gboolean configure_start(GtkWidget *da, GdkEventConfigure *event, gpointe
        glLoadIdentity();
        double rad = atan(height/2*1000.0/dist); // 1px = 1000 meters
        double deg = (rad*180)/M_PI;
-       gluPerspective(deg*2, width/height, 0.1f, 1000000000.0f);
+       gluPerspective(deg*2, width/height, dist-20, dist+20);
 
        /* Camera position? */
        glMatrixMode(GL_MODELVIEW);