Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0e94a58865
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (35 sloc) 1.012 kb
(ns example2
(:use [processing.core]
;; here's a function which will be called by Processing's (PApplet)
;; draw method every frame. Place your code here. If you eval it
;; interactively, you can redefine it while the applet is running and
;; see effects immediately
(defn draw
"Example usage of with-translation and with-rotation."
(background-float 125)
(stroke-float 10)
(fill-float (rand-int 125) (rand-int 125) (rand-int 125))
(with-translation [(/ 200 2) (/ 200 2)]
(with-rotation [QUARTER-PI]
(vertex -50 50)
(vertex 50 50)
(vertex 50 -50)
(vertex -50 -50)
(end-shape :close)))
(display-filter :invert))
(defn setup []
"Runs once."
(fill 226)
(frame-rate 10))
;; Now we just need to define an applet:
(defapplet example2
:title "An example."
:setup setup
:draw draw
:size [200 200])
(applet-start example2)
Jump to Line
Something went wrong with that request. Please try again.