git commit --all
This commit is contained in:
parent
f76fee2121
commit
fa90185e31
4 changed files with 79 additions and 9 deletions
|
|
@ -19,6 +19,6 @@ in pkgs.mkShell rec {
|
||||||
# we need to make sure the library is on the path for JOGL;
|
# we need to make sure the library is on the path for JOGL;
|
||||||
# also, there's a bug that is avoided with the variable
|
# also, there's a bug that is avoided with the variable
|
||||||
# https://github.com/processing/processing/issues/5476
|
# https://github.com/processing/processing/issues/5476
|
||||||
JAVA_OPTS = "-Djava.library.path=${lib.makeLibraryPath buildInputs}";
|
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"
|
# LIBGL_ALWAYS_SOFTWARE = true; # ← this is the same as passing -Djogl.disable.openglcore="true"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@
|
||||||
state)
|
state)
|
||||||
|
|
||||||
(def canvas
|
(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))))
|
(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]
|
(defn draw-tile [[x y] tile-type]
|
||||||
(let [start (case tile-type
|
(let [start (case tile-type
|
||||||
|
|
@ -46,15 +46,11 @@
|
||||||
(* 0.0000033 y (q/millis)))]]
|
(* 0.0000033 y (q/millis)))]]
|
||||||
(draw-tile [x y] (pick-at [:a :b] n))))
|
(draw-tile [x y] (pick-at [:a :b] n))))
|
||||||
|
|
||||||
(g/scale bounds 0.92)
|
|
||||||
|
|
||||||
(g/scale (:size bounds) 0.92)
|
|
||||||
|
|
||||||
#_:clj-kondo/ignore
|
#_:clj-kondo/ignore
|
||||||
(q/defsketch twenty-one
|
(q/defsketch twenty-one
|
||||||
:title "Twenty-One"
|
:title "Twenty-One"
|
||||||
:size (:size bounds)
|
:size (:size bounds)
|
||||||
:Settings #(q/pixel-density (q/display-density))
|
:settings #(q/pixel-density (q/display-density))
|
||||||
:setup setup
|
:setup setup
|
||||||
:update update-state
|
:update update-state
|
||||||
:draw draw-state
|
:draw draw-state
|
||||||
|
|
|
||||||
40
src/aphorisms/twenty-three.clj
Normal file
40
src/aphorisms/twenty-three.clj
Normal file
|
|
@ -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])
|
||||||
34
src/aphorisms/twenty-two.clj
Normal file
34
src/aphorisms/twenty-two.clj
Normal file
|
|
@ -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])
|
||||||
Loading…
Add table
Add a link
Reference in a new issue