Skip to content

Commit

Permalink
add some pincushion outward from center
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Jul 31, 2024
1 parent ee7ad51 commit 6c57a9f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/shimmers/sketches/designed_imperfections.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
(gv/vec2 (* width x) (* height y)))

(defn shapes []
(let [seed (dr/noise-seed)]
(let [seed (dr/noise-seed)
center (rv 0.5 0.5)]
(->> (for [box (g/subdivide (csvg/screen width height)
{:cols (/ width 6) :rows (/ height 6)})]
(let [pos (g/centroid box)
n (dr/noise-at-point seed 0.008 pos)
damp (/ 1.0 (Math/pow 1.006 (g/dist pos (rv 0.5 0.5))))]
damp (/ 1.0 (Math/pow 1.006 (g/dist pos center)))]
(gc/circle (tm/+ pos
(v/polar (* 10.0 damp) (* eq/TAU n)))
(tm/+ (v/polar (* 10.0 damp) (* eq/TAU n))
(v/polar (* 20.0 (- 1.0 damp)) (g/heading (tm/- pos center)))))
(+ 2.0 (* 0.8 damp (math/sin (* eq/TAU (- 1.0 n))))))))
(dr/map-random-sample (fn [{:keys [r]}] (/ r 200.0))
(fn [{:keys [p r]}] (g/center (rect/rect (* 1.9 r)) p))))))
Expand Down

0 comments on commit 6c57a9f

Please sign in to comment.