Browse Source

Solve bug on matrix multiply order for scale and rotation

pull/83/head
raysan5 9 years ago
parent
commit
fca83c9ff8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/rlgl.c

+ 1
- 1
src/rlgl.c View File

@ -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

Loading…
Cancel
Save