Open GasimGasimzada opened 2 years ago
I found the issue but I am not why that causes the problem. I copied the Perspective
function from the example to calculate the perspective and every looked like it is working. So, I dug deep into the values between glm::perspective
and Perspective
.
For the following Perspective Lens data:
glm::perspective
gives me vastly different values than the Perspective
function:
// Perspective function from example:
(0.237889245, 0, 0, 0)
(0, 0.363970518, 0, 0)
(0, -1.00000191, -1.0, 0)
(0, 0, -0.00200000196, 0)
// glm::perspectiveRH
(0.933430076, 0, 0, 0)
(0, -1.42814803, 0, 0)
(0, 0, -1.00000095, -1.0)
(0, 0, -0.00100000098, 0)
// glm::perspectiveLH
(0.933430076, 0, 0, 0)
(0, 1.42814803, 0, 0)
(0, 0, 1.00000095, 1.0)
(0, 0, 0.00100000098, 0)
The values between them is vastly different in terms of magnitude.
I have a custom camera that is based on GLM functions:
So, I take my camera component and render my gizmo with identity transform for testing purposes:
Moving the axis horizontally works as expected; however, when I move it vertically, the gizmo moves with the camera:
I compared my view matrix with the result of
LookAt
function in the example with my provided example functions and the values are exactly the same.Can someone help me understand what I am doing wrong here?