From 0f4e8e82761f4e8e1e837918dd6189e1d30c4716 Mon Sep 17 00:00:00 2001 From: Charles Comstock Date: Sat, 16 Sep 2023 00:47:07 -0500 Subject: [PATCH] Plot forward a tenth of a second instead of redrawing background --- src/shimmers/sketches/kinetic_elliptics.cljs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/shimmers/sketches/kinetic_elliptics.cljs b/src/shimmers/sketches/kinetic_elliptics.cljs index 9a4ef0bc4..c913edc15 100644 --- a/src/shimmers/sketches/kinetic_elliptics.cljs +++ b/src/shimmers/sketches/kinetic_elliptics.cljs @@ -66,16 +66,19 @@ (assoc state :t (/ (q/millis) 1000.0))) (defn draw [{:keys [origin root t]}] - (q/background 1.0 0.25) + (q/background 1.0 1.0) (q/no-stroke) (q/fill 0.0 1.0) (cq/circle origin 2.0) - (doseq [[parent element color] (plot-elements origin root t)] - (q/no-stroke) - (cq/circle element 2.0) - (q/stroke-weight 2.0) - (apply q/stroke color) - (q/line parent element))) + (doseq [group (apply map vector + (map (partial plot-elements origin root) + (map + (range 0.0 0.1 (/ 0.1 4)) (repeat t))))] + (doseq [[parent element color] group] + (q/no-stroke) + (cq/circle element 2.0) + (q/stroke-weight 2.0) + (apply q/stroke color) + (q/line parent element)))) (defn page [] [sketch/with-explanation