Skip to content
Browse files

Adjustments to use latest defapplet.

  • Loading branch information...
1 parent a5f5e88 commit ce0968394844e28f8052f9f844b65c82bda5a9ec @technomancy committed
Showing with 33 additions and 27 deletions.
  1. +17 −3 README.md
  2. +3 −3 project.clj
  3. +4 −10 src/sketchbook/chu.clj
  4. +5 −7 src/sketchbook/myu.clj
  5. +4 −4 src/sketchbook/pop.clj
View
20 README.md
@@ -17,10 +17,24 @@ To install corkscrew, see http://github.com/technomancy/corkscrew
## Sketches
-Pop, or "Synthpop-inspired Jams": http://github.com/technomancy/sketchbook/blob/master/src/sketchbook/pop.clj
+### Pop
-Myu, or "Something vaguely Birdlike": http://github.com/technomancy/sketchbook/blob/master/src/sketchbook/myu.clj
+or "Synthpop-inspired Jams"
+2009-08-27
-Chu or ""That Thing I Always Used to Draw in Math Class": http://github.com/technomancy/sketchbook/blob/master/src/sketchbook/chu.clj
+http://github.com/technomancy/sketchbook/blob/master/src/sketchbook/pop.clj
+
+### Myu
+
+or "Something vaguely Birdlike"
+2009-08-29
+http://github.com/technomancy/sketchbook/blob/master/src/sketchbook/myu.clj
+
+### Chu
+
+or "That Thing I Always Used to Draw in Math Class"
+2009-08-30
+
+http://github.com/technomancy/sketchbook/blob/master/src/sketchbook/chu.clj
Copyright (c) 2009 Phil Hagelberg; see file COPYING for details.
View
6 project.clj
@@ -1,8 +1,8 @@
-{:name "sketchbook"
+{:name "sketchbook"
:version "1.0.0-SNAPSHOT"
- :namespaces '(nom.nom.nom)
+ :main sketchbook.menu
:dependencies [["clojure" "1.0.0" "org.clojure"]
["clojure-contrib" "1.0-SNAPSHOT" "org.clojure"]
["processing.core" "1.0.6" "org.processing"]]
- :source-dependencies [["clj-processing" "master"
+ :source-dependencies [["clj-processing" "applet"
:git "git://github.com/technomancy/clj-processing.git"]]}
View
14 src/sketchbook/chu.clj
@@ -4,12 +4,6 @@
(def step 10)
-(defn height []
- (.getHeight *applet*))
-
-(defn width []
- (.getWidth *applet*))
-
(defn chu-curve [n]
(line n 0 0 (- (height) n))
(if (< n (height))
@@ -25,8 +19,8 @@
(with-rotation [PI]
(chu-curve 0))))
-(defapplet chu "That Thing I Always Used to Draw in Math Class"
- setup #() 512 512)
+(defapplet chu :title "That Thing I Always Used to Draw in Math Class"
+ :setup setup :width 512 :height 512)
-;; (run-chu)
-;; (stop-chu)
+;; (run chu)
+;; (stop chu)
View
12 src/sketchbook/myu.clj
@@ -2,8 +2,6 @@
(:use [rosado.processing]
[rosado.processing.applet]))
-(defn frame-count [] (.frameCount *applet*))
-
;; TODO: calculate position as a function of frame-count instead of by mutation
(def vortex (atom [0 0]))
(def vortex-size 20)
@@ -33,14 +31,14 @@
(background-float 0)
(smooth)
(no-stroke)
- (framerate 10))
+ (framerate 40))
(defn draw []
(move!)
(draw-vortex (* 150 (/ (+ (sine-frame) 1) 2))))
-(defapplet myu "Something vaguely Birdlike"
- setup draw 800 600)
+(defapplet myu :title "Something vaguely Birdlike"
+ :setup setup :draw draw :width 800 :height 600)
-;; (run-myu)
-;; (stop-myu)
+;; (run myu)
+;; (stop myu)
View
8 src/sketchbook/pop.clj
@@ -22,9 +22,9 @@
(reset! x 0)
(swap! y #(mod (inc %) 5))))
-(defapplet pop "Synthpop-inspired Jams"
- setup draw 510 510)
+(defapplet pop :title "Synthpop-inspired Jams"
+ :setup setup :draw draw :width 510 :height 510)
;; To make things go:
-;; (run-pop)
-;; (stop-pop)
+;; (run pop)
+;; (stop pop)

0 comments on commit ce09683

Please sign in to comment.
Something went wrong with that request. Please try again.