Fixed blackhole readable to work with fisheye camera

Co-Authored-By: Emil Wallberg <49481622+EmilWallberg@users.noreply.github.com>
This commit is contained in:
Wilhelm Björkström
2025-03-25 16:49:45 +01:00
parent 88dfbf134d
commit 802c4db98e

View File

@@ -158,10 +158,14 @@ namespace openspace {
*global::navigationHandler->anchorNode()
);
// Calculate the camera planes rotation to make sure fisheye works correcly (dcm in sgct projection.cpp)
glm::fmat4 invViewPlaneTranslationMatrix = glm::translate(glm::mat4(1.f), glm::vec3(renderData.camera.eyePositionVec3().x));
glm::fmat4 viewMatrix = renderData.camera.viewMatrix();
glm::fmat4 const CameraPlaneRotation = glm::inverse(viewMatrix * invViewPlaneTranslationMatrix);
_program->setUniform(
_uniformCache.cameraRotationMatrix,
glm::fmat4(glm::mat4_cast(camRot.localRotation))
glm::fmat4(glm::mat4_cast(camRot.localRotation)) * CameraPlaneRotation
);
_program->setUniform(