From fca83c9ff8a808194cd74821640ed3f17a90010e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 11 Feb 2016 14:27:18 +0100 Subject: [PATCH] Solve bug on matrix multiply order for scale and rotation --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.c b/src/rlgl.c index 421dda025..2ea06e1c5 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1464,7 +1464,7 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD); Matrix matScale = MatrixScale(scale.x, scale.y, scale.z); Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); - Matrix matTransform = MatrixMultiply(MatrixMultiply(matRotation, matScale), matTranslation); + Matrix matTransform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); // Combine model internal transformation matrix (model.transform) with matrix generated by function parameters (matTransform) Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates