From 7d42b57289483fd59b770cdfa0f2923086508014 Mon Sep 17 00:00:00 2001 From: fincs Date: Wed, 27 Jan 2016 21:25:21 +0100 Subject: [PATCH] Fix Mtx_RotateX/Z to use standard mathematical convention (positive=CCW) --- source/maths/mtx_perspstereo.c | 4 ++-- source/maths/mtx_persptilt.c | 4 ++-- source/maths/mtx_rotatex.c | 4 ++-- source/maths/mtx_rotatez.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/maths/mtx_perspstereo.c b/source/maths/mtx_perspstereo.c index 148e8de..23f0c93 100644 --- a/source/maths/mtx_perspstereo.c +++ b/source/maths/mtx_perspstereo.c @@ -32,6 +32,6 @@ void Mtx_PerspStereoTilt(C3D_Mtx* mtx, float fovx, float invaspect, float near, // Translate to screen plane Mtx_Translate(mtx, 0, iod/2, 0); - // Rotate the matrix one quarter of a turn CCW in order to fix the 3DS screens' orientation - Mtx_RotateZ(mtx, M_TAU/4, true); + // Rotate the matrix one quarter of a turn clockwise in order to fix the 3DS screens' orientation + Mtx_RotateZ(mtx, -M_TAU/4, true); } diff --git a/source/maths/mtx_persptilt.c b/source/maths/mtx_persptilt.c index 208f625..2ab5d44 100644 --- a/source/maths/mtx_persptilt.c +++ b/source/maths/mtx_persptilt.c @@ -39,6 +39,6 @@ void Mtx_PerspTilt(C3D_Mtx* mtx, float fovx, float invaspect, float near, float mp2.r[2].w = -0.5; Mtx_Multiply(mtx, &mp2, &mp); - // Rotate the matrix one quarter of a turn CCW in order to fix the 3DS screens' orientation - Mtx_RotateZ(mtx, M_TAU/4, true); + // Rotate the matrix one quarter of a turn clockwise in order to fix the 3DS screens' orientation + Mtx_RotateZ(mtx, -M_TAU/4, true); } diff --git a/source/maths/mtx_rotatex.c b/source/maths/mtx_rotatex.c index ca18aea..b5baf12 100644 --- a/source/maths/mtx_rotatex.c +++ b/source/maths/mtx_rotatex.c @@ -10,8 +10,8 @@ void Mtx_RotateX(C3D_Mtx* mtx, float angle, bool bRightSide) Mtx_Zeros(&rm); rm.r[0].x = 1.0f; rm.r[1].y = cosAngle; - rm.r[1].z = sinAngle; - rm.r[2].y = -sinAngle; + rm.r[1].z = -sinAngle; + rm.r[2].y = sinAngle; rm.r[2].z = cosAngle; rm.r[3].w = 1.0f; diff --git a/source/maths/mtx_rotatez.c b/source/maths/mtx_rotatez.c index 59ca617..b951ef8 100644 --- a/source/maths/mtx_rotatez.c +++ b/source/maths/mtx_rotatez.c @@ -9,8 +9,8 @@ void Mtx_RotateZ(C3D_Mtx* mtx, float angle, bool bRightSide) Mtx_Zeros(&rm); rm.r[0].x = cosAngle; - rm.r[0].y = sinAngle; - rm.r[1].x = -sinAngle; + rm.r[0].y = -sinAngle; + rm.r[1].x = sinAngle; rm.r[1].y = cosAngle; rm.r[2].z = 1.0f; rm.r[3].w = 1.0f;