summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2017-08-04 18:34:51 +0200
committerraysan5 <[email protected]>2017-08-04 18:34:51 +0200
commiteeca607506b22f154a7b31ef8308d3ecd30ad383 (patch)
tree1be62a44111589da9f5ad72eba07eac3fdb6e294 /src/rlgl.c
parent1f310f7d4b59a5a09589863d4b87df0a40c7779b (diff)
downloadraylib-eeca607506b22f154a7b31ef8308d3ecd30ad383.tar.gz
raylib-eeca607506b22f154a7b31ef8308d3ecd30ad383.zip
Review transforms to match OpenGL 1.1
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index dc8a37ac..cf57bcf1 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -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