Last active
January 2, 2016 13:28
-
-
Save quephird/8309872 to your computer and use it in GitHub Desktop.
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 polar-vortex | |
(:use quil.core)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(defn- setup [] | |
(background 0) | |
(smooth) | |
(ellipse-mode :center) | |
(no-loop) | |
) | |
(defn- draw [] | |
(let [base-r 400 | |
base-d (* base-r 2)] | |
(translate (* base-r 1.25) (* base-r 1.25)) | |
(doseq [i (range 400)] | |
(let [b (+ 55 (rand-int 200)) | |
g (/ b 2) | |
d (* base-d (Math/exp (* i -0.01)))] | |
(fill 0 g b) | |
(ellipse 0 0 d d) | |
) | |
(translate 3 1) | |
) | |
) | |
) | |
(sketch | |
:title "polar-vortex" | |
:setup setup | |
:draw draw | |
:size [screen-w screen-h] | |
:renderer :java2d | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment