Skip to content

Commit

Permalink
add some more modulation on the curvature
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Jun 3, 2024
1 parent f998082 commit a77157d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/shimmers/sketches/stretch_curves.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@
(let [N 256
center (cq/rel-vec 0.5 0.5)
t (+ (* 2.5 time) (* 1.5 (math/sin (+ (* 0.35 time) (* 2 (math/sin (* 0.4 time)))))))
d (+ 0.05 (* 0.2 (eq/unit-sin t)))]
d (+ 0.05 (* 0.2 (eq/unit-sin t)))
d2 (+ 0.5 (* 0.4 (math/sin (+ (* 0.3 t) (math/sin (* 0.4 t))))))]
(dotimes [i N]
(let [a (mod (/ (- i (* 0.070 t) (* 0.15 N (math/sin (+ (* w0 i) (* 0.25 t) p0))))
(float N)) 1.0)
b (- 1.0 (mod (/ (+ i (* 0.011 t) (* 0.25 N (math/sin (- (* w1 i) (* 0.35 t) p1))))
(float N)) 1.0))
[px py] (g/point-at outline a)
[qx qy] (g/point-at outline b)
[rx ry] (tm/mix center (g/point-at outline (sm/mix-mod a b d)) 0.66)
[sx sy] (tm/mix center (g/point-at outline (sm/mix-mod a b (- 1.0 d))) 0.66)]
[rx ry] (tm/mix center (g/point-at outline (sm/mix-mod a b d)) d2)
[sx sy] (tm/mix center (g/point-at outline (sm/mix-mod a b (- 1.0 d))) d2)]
(q/bezier px py rx ry sx sy qx qy)))))

(defn page []
Expand Down

0 comments on commit a77157d

Please sign in to comment.