Last active
December 23, 2015 16:49
-
-
Save jackrusher/6664422 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
(defn setup [] | |
(frame-rate 4) | |
(no-fill) | |
(stroke 0 0 0 128) | |
(smooth)) | |
(def rotor (atom 0)) | |
(defn draw [] | |
(frame-rate 30) | |
(background 230) | |
(stroke 29 0 16 128) | |
(translate 300 300) | |
(swap! rotor inc) | |
(rotate (radians @rotor)) | |
(doseq [i (range 0 360 0.5)] | |
(push-matrix) | |
(rotate (radians i)) | |
(translate 0 200) | |
(rotate (radians (+ 3 i))) | |
(scale (map-range (sin (radians (* i 6))) -1 1 0.35 1) | |
(map-range (sin (radians (* i 3))) -1 1 0.7 1)) | |
(ellipse 0 0 120 80) | |
(pop-matrix))) | |
(defsketch toro-toro-torus | |
:title "fun with toroids" | |
:setup setup | |
:draw draw | |
:size [600 600]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment