Skip to content

Commit

Permalink
scale the circles by the distance traveled
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Aug 12, 2024
1 parent d0ec2f0 commit 498d32a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/shimmers/sketches/ley_lines.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(fn [[p v]]
(let [noise (dr/noise-at-point-01 seed scale p)
str (dr/noise-at-point-01 seed2 scale p)
v' (tm/* (tm/+ v (v/polar (/ (+ 0.5 str) 10) (* noise eq/TAU))) 0.85)]
v' (tm/* (tm/+ v (v/polar (/ (+ 0.5 str) 8) (* noise eq/TAU))) 0.85)]
[(tm/+ p v) v'])))
(take (lifespan))
(take-while (fn [[p _v]] (g/contains-point? bounds p)))
Expand All @@ -37,11 +37,13 @@
(csvg/group {}
(csvg/path (csvg/segmented-path path)
{:stroke-width 0.5})
(let [stops (dr/gaussian-range 0.125 0.05)]
(map (fn [t] (gc/circle (g/point-at (gl/linestrip2 path) t) 1.5)) stops)))))))
(let [stops (dr/gaussian-range 0.15 0.05)
r (tm/clamp (/ (g/dist (first path) (last path)) (* 8 (count stops)))
0.5 3.0)]
(map (fn [t] (gc/circle (g/point-at (gl/linestrip2 path) t) r)) stops)))))))

(defn shapes [bounds]
(let [start (fn [] (rp/sample-point-inside (gc/circle (rv 0.5 0.5) (* 0.4 height))))
(let [start (fn [] (rp/sample-point-inside (gc/circle (rv 0.5 0.5) (* 0.38 height))))
scale 0.00125
seed (dr/noise-seed)
lifespan (fn [] (int (dr/gaussian 128 48)))]
Expand Down

0 comments on commit 498d32a

Please sign in to comment.