Skupaj s tlemi

kegel
Jurij Podgoršek 2022-12-14 01:13:25 +01:00
parent 870d909845
commit 246391c4e1
1 changed files with 20 additions and 3 deletions

View File

@ -6,7 +6,9 @@
(chickadee graphics model)
(chickadee graphics light)
(chickadee graphics skybox)
(chickadee math)
(chickadee math vector)
(chickadee math matrix)
(system repl coop-server))
(define repl (spawn-coop-repl-server))
@ -34,13 +36,18 @@
(define (obj-anim dt)
(set! rotX (+ rotX (/ dt 2)))
(set! rotY (+ rotY (/ dt 1)))
(set! rotZ (+ rotZ (/ dt 1.5)))
(set! rotZ (+ rotZ (/ dt 0.5)))
(matrix4-copy! (matrix4* (matrix4-scale stevec)
(matrix4-rotate-x rotX)
(matrix4-rotate-y rotY)
(matrix4-rotate-z rotZ))
model-matrix)
(matrix4-copy! (matrix4* (matrix4-scale stevec)
(matrix4-rotate-x rotY)
(matrix4-rotate-y rotZ)
(matrix4-rotate-z rotX))
tla-matrix)
;(matrix4-scale! model-matrix stevec)
;(matrix4-mult! model-matrix model-matrix (matrix4-scale stevec))
;(matrix4-rotate-x! model-matrix rotX)
@ -65,6 +72,7 @@
(define projection (perspective-projection (/ pi 3.0) (/ 4.0 3.0) 0.1 10.0))
(define view-matrix (make-identity-matrix4))
(define model-matrix (make-identity-matrix4))
(define tla-matrix (make-identity-matrix4))
(define position (vec3 0.0 0.0 -4.0))
(define (ustvari-tla)
@ -82,6 +90,7 @@
))
(define obj #f)
(define tla #f)
(define (ustvari-nebo)
(let ((face (list
@ -102,7 +111,14 @@
#:view-matrix view-matrix
#:camera-position position
#:lights (list (ustvari-luc))
#:skybox (ustvari-nebo))))
;#:skybox (ustvari-nebo)
)
(draw-mesh tla
#:model-matrix tla-matrix
#:view-matrix view-matrix
#:camera-position position
#:lights (list (ustvari-luc))
)))
;; :( ne dela?
(define (ustvari-luc)
@ -116,7 +132,8 @@
(poglej)
(reset-stevec)
(ustvari-luc)
(set! obj (ustvari-objekt)))
(set! obj (ustvari-objekt))
(set! tla (ustvari-tla)))
(run-game
#:draw draw