Created
November 27, 2012 22:00
-
-
Save PGGB/4157429 to your computer and use it in GitHub Desktop.
noise 2d in quil
This file contains 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 noc.core | |
(:use quil.core)) | |
(defn setup [] | |
(background 255) | |
(no-loop)) | |
(defn draw [] | |
(load-pixels) | |
(doseq [x (range 0 (width)) | |
y (range 0 (height))] | |
(let [bright (map-range (noise (* x 0.05) (* y 0.05)) 0 1 0 255)] | |
(aset-int (pixels) (+ x (* y (width))) (color bright)))) | |
(update-pixels)) | |
(defsketch noc | |
:setup setup | |
:draw draw | |
:size [640 320] | |
:renderer :p2d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment