diff options
-rw-r--r-- | chickadee/math/matrix.scm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/chickadee/math/matrix.scm b/chickadee/math/matrix.scm index 0f1e523..dfc3cc1 100644 --- a/chickadee/math/matrix.scm +++ b/chickadee/math/matrix.scm @@ -567,11 +567,20 @@ clipping plane NEAR and FAR." matrix)) (define (matrix4-scale! matrix s) - (init-matrix4 matrix - s 0.0 0.0 0.0 - 0.0 s 0.0 0.0 - 0.0 0.0 s 0.0 - 0.0 0.0 0.0 1.0)) + (if (vec3? s) + (let ((x (vec3-x s)) + (y (vec3-y s)) + (z (vec3-z s))) + (init-matrix4 matrix + x 0.0 0.0 0.0 + 0.0 y 0.0 0.0 + 0.0 0.0 z 0.0 + 0.0 0.0 0.0 1.0)) + (init-matrix4 matrix + s 0.0 0.0 0.0 + 0.0 s 0.0 0.0 + 0.0 0.0 s 0.0 + 0.0 0.0 0.0 1.0))) (define (matrix4-scale s) (let ((matrix (make-null-matrix4))) |