Skip to content

Commit

Permalink
add some expansion/contraction and adjust the rates
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Jul 31, 2023
1 parent 41e2b70 commit 2e68a59
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/shimmers/sketches/slither.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@

(defn draw [{:keys [t]}]
(q/no-fill)
(q/background 1.0 0.25)
(q/background 1.0 0.3)
(q/translate (cq/rel-vec 0.5 0.5))
(doseq [v (tm/norm-range 23)]
(q/begin-shape)
(apply q/curve-vertex (v/polar (cq/rel-h 0.01) (* eq/TAU v)))
(apply q/curve-vertex (v/polar (cq/rel-h 0.05) (* eq/TAU (+ v (* 0.075 (Math/sin (* 0.33 t)))))))
(apply q/curve-vertex (v/polar (cq/rel-h (+ 0.25 (* 0.125 (Math/cos t))))
(* eq/TAU (+ v (* 0.1 (Math/sin (* 1.5 t)))))))
(apply q/curve-vertex (v/polar (cq/rel-h 0.45) (* eq/TAU (+ v (* 0.075 (Math/sin (* 0.25 t)))))))
(apply q/curve-vertex (v/polar (cq/rel-h 0.49) (* eq/TAU v)))
(q/end-shape)))
(let [h (* (cq/rel-h 0.49) (+ 0.8 (* 0.2 (+ (* 0.7 (eq/unit-cos (+ 0.1 (* 0.4 t))))
(* 0.3 (eq/unit-cos (* 1.7 t)))))))
b (* (cq/rel-h 0.05) (+ 0.1 (eq/unit-sin (* 0.65 t))))]
(doseq [v (tm/norm-range 23)]
(q/begin-shape)
(apply q/curve-vertex (v/polar b (* eq/TAU v)))
(apply q/curve-vertex (v/polar (+ b (* h 0.05)) (* eq/TAU (+ v (* 0.075 (Math/sin (* 0.33 t)))))))
(apply q/curve-vertex (v/polar (* h (+ 0.5 (* 0.125 (Math/cos (* 0.9 t)))))
(* eq/TAU (+ v (* 0.09 (Math/sin (* 1.33 t)))))))
(apply q/curve-vertex (v/polar (* h 0.95) (* eq/TAU (+ v (* 0.075 (Math/sin (* 0.25 t)))))))
(apply q/curve-vertex (v/polar (* h 1.0) (* eq/TAU v)))
(q/end-shape))))

(defn page []
[:div
Expand Down

0 comments on commit 2e68a59

Please sign in to comment.