diff --git a/cubes/project.clj b/cubes/project.clj index 1abeca5..9788fc2 100644 --- a/cubes/project.clj +++ b/cubes/project.clj @@ -4,4 +4,5 @@ :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.10.1"] - [quil "4.0.0-SNAPSHOT"]]) + [quil "3.1.0"]]) + ;[quil "4.0.0-SNAPSHOT"]]) diff --git a/cubes/src/cubes/core.clj b/cubes/src/cubes/core.clj index 2b290fe..beef046 100644 --- a/cubes/src/cubes/core.clj +++ b/cubes/src/cubes/core.clj @@ -23,6 +23,7 @@ :angle (+ (:angle state) 0.1)}) (def w 50) +(def h 200) (def offset (atom 0)) (defn draw-state [state] @@ -35,14 +36,15 @@ (let [angle (:angle state) sin (q/sin (+ angle @offset)) cos (q/cos angle) - h (q/map-range sin -1 1 10 w)] - (q/rect (- (/ (q/width) 2) i) 0 (- w 2) h) - (swap! offset + 0.5))))) + h (q/map-range sin -1 1 20 h)] + (q/rect (- (/ w 2) (- (/ (q/width) 2) i)) 0 (- w 2) h) + (swap! offset + 1.5))))) (q/defsketch cubes :title "You spin my circle right round" :size [500 500] ; setup function called only once, during sketch initialization. + ; :renderer :opengl :setup setup :settings settings ; update-state is called on each iteration before draw-state.