Skip to content

Commit

Permalink
some changes to the phase-amp
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Nov 22, 2024
1 parent 7928ad2 commit adcea5d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/shimmers/sketches/cilia_phase.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
3.0 1.0 4.0 0.5 5.0 0.25}))

(defn gen-amp []
(dr/weighted {0.10 1.0 0.15 1.0
0.20 1.0 0.25 1.0
(dr/weighted {0.05 1.0
0.10 1.0 0.15 2.0
0.20 2.0 0.25 2.0
0.30 1.0 0.35 1.0
0.40 1.0
0.50 1.0}))
Expand All @@ -48,8 +49,8 @@
(fn spline-fx
([x] (spline-fx 0 x))
([phase x]
(let [phase-mod (math/cos (* eq/TAU (+ (* dr x) dc phase)))]
(* amplitude (math/sin (* eq/TAU (+ (* r x) c (* phase-amp phase-mod))))))))}))
(let [phase-mod (* phase-amp (math/cos (* eq/TAU (+ (* dr x) dc phase))))]
(* amplitude (math/sin (* eq/TAU (+ (* r x) c phase-mod)))))))}))

(defn screen-space [y amp fx x phase]
(rv x (+ y (* amp (fx (+ x phase))))))
Expand Down

0 comments on commit adcea5d

Please sign in to comment.