From 3ef1d1967a6391f91117ebdcd828423cc8fdb946 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 14 Dec 2015 21:45:51 +0200 Subject: [PATCH] Fix a small error in calculating projection frustum vertices --- source/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/main.c b/source/main.c index a14ea8d..cde4df3 100644 --- a/source/main.c +++ b/source/main.c @@ -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; -- 2.45.2