(clear)
(clear-colour (vector 0.5 0.3 0.3))
(define (a)
(with-state
(colour (vector 0.6 0.6 0.6))
(rotate (vmul (vector (mouse-x) (mouse-x) (mouse-y)) (* 0.2 (time))))
(draw-cube)))
(define (b)
(with-state
(rotate (vmul (vector (mouse-x) (mouse-x) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.4 0.4 0.4))
(with-state
(translate (vector 1 1 0))
(for ((i (in-range 2)))
(translate (vector -1 0 0))
(draw-cube)))
(with-state
(translate (vector -1 -1 0))
(for ((i (in-range 2)))
(translate (vector 1 0 0))
(draw-cube)))
(with-state
(translate (vector -1 1 0))
(for ((i (in-range 2)))
(translate (vector 0 -1 0))
(draw-cube)))
(with-state
(translate (vector 1 -1 0))
(for ((i (in-range 2)))
(translate (vector 0 1 0))
(draw-cube)))
))
(define (c)
(with-state
(rotate (vmul (vector (mouse-x) (mouse-y) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.3 0.3 0.3))
(with-state
(translate (vector 2 2 0))
(for ((i (in-range 4)))
(translate (vector -1 0 0))
(draw-cube)))
(with-state
(translate (vector -2 -2 0))
(for ((i (in-range 4)))
(translate (vector 1 0 0))
(draw-cube)))
(with-state
(translate (vector -2 2 0))
(for ((i (in-range 4)))
(translate (vector 0 -1 0))
(draw-cube)))
(with-state
(translate (vector 2 -2 0))
(for ((i (in-range 4)))
(translate (vector 0 1 0))
(draw-cube)))
))
(define (d)
(with-state
(rotate (vmul (vector (mouse-y) (mouse-x) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.2 0.2 0.2))
(with-state
(translate (vector 3 3 0))
(for ((i (in-range 6)))
(translate (vector -1 0 0))
(draw-cube)))
(with-state
(translate (vector -3 -3 0))
(for ((i (in-range 6)))
(translate (vector 1 0 0))
(draw-cube)))
(with-state
(translate (vector -3 3 0))
(for ((i (in-range 6)))
(translate (vector 0 -1 0))
(draw-cube)))
(with-state
(translate (vector 3 -3 0))
(for ((i (in-range 6)))
(translate (vector 0 1 0))
(draw-cube)))
))
(define (e)
(with-state
(rotate (vmul (vector (mouse-x) (mouse-y) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.1 0.1 0.1))
(with-state
(translate (vector 4 4 0))
(for ((i (in-range 8)))
(translate (vector -1 0 0))
(draw-cube)))
(with-state
(translate (vector -4 -4 0))
(for ((i (in-range 8)))
(translate (vector 1 0 0))
(draw-cube)))
(with-state
(translate (vector -4 4 0))
(for ((i (in-range 8)))
(translate (vector 0 -1 0))
(draw-cube)))
(with-state
(translate (vector 4 -4 0))
(for ((i (in-range 8)))
(translate (vector 0 1 0))
(draw-cube)))
))
(every-frame
(list
(a)
(b)
(c)
(d)
(e)
))