Better animate
This commit is contained in:
parent
bb887ae6c3
commit
f994ae30d3
@ -1,9 +1,9 @@
|
||||
;
|
||||
(clear)
|
||||
;
|
||||
(def seg-count 20)
|
||||
(def seg-count 50)
|
||||
;
|
||||
(def center
|
||||
(def frame-middle
|
||||
(div
|
||||
(of
|
||||
(frame) :h) 2))
|
||||
@ -11,7 +11,19 @@
|
||||
(def seg-width
|
||||
(div
|
||||
(of
|
||||
(frame) :w) count))
|
||||
(frame) :w) seg-count))
|
||||
;
|
||||
(defn elevation
|
||||
(i)
|
||||
(add
|
||||
(mul
|
||||
(sin
|
||||
(add
|
||||
(time 0.001)
|
||||
(div i 5)))
|
||||
(div
|
||||
(of
|
||||
(frame) :h) 5)) frame-middle))
|
||||
;
|
||||
(defn draw-dash
|
||||
(i)
|
||||
@ -20,15 +32,19 @@
|
||||
(mul
|
||||
(sub i 1) seg-width))
|
||||
(def y
|
||||
(add
|
||||
(mul
|
||||
(sin
|
||||
(add
|
||||
(time 0.01) i)) 15) center))
|
||||
(elevation i))
|
||||
(stroke
|
||||
(line
|
||||
(pos x y)
|
||||
(pos x
|
||||
(elevation
|
||||
(sub i 1)))
|
||||
(pos
|
||||
(add x seg-width) y)) 4 "red")))
|
||||
(add x seg-width)
|
||||
(elevation i))) 4
|
||||
(gradient
|
||||
(50 0
|
||||
(of
|
||||
(frame) :w) 0)
|
||||
("rgba(255,255,255,0)" "white" "#72dec2" "red")))))
|
||||
;
|
||||
(times seg-count draw-dash)
|
Loading…
x
Reference in New Issue
Block a user