diff --git a/cores/libretro-ffmpeg/fft/fft.cpp b/cores/libretro-ffmpeg/fft/fft.cpp index 7fa197a796..e3b32b7f1b 100644 --- a/cores/libretro-ffmpeg/fft/fft.cpp +++ b/cores/libretro-ffmpeg/fft/fft.cpp @@ -186,6 +186,9 @@ static void fft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned #endif glm::mat4 mvp_lookat = glm::lookAt(eye, center, up); #ifdef GLM_USE_DEBUG + printf("eye %.2f %.2f %.2f\n", eye.x, eye.y, eye.z); + printf("center %.2f %.2f %.2f\n", center.x, center.y, center.z); + printf("up %.2f %.2f %.2f\n", up.x, up.y, up.z); printf("mvp_lookat: \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n\n", mvp_lookat[0][0], mvp_lookat[0][1], @@ -269,6 +272,9 @@ static void fft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned MAT_ELEM_4X4(mvp_persp, 3, 2), MAT_ELEM_4X4(mvp_persp, 3, 3) ); + printf("eye %.2f %.2f %.2f\n", eye[0], eye[1], eye[2]); + printf("center %.2f %.2f %.2f\n", center[0], center[1], center[2]); + printf("up %.2f %.2f %.2f\n", up[0], up[1], up[2]); #endif matrix_4x4_lookat(&mvp_lookat, eye, center, up); #ifdef GLM_USE_DEBUG diff --git a/libretro-common/gfx/math/matrix_4x4.c b/libretro-common/gfx/math/matrix_4x4.c index b8d1969cf9..7cf1122727 100644 --- a/libretro-common/gfx/math/matrix_4x4.c +++ b/libretro-common/gfx/math/matrix_4x4.c @@ -233,11 +233,11 @@ void matrix_4x4_projection(math_matrix_4x4 *out, MAT_ELEM_4X4(*out, 2, 0) = 0.0f; MAT_ELEM_4X4(*out, 2, 1) = 0.0f; MAT_ELEM_4X4(*out, 2, 2) = -((zfar + znear) / delta_z); - MAT_ELEM_4X4(*out, 2, 3) = -((2.f * zfar * znear) / delta_z); + MAT_ELEM_4X4(*out, 2, 3) = -1.f; MAT_ELEM_4X4(*out, 3, 0) = 0.0f; MAT_ELEM_4X4(*out, 3, 1) = 0.0f; - MAT_ELEM_4X4(*out, 3, 2) = -1.f; - MAT_ELEM_4X4(*out, 3, 3) = 1.0f; + MAT_ELEM_4X4(*out, 3, 2) = -((2.f * zfar * znear) / delta_z); + MAT_ELEM_4X4(*out, 3, 3) = 0.0f; } void matrix_4x4_lookat(math_matrix_4x4 *out,