summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-09-23 07:17:56 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-09-23 07:17:56 -0400
commite5f3c6e2a7583dbc25323563eb26547c91cb760e (patch)
tree12354685fa2aa2cd06e59ebb85ccb5e34149690f
parent0ccd85fe9a44bfb8920bfa0c9302d68b8675659d (diff)
graphics: model: Use keyword arguments in draw-model.
-rw-r--r--chickadee/graphics/model.scm7
-rw-r--r--examples/model.scm5
2 files changed, 10 insertions, 2 deletions
diff --git a/chickadee/graphics/model.scm b/chickadee/graphics/model.scm
index 11e90d5..92d5a28 100644
--- a/chickadee/graphics/model.scm
+++ b/chickadee/graphics/model.scm
@@ -150,8 +150,13 @@
(%make-model name scenes default-scene render-state))
(define %depth-test (make-depth-test))
+(define %identity-matrix (make-identity-matrix4))
+(define %origin (vec3 0.0 0.0 0.0))
-(define* (draw-model model model-matrix view-matrix camera-position #:key
+(define* (draw-model model #:key
+ (model-matrix %identity-matrix)
+ (view-matrix %identity-matrix)
+ (camera-position %origin)
(skybox (default-skybox))
(lights '()))
(with-graphics-state ((g:depth-test %depth-test)
diff --git a/examples/model.scm b/examples/model.scm
index 2c2f398..26067b6 100644
--- a/examples/model.scm
+++ b/examples/model.scm
@@ -27,7 +27,10 @@
(define (draw alpha)
(with-projection projection
- (draw-model model model-matrix view-matrix position))
+ (draw-model model
+ #:model-matrix model-matrix
+ #:view-matrix view-matrix
+ #:camera-position position))
(draw-text text text-position))
(define (update dt)