Skip to content

Instantly share code, notes, and snippets.

@PGGB
Created November 27, 2012 22:00
Show Gist options
  • Save PGGB/4157429 to your computer and use it in GitHub Desktop.
Save PGGB/4157429 to your computer and use it in GitHub Desktop.
noise 2d in quil
(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