diff options
| author | raysan5 <[email protected]> | 2017-08-04 18:34:51 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2017-08-04 18:34:51 +0200 |
| commit | eeca607506b22f154a7b31ef8308d3ecd30ad383 (patch) | |
| tree | 1be62a44111589da9f5ad72eba07eac3fdb6e294 /src/rlgl.c | |
| parent | 1f310f7d4b59a5a09589863d4b87df0a40c7779b (diff) | |
| download | raylib-eeca607506b22f154a7b31ef8308d3ecd30ad383.tar.gz raylib-eeca607506b22f154a7b31ef8308d3ecd30ad383.zip | |
Review transforms to match OpenGL 1.1
Diffstat (limited to 'src/rlgl.c')
| -rw-r--r-- | src/rlgl.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -446,7 +446,8 @@ void rlTranslatef(float x, float y, float z) { Matrix matTranslation = MatrixTranslate(x, y, z); - *currentMatrix = MatrixMultiply(*currentMatrix, matTranslation); + // NOTE: We transpose matrix with multiplication order + *currentMatrix = MatrixMultiply(matTranslation, *currentMatrix); } // Multiply the current matrix by a rotation matrix @@ -458,7 +459,8 @@ void rlRotatef(float angleDeg, float x, float y, float z) Vector3Normalize(&axis); matRotation = MatrixRotate(axis, angleDeg*DEG2RAD); - *currentMatrix = MatrixMultiply(*currentMatrix, matRotation); + // NOTE: We transpose matrix with multiplication order + *currentMatrix = MatrixMultiply(matRotation, *currentMatrix); } // Multiply the current matrix by a scaling matrix @@ -466,7 +468,8 @@ void rlScalef(float x, float y, float z) { Matrix matScale = MatrixScale(x, y, z); - *currentMatrix = MatrixMultiply(*currentMatrix, matScale); + // NOTE: We transpose matrix with multiplication order + *currentMatrix = MatrixMultiply(matScale, *currentMatrix); } // Multiply the current matrix by another matrix |
