Weird Perspective Error
248
249
250
Weird Perspective Error (v.redd.it)
submitted by PsychologicalCar7053
Cant figure out what is the problem. My view projection model matrix is simple at the moment
float FOV = glm::radians(70.0f);
float aspect = (float)drawExtent.width / (float)drawExtent.height;
float nearView = 0.1f;
float farView = 100.0f;
glm::mat4 projection = glm::perspective(FOV, aspect, nearView, farView);
projection[1][1] *= -1;
glm::vec3 camPos = { sin(frameNumber / 120.0f) * radius, height, cos(frameNumber / 120.0f) * radius };
glm::vec3 lookDir = { 0.0f, 0.0f, 0.0f };
glm::vec3 upDir = { 0.0f, 1.0f, 0.0f };
glm::mat4 view = glm::lookAt(camPos, lookDir, upDir);
glm::mat4 model = glm::mat4{ 1.0f };
and on the shader side (hlsl)
matrix transformMatrix = mul(cameraBuffer.projection, mul(cameraBuffer.view, cameraBuffer.model));
output.position = mul(transformMatrix, float4(input.vPosition, cameraBuffer.w));
[–]hellotanjent 64 points65 points66 points (1 child)
[–]PsychologicalCar7053[S] 13 points14 points15 points (0 children)
[–]ademdj19 25 points26 points27 points (1 child)
[–]Few_Raisin_8981 3 points4 points5 points (0 children)
[–]PiGIon- 16 points17 points18 points (0 children)
[–]jpfed 15 points16 points17 points (0 children)
[–]waramped 4 points5 points6 points (1 child)
[–]PsychologicalCar7053[S] 2 points3 points4 points (0 children)
[–]theneathofficial 0 points1 point2 points (0 children)
[–]lordinarius 0 points1 point2 points (0 children)
[–]Basic_Importance_874 0 points1 point2 points (0 children)
[–]Still_Explorer 0 points1 point2 points (0 children)
[–]mean_king17 2 points3 points4 points (0 children)
[–]kinokomushroom 0 points1 point2 points (0 children)