can't do 3d

main
Anish Lakhwara 2023-01-03 18:47:47 +10:00
parent 26dade3b0f
commit a0f8179cfe
2 changed files with 7 additions and 4 deletions

View File

@ -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"]])

View File

@ -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.