]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Fix a small error in calculating projection frustum vertices
authorMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 19:45:51 +0000 (21:45 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 19:45:51 +0000 (21:45 +0200)
source/main.c

index a14ea8ded2f01568528d14eeae2b4eda03b5b3ca..cde4df3ba14659790a729137b6d3fc1ab17f5125 100644 (file)
@@ -653,8 +653,8 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito
                {
                        i = 1+(1+y*2+x)*3;
                        monitor->geometry_data[i] = ((x-0.5f)*distance/monitor->perspective)*10000;
-                       monitor->geometry_data[i+1] = (eye[1]+look[1]*distance-(y-0.5f)*look[2]*distance/monitor->perspective/aspect)*10000;
-                       monitor->geometry_data[i+2] = (eye[2]+look[2]*distance+(y-0.5f)*look[1]*distance/monitor->perspective/aspect)*10000;
+                       monitor->geometry_data[i+1] = (eye[1]+look[1]*distance-(y-monitor->vertical_center)*look[2]*distance/monitor->perspective/aspect)*10000;
+                       monitor->geometry_data[i+2] = (eye[2]+look[2]*distance+(y-monitor->vertical_center)*look[1]*distance/monitor->perspective/aspect)*10000;
                }
        for(i=0; i<(t+1)*(t+1)*3; ++i)
                monitor->geometry_data[16+i] = vertex_data[i]*10000;