From 3532ea86964f91a4fd4fcf5c0d4ef6f2201d5bf3 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Thu, 14 Sep 2023 22:43:37 +0200 Subject: [PATCH] Fixed left/right offsets --- examples/multiview/multiview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/multiview/multiview.cpp b/examples/multiview/multiview.cpp index 8879037e..5c9907e3 100644 --- a/examples/multiview/multiview.cpp +++ b/examples/multiview/multiview.cpp @@ -3,7 +3,7 @@ * * Uses VK_KHR_multiview for simultaneously rendering to multiple views and displays these with barrel distortion using a fragment shader * -* Copyright (C) 2018 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2018-2023 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -622,8 +622,8 @@ public: rotM = glm::rotate(rotM, glm::radians(camera.rotation.z), glm::vec3(0.0f, 0.0f, 1.0f)); // Left eye - left = -aspectRatio * wd2 + 0.5f * eyeSeparation * ndfl; - right = aspectRatio * wd2 + 0.5f * eyeSeparation * ndfl; + left = -aspectRatio * wd2 - 0.5f * eyeSeparation * ndfl; + right = aspectRatio * wd2 - 0.5f * eyeSeparation * ndfl; transM = glm::translate(glm::mat4(1.0f), camera.position - camRight * (eyeSeparation / 2.0f)); @@ -631,8 +631,8 @@ public: ubo.modelview[0] = rotM * transM; // Right eye - left = -aspectRatio * wd2 - 0.5f * eyeSeparation * ndfl; - right = aspectRatio * wd2 - 0.5f * eyeSeparation * ndfl; + left = -aspectRatio * wd2 + 0.5f * eyeSeparation * ndfl; + right = aspectRatio * wd2 + 0.5f * eyeSeparation * ndfl; transM = glm::translate(glm::mat4(1.0f), camera.position + camRight * (eyeSeparation / 2.0f));