summaryrefslogtreecommitdiff
path: root/examples/model.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:20:08 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:34:43 -0400
commit96b3a372b58c8181ef9fb401f1502457f5ab6e6c (patch)
tree9ca960d68f47299867193cb62dfdd6dc89678925 /examples/model.scm
parentf4265facfa7d8d14a934473f6c103122cb540f67 (diff)
examples: model: Fix view matrix.
Diffstat (limited to 'examples/model.scm')
-rw-r--r--examples/model.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/model.scm b/examples/model.scm
index 8ba9b4a..3e17588 100644
--- a/examples/model.scm
+++ b/examples/model.scm
@@ -47,9 +47,10 @@
(vec3-z position)))
;; Compute new view matrix
- (matrix4-translate! translation position)
- (matrix4-identity! view-matrix)
- (matrix4-mult! view-matrix view-matrix translation)
+ (look-at! view-matrix
+ position
+ (vec3+ position (vec3 0.0 0.0 1.0))
+ (vec3 0.0 1.0 0.0))
;; Rotate the model about the y-axis
(set! y-rotation (+ y-rotation 0.03))