Created
February 28, 2014 01:20
-
-
Save quephird/9263324 to your computer and use it in GitHub Desktop.
Another ripoff, this time from http://myartexperiments.tumblr.com/post/77829369916/sea-breeze
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns fun-with-quil.sea-breeze | |
| (:use quil.core)) | |
| (def dθ (atom 0)) | |
| (defn setup [] | |
| (background 0) | |
| (ellipse-mode :center) | |
| (no-stroke) | |
| (smooth)) | |
| (defn draw [] | |
| (let [d 20 | |
| r (/ d 2) | |
| rows (/ (height) d) | |
| cols (/ (width) d)] | |
| (translate r r) | |
| (doseq [row (range rows) col (range cols)] | |
| (push-matrix) | |
| (translate (* col d) (* row d)) | |
| (rotate (radians (* 180 (sin (radians (+ @dθ (* row col))))))) | |
| (fill 127 255 127) | |
| (ellipse 0 0 d d) | |
| (fill 127 127 0) | |
| (arc 0 0 d d 0 (radians 180)) | |
| (pop-matrix))) | |
| (swap! dθ + 5)) | |
| (sketch | |
| :title "sea breeze" | |
| :setup setup | |
| :draw draw | |
| :size [600 400] | |
| :renderer :java2d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment