Okej mamo kocko!
parent
3bf7daabc2
commit
0e34584679
59
anim.scm
59
anim.scm
|
@ -3,6 +3,8 @@
|
|||
(chickadee graphics sprite)
|
||||
(chickadee graphics text)
|
||||
(chickadee graphics path)
|
||||
(chickadee graphics pbr)
|
||||
(chickadee graphics mesh)
|
||||
(chickadee math vector)
|
||||
(chickadee math rect)
|
||||
(system repl coop-server))
|
||||
|
@ -10,35 +12,50 @@
|
|||
(define repl (spawn-coop-repl-server))
|
||||
|
||||
(define (update dt)
|
||||
(poll-coop-repl-server repl))
|
||||
|
||||
(define tekst "Nekaaaaj")
|
||||
(define stevec 0)
|
||||
(define (draw alpha)
|
||||
;(poll-coop-repl-server repl)
|
||||
(set! stevec (+ stevec 1))
|
||||
(dodaj-objekte)
|
||||
(obj-anim)
|
||||
(izrisi))
|
||||
(display (string-append (number->string stevec) "\n"))
|
||||
|
||||
(define (dodaj-objekte)
|
||||
'())
|
||||
(display dt)
|
||||
(display "\n")
|
||||
;; Moramo pogledat prav!
|
||||
(look-at! view-matrix
|
||||
position
|
||||
(vec3+ position (vec3 0.0 0.0 1.0))
|
||||
(vec3 0.0 1.0 0.0))
|
||||
)
|
||||
|
||||
(define (obj-anim)
|
||||
(display stevec)
|
||||
'())
|
||||
(define (izrisi)
|
||||
(draw-canvas
|
||||
(make-canvas
|
||||
(with-style ((stroke-color green)
|
||||
(stroke-width 4.0))
|
||||
(stroke (circle (vec2 100.0 100.0) stevec))
|
||||
))))
|
||||
(define (key-press key modifiers repeat?)
|
||||
(cond
|
||||
((eq? key 'q)
|
||||
(abort-game))
|
||||
((eq? key 'r)
|
||||
(reset-stevec))))
|
||||
|
||||
(define stevec 0)
|
||||
|
||||
(define (reset-stevec)
|
||||
(set! stevec 0))
|
||||
|
||||
(define camera-position (vec3 0.0 0.0 3.0))
|
||||
(define world (make-identity-matrix4))
|
||||
(define view (look-at camera-position (vec3 0.0 0.0 0.0) (vec3 0.0 1.0 0.0)))
|
||||
(define projection (perspective-projection (/ pi 3.0) (/ 4.0 3.0) 0.1 5.0))
|
||||
(define view-matrix (make-identity-matrix4))
|
||||
(define model-matrix (make-identity-matrix4))
|
||||
(define position (vec3 0.0 0.0 -4.0))
|
||||
|
||||
(define (draw alpha)
|
||||
(with-projection
|
||||
projection
|
||||
(draw-mesh (make-cube (/ stevec 100) (make-pbr-material))
|
||||
#:model-matrix model-matrix
|
||||
#:view-matrix view-matrix
|
||||
#:camera-position position)))
|
||||
|
||||
(reset-stevec)
|
||||
|
||||
(run-game
|
||||
#:draw draw
|
||||
#:update update)
|
||||
#:update update
|
||||
#:key-press key-press)
|
||||
|
|
Loading…
Reference in New Issue