Fixed left/right offsets
This commit is contained in:
parent
5868234f4f
commit
3532ea8696
1 changed files with 5 additions and 5 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue