From c9663d9934d9f5d357428666fc318c026c142408 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 15 Dec 2015 00:39:15 +0200 Subject: [PATCH] Apply some extra distance in case of bulging curvature It doesn't work perfectly for spherical curvature, but reasaonably enough with values that are likely to be of practical use. --- source/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/main.c b/source/main.c index b7bd8a3..c6f7c3f 100644 --- a/source/main.c +++ b/source/main.c @@ -627,6 +627,8 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito sin_ksv = monitor->keystone_vertical/sqrt(1.0f+monitor->keystone_vertical*monitor->keystone_vertical); cos_ksv = sqrt(1.0f-sin_ksv*sin_ksv); distance = monitor->perspective+sin_ksv*((sin_ksv>0)-monitor->vertical_center)/aspect; + if(monitor->curvature_depth<0) + distance += -monitor->curvature_depth; eye[0] = 0.0f; eye[1] = (monitor->vertical_center-0.5f)/aspect+sin_ksv*distance; -- 2.45.2