diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/model.scm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/model.scm b/examples/model.scm index 4fa42c7..357a7c7 100644 --- a/examples/model.scm +++ b/examples/model.scm @@ -17,6 +17,7 @@ (define text-position (vec2 4.0 464.0)) (define text "") (define y-rotation 0.0) +(define rotate-paused? #f) (define (reset-position) (set-vec3! position 0.0 0.0 -4.0)) @@ -56,15 +57,18 @@ (vec3 0.0 1.0 0.0)) ;; Rotate the model about the y-axis - (set! y-rotation (+ y-rotation 0.03)) - (matrix4-rotate-y! model-matrix y-rotation)) + (unless rotate-paused? + (set! y-rotation (+ y-rotation 0.03)) + (matrix4-rotate-y! model-matrix y-rotation))) (define (key-press key modifiers repeat?) - (cond - ((eq? key 'q) + (case key + ((q) (abort-game)) - ((eq? key 'r) - (reset-position)))) + ((r) + (reset-position)) + ((space) + (set! rotate-paused? (not rotate-paused?))))) (run-game #:window-title "3D!" #:load load |