diff --git a/shell.nix b/shell.nix index 2ed3db0..8296393 100644 --- a/shell.nix +++ b/shell.nix @@ -19,6 +19,6 @@ in pkgs.mkShell rec { # we need to make sure the library is on the path for JOGL; # also, there's a bug that is avoided with the variable # https://github.com/processing/processing/issues/5476 - JAVA_OPTS = "-Djava.library.path=${lib.makeLibraryPath buildInputs}"; - LIBGL_ALWAYS_SOFTWARE = true; # ← this is the same as passing -Djogl.disable.openglcore="true" + JAVA_OPTS = "-Djava.library.path=${lib.makeLibraryPath buildInputs} -Djogl.disable.openglcore=true"; + # LIBGL_ALWAYS_SOFTWARE = true; # ← this is the same as passing -Djogl.disable.openglcore="true" } diff --git a/src/aphorisms/twenty-one.clj b/src/aphorisms/twenty-one.clj index 769c650..4657af7 100644 --- a/src/aphorisms/twenty-one.clj +++ b/src/aphorisms/twenty-one.clj @@ -20,10 +20,10 @@ state) (def canvas - (as-> (g/scale bounds 0.92) b + (as-> (g/scale bounds 0.8) b (g/translate b (m/* (m/- (:size bounds) (:size b)) 0.5)))) -(def tile-size 10) +(def tile-size 20) (defn draw-tile [[x y] tile-type] (let [start (case tile-type @@ -46,15 +46,11 @@ (* 0.0000033 y (q/millis)))]] (draw-tile [x y] (pick-at [:a :b] n)))) -(g/scale bounds 0.92) - -(g/scale (:size bounds) 0.92) - #_:clj-kondo/ignore (q/defsketch twenty-one :title "Twenty-One" :size (:size bounds) - :Settings #(q/pixel-density (q/display-density)) + :settings #(q/pixel-density (q/display-density)) :setup setup :update update-state :draw draw-state diff --git a/src/aphorisms/twenty-three.clj b/src/aphorisms/twenty-three.clj new file mode 100644 index 0000000..e7797c3 --- /dev/null +++ b/src/aphorisms/twenty-three.clj @@ -0,0 +1,40 @@ +(ns aphorisms.twenty-three + (:require [quil.core :as q] + [quil.middleware :as qm] + [thi.ng.geom.rect :as r] + [thi.ng.geom.core :as g] + [thi.ng.math.core :as m])) + +;; I'm in bed. It is 9th of October, the temperatures are mild, the sund is +;; shining and my girlfriend is reading me texts about the physical appearance +;; of angels. + +(def bounds (r/rect 500 500)) + +(defn setup [] + (q/frame-rate 30) + (q/ellipse-mode :center) + (q/color-mode :hsb 360 100 100) + {:n 1}) + +(defn update-state [_] + {:n (inc (q/seconds))}) + +(defn draw-state [{n :n}] + (q/with-translation (g/centroid bounds) + (q/background 0 0 95) + (q/no-fill) + (dotimes [i n] + (q/with-rotation [(m/radians (* i 6))] + (q/stroke (mod (+ 170 (* i 3)) 360) 80 100 90) + (q/ellipse 0 (* i 2) 16 (+ (* i 10) 100)))))) + +#_:clj-kondo/ignore +(q/defsketch twenty-three + :title "Twenty-Three" + :size (:size bounds) + :settings #(q/pixel-density (q/display-density)) + :setup setup + :update update-state + :draw draw-state + :middleware [qm/pause-on-error qm/fun-mode]) diff --git a/src/aphorisms/twenty-two.clj b/src/aphorisms/twenty-two.clj new file mode 100644 index 0000000..ff02024 --- /dev/null +++ b/src/aphorisms/twenty-two.clj @@ -0,0 +1,34 @@ +(ns aphorisms.twenty-two + (:require [quil.core :as q] + [quil.middleware :as qm] + [thi.ng.geom.rect :as r] + [thi.ng.geom.core :as g] + [thi.ng.math.core :as m])) + +(def bounds (r/rect 500 500)) + +(defn setup [] + (q/frame-rate 30) + (q/ellipse-mode :center) + (q/color-mode :hsb 360 100 100) + {}) + +(defn update-state [state] + state) + +(defn draw-state [_] + (q/background 0 0 95) + (q/fill 0 0 70) + (q/blend-mode :difference) + (q/rect 0 0 100 100) + (q/rect 10 10 100 100)) + +#_:clj-kondo/ignore +(q/defsketch twenty-two + :title "Twenty-Two" + :size (:size bounds) + :settings #(q/pixel-density (q/display-density)) + :setup setup + :update update-state + :draw draw-state + :middleware [qm/pause-on-error qm/fun-mode])