Fix Mtx_RotateX/Z to use standard mathematical convention (positive=CCW)

This commit is contained in:
fincs 2016-01-27 21:25:21 +01:00
parent 1e9e8ead11
commit 7d42b57289
4 changed files with 8 additions and 8 deletions

View File

@ -32,6 +32,6 @@ void Mtx_PerspStereoTilt(C3D_Mtx* mtx, float fovx, float invaspect, float near,
// Translate to screen plane // Translate to screen plane
Mtx_Translate(mtx, 0, iod/2, 0); Mtx_Translate(mtx, 0, iod/2, 0);
// Rotate the matrix one quarter of a turn CCW in order to fix the 3DS screens' orientation // Rotate the matrix one quarter of a turn clockwise in order to fix the 3DS screens' orientation
Mtx_RotateZ(mtx, M_TAU/4, true); Mtx_RotateZ(mtx, -M_TAU/4, true);
} }

View File

@ -39,6 +39,6 @@ void Mtx_PerspTilt(C3D_Mtx* mtx, float fovx, float invaspect, float near, float
mp2.r[2].w = -0.5; mp2.r[2].w = -0.5;
Mtx_Multiply(mtx, &mp2, &mp); Mtx_Multiply(mtx, &mp2, &mp);
// Rotate the matrix one quarter of a turn CCW in order to fix the 3DS screens' orientation // Rotate the matrix one quarter of a turn clockwise in order to fix the 3DS screens' orientation
Mtx_RotateZ(mtx, M_TAU/4, true); Mtx_RotateZ(mtx, -M_TAU/4, true);
} }

View File

@ -10,8 +10,8 @@ void Mtx_RotateX(C3D_Mtx* mtx, float angle, bool bRightSide)
Mtx_Zeros(&rm); Mtx_Zeros(&rm);
rm.r[0].x = 1.0f; rm.r[0].x = 1.0f;
rm.r[1].y = cosAngle; rm.r[1].y = cosAngle;
rm.r[1].z = sinAngle; rm.r[1].z = -sinAngle;
rm.r[2].y = -sinAngle; rm.r[2].y = sinAngle;
rm.r[2].z = cosAngle; rm.r[2].z = cosAngle;
rm.r[3].w = 1.0f; rm.r[3].w = 1.0f;

View File

@ -9,8 +9,8 @@ void Mtx_RotateZ(C3D_Mtx* mtx, float angle, bool bRightSide)
Mtx_Zeros(&rm); Mtx_Zeros(&rm);
rm.r[0].x = cosAngle; rm.r[0].x = cosAngle;
rm.r[0].y = sinAngle; rm.r[0].y = -sinAngle;
rm.r[1].x = -sinAngle; rm.r[1].x = sinAngle;
rm.r[1].y = cosAngle; rm.r[1].y = cosAngle;
rm.r[2].z = 1.0f; rm.r[2].z = 1.0f;
rm.r[3].w = 1.0f; rm.r[3].w = 1.0f;