From fe804d3bec4b296d4beebe5ce16f3697d8dac606 Mon Sep 17 00:00:00 2001 From: AlienDenis12 <87435855+AlienDenis12@users.noreply.github.com> Date: Tue, 3 Mar 2026 22:13:33 +0100 Subject: [PATCH] Fix inverted pitch in ThirdPersonView 2 (Front View) --- Minecraft.Client/GameRenderer.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 508b3a1..70d2ff4 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -552,6 +552,10 @@ void GameRenderer::moveCameraToPlayer(float a) double zd = Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI) * cameraDist; double yd = -Mth::sin(xRot / 180 * PI) * cameraDist; + // Invert Y offset if in third-person front view (camera faces player) + if (localplayer->ThirdPersonView() == 2) + yd = Mth::sin(xRot / 180 * PI) * cameraDist; + for (int i = 0; i < 8; i++) { float xo = (float)((i & 1) * 2 - 1); @@ -588,7 +592,18 @@ void GameRenderer::moveCameraToPlayer(float a) if (!mc->options->fixedCamera) { - glRotatef(player->xRotO + (player->xRot - player->xRotO) * a, 1, 0, 0); + //glRotatef(player->xRotO + (player->xRot - player->xRotO) * a, 1, 0, 0); + + float pitch = player->xRotO + (player->xRot - player->xRotO) * a; + + // Invert pitch if in third-person front view (camera faces player) + if(localplayer->ThirdPersonView() == 2) + { + pitch = -pitch; + } + + glRotatef(pitch, 1, 0, 0); + if( localplayer->ThirdPersonView() == 2 ) { // Third person view is now 0 for disabled, 1 for original, 2 for flipped