Skip to content

Commit

Permalink
more tweaks to static
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Feb 19, 2024
1 parent 13b0ed2 commit 4e78087
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/shimmers/sketches/display_tree.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
center (g/centroid bounds)
mode (dr/weighted {:static 1.0
:sweep 2.0
:radial 2.0})
:radial 10.0})
dir (dr/rand-nth [-1 1])
divisions
(for [div (g/subdivide bounds {:cols cols :rows rows})
Expand All @@ -256,10 +256,13 @@
(let [v (dr/random)]
(fn [t _f] (mod (+ (* dir t) v) 1.0)))
:radial
(fn [t f] (eq/unit-sin (+ r (* 2 (* dir t)) f)))
(let [factor (Math/pow 2.0 (dr/weighted {0 10
6 4
7 3}))]
(fn [t _f] (eq/unit-sin (+ (/ r factor) (* 2 (* dir t))))))
:sweep
(let [blades (dr/random-int 4)]
(fn [t f] (eq/unit-sin (+ (+ (* Math/PI blades) theta) (* dir t) f)))))))]
(fn [t _f] (eq/unit-sin (+ (+ blades theta) (* dir t))))))))]
(fn [p rotation t f]
(doseq [{:keys [value] :as div} divisions]
(q/fill (value t f))
Expand Down

0 comments on commit 4e78087

Please sign in to comment.