diff --git a/.gitignore b/.gitignore
index 739a290..88e0753 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
lib/*
target/*
+*.class
diff --git a/PolarUnravel.scm b/PolarUnravel.scm
index e0cd89e..0ff8a71 100644
--- a/PolarUnravel.scm
+++ b/PolarUnravel.scm
@@ -1,13 +1,7 @@
;; compare with the original from ToxicLibs at http://toxiclibs.org/
-;; note this is not good scheme code :D follows too many processing and java structures
-;; and unlearned voodoo
(require 'list-lib)
-;(define Map map) ; note that Processing's map conflicts, but not used here anyway
-
-
-;; execute with: ./prokawa-toxi.sh -f ./PolarUnravel.scm
(define-simple-class PolarUnravel (processing.core.PApplet)
(transition :: java.lang.Float init-value: (make java.lang.Float 0.0) )
@@ -16,7 +10,8 @@
(col :: toxi.color.TColor )
(normUp :: toxi.geom.Vec2D )
((setup)
- (size 680 382 codeanticode.glgraphics.GLConstants:GLGRAPHICS)
+ (size screenWidth screenHeight codeanticode.glgraphics.GLConstants:GLGRAPHICS)
+ (smooth)
)
((draw)
(background 255)
@@ -26,34 +21,34 @@
(set! transition (+ transition (* (- transTarget transition ) 0.01) ) )
(set! col (toxi.color.TColor:newHSV 0 1 1))
(set! normUp (make toxi.geom.Vec2D 0 -1))
- (for-each (lambda (i :: gnu.math.IntNum )
- (let* ((theta (radians i)))
- (let* ((polar (make toxi.geom.Vec2D 100 theta)))
- (col:setHue (modulo (/ (*:.y polar) TWO_PI) 1) )
- (let* ((len (* (noise (* (*:.y polar) 4)) 100 )))
- (let* ((circ ((polar:copy):toCartesian)))
- (let* ((linear (make toxi.geom.Vec2D
- (+ (/ (* (-
- toxi.math.MathUtils:THREE_HALVES_PI
- (*:.y polar)
- ) ww ) PI ) ww )
- 0) ))
- (let* ((dir (circ:getNormalized)))
- (circ:interpolateToSelf linear transition is)
- ((dir:interpolateToSelf normUp transition is):normalizeTo len)
- (stroke (col:toARGB))
- (line (*:.x circ) (*:.y circ) (+ (*:.x circ) (*:.x dir)) (+ (*:.y circ) (*:.y dir)) )
- ) ) ) ) ) ) )
+ (for-each
+ (lambda (i :: gnu.math.IntNum )
+ (let* ((theta (radians i)))
+ (let* ((polar (make toxi.geom.Vec2D 100 theta)))
+ (col:setHue (modulo (/ (*:.y polar) TWO_PI) 1) )
+ (let* ((len (* (noise (* (*:.y polar) 4)) 100 )))
+ (let* ((circ ((polar:copy):toCartesian)))
+ (let* ((linear (make toxi.geom.Vec2D
+ (+ (/ (* (- toxi.math.MathUtils:THREE_HALVES_PI
+ (*:.y polar)
+ ) ww ) PI ) ww)
+ 0) ))
+ (let* ((dir (circ:getNormalized)))
+ (circ:interpolateToSelf linear transition is)
+ ((dir:interpolateToSelf normUp transition is):normalizeTo len)
+ (stroke (col:toARGB))
+ (line (*:.x circ) (*:.y circ) (+ (*:.x circ) (*:.x dir)) (+ (*:.y circ) (*:.y dir)) )
+ )))))))
(iota 180 270 2)
)
- ) )
+ ))
)
((mousePressed)
- (set! transTarget (+ transTarget 1))
- (set! transTarget (modulo transTarget 2))
+ (set! transTarget (modulo (+ transTarget 1) 2) )
)
+)
- )
+(define p (PolarUnravel) )
+(PolarUnravel:runSketch (make String[] "--present" "PolarUnravel") p)
-(processing.core.PApplet:main (make String[] "--present" "PolarUnravel"))
diff --git a/PolarUnravel.sh b/PolarUnravel.sh
new file mode 100755
index 0000000..6689dd2
--- /dev/null
+++ b/PolarUnravel.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+./prokawa-toxi.sh --main -T go --module-static -C ./PolarUnravel.scm
+
+export J=java
+export CLASSPATH=./:./lib/toxiclibs/dist/colorutils.jar:./lib/toxiclibs/dist/toxiclibscore.jar:./target/prokawa-1.0-SNAPSHOT-jar-with-dependencies.jar:
+export LIBPATH=/home/thomas/processing-1.5/modes/java/libraries/opengl/library/linux32/
+
+$J -cp $CLASSPATH -Djava.library.path=$LIBPATH go
diff --git a/pom.xml b/pom.xml
index 2c3eea7..f2870d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,6 +14,11 @@
3.8.1
test
+
+ javax.servlet
+ servlet-api
+ 2.5
+
org.gnu
kawa