Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'Control'

  • Loading branch information...
commit d74c8a687371dd2e31982e9e4e06b4e9445ab5b7 2 parents b65a338 + d0132ea
@tedr56 authored
View
86 Tests/FingerPlay-Osc
@@ -0,0 +1,86 @@
+(page 1)
+ (pad 1)
+ Touch /fingerplay/control/0 i
+ X /fingerplay/control/1 i
+ Y /fingerplay/control/2 i
+ (pad 2)
+ Touch /fingerplay/control/3 i
+ X /fingerplay/control/4 i
+ Y /fingerplay/control/5 i
+
+(Page 2)
+ (fader 1)
+ Touch /fingerplay/control/6 i
+ Value /fingerplay/control/7 i
+ (fader 2)
+ Touch /fingerplay/control/8 i
+ Value /fingerplay/control/9 i
+ (fader 3)
+ Touch /fingerplay/control/10 i
+ Value /fingerplay/control/11 i
+ (fader 4)
+ Touch /fingerplay/control/12 i
+ Value /fingerplay/control/13 i
+ (fader 5)
+ Touch /fingerplay/control/14 i
+ Value /fingerplay/control/15 i
+ (fader 6)
+ Touch /fingerplay/control/16 i
+ Value /fingerplay/control/17 i
+ (fader 7)
+ Touch /fingerplay/control/18 i
+ Value /fingerplay/control/19 i
+
+(Page 3)
+ (fader 1)
+ Touch /fingerplay/control/40 i
+ Value /fingerplay/control/41 i
+ (fader 2)
+ Touch /fingerplay/control/42 i
+ Value /fingerplay/control/43 i
+ (fader 3)
+ Touch /fingerplay/control/44 i
+ Value /fingerplay/control/45 i
+ (fader 4)
+ Touch /fingerplay/control/46 i
+ Value /fingerplay/control/47 i
+ (fader 5)
+ Touch /fingerplay/control/48 i
+ Value /fingerplay/control/49 i
+ (fader 6)
+ Touch /fingerplay/control/50 i
+ Value /fingerplay/control/51 i
+ (fader 7)
+ Touch /fingerplay/control/52 i
+ Value /fingerplay/control/53 i
+(Page 4)
+ (Boutton-1-1)
+ Touch /fingerplay/control/30 i
+ (Boutton-2-1)
+ Touch /fingerplay/control/31 i
+ (Boutton-3-1)
+ Touch /fingerplay/control/32 i
+ (Boutton-4-1)
+ Touch /fingerplay/control/33 i
+ (Boutton-5-1)
+ Touch /fingerplay/control/34 i
+ (Boutton-1-2)
+ Touch /fingerplay/control/25 i
+ (Boutton-2-2)
+ Touch /fingerplay/control/26 i
+ (Boutton-3-2)
+ Touch /fingerplay/control/27 i
+ (Boutton-4-2)
+ Touch /fingerplay/control/28 i
+ (Boutton-5-2)
+ Touch /fingerplay/control/29 i
+ (Boutton-1-3)
+ Touch /fingerplay/control/20 i
+ (Boutton-2-3)
+ Touch /fingerplay/control/21 i
+ (Boutton-3-3)
+ Touch /fingerplay/control/22 i
+ (Boutton-4-3)
+ Touch /fingerplay/control/23 i
+ (Boutton-5-3)
+ Touch /fingerplay/control/24 i
View
34 Tests/WLI-strucure.scm
@@ -0,0 +1,34 @@
+(require scheme/math)
+(clear)
+(hint-none)
+(hint-solid)
+;(ortho)
+;(set-ortho-zoom -10)
+(clip 1 10000)
+(define c1 (build-cube))
+(define c2 (build-cube))
+(define c3 (build-cube))
+(define t 0.5)
+(define -t (* -1 t))
+(define s 4)
+(define a 40)
+(define b 37)
+
+(with-primitive c1
+ (rotate (vector a 0 0))
+ (rotate (vector 0 b 0))
+ (scale s)
+ (translate (vector t t 0))
+)
+(with-primitive c2
+ (rotate (vector a 0 0))
+ (rotate (vector 0 b 0))
+ (scale s)
+ (translate (vector -t -t 0))
+)
+(with-primitive c3
+ (rotate (vector a 0 0))
+ (rotate (vector 0 b 0))
+ (scale s)
+ (translate (vector t -t (* 2 t)))
+)
View
73 Tests/map-mask-multitexture.scm
@@ -0,0 +1,73 @@
+(clear)
+(clear-colour 0.1)
+(reset-camera)
+(define s 5)
+(define mask (with-state (scale s) (translate (vector 1 0 0)) (build-pixels 500 500 #t)))
+
+(define renderer
+ (with-state
+ (scale s)
+ (translate (vector -1 0 0))
+ (build-pixels 500 500 #t)
+ )
+)
+(define mapping
+ (with-state
+ (translate (vector 0 0 .1))
+ (scale s)
+ (multitexture 0 (pixels->texture renderer))
+ (texture-params 0
+ (list
+ 'min 'nearest
+ 'mag 'nearest
+ 'wrap-t 'clamp
+ 'wrap-s 'clamp
+ 'tex-env 'replace
+ )
+ )
+ (multitexture 1 (pixels->texture mask))
+ (texture-params 1
+ (list
+ 'min 'nearest
+ 'mag 'nearest
+ 'wrap-s 'clamp
+ 'wrap-t 'clamp
+ 'tex-env 'blend
+ )
+ )
+ (build-plane)
+ )
+)
+#(with-primitive p
+ (show (pdata-exists? "t"))
+ (pdata-map!
+ (lambda (t)
+ (vmul t 1)
+ )
+ "t"
+ )
+)
+#(with-pixels-renderer mask
+ (build-cube)
+)
+(define (map-mask)
+ (with-pixels-renderer mask
+ (with-state
+ (clear-colour #(1 1 1))
+ (colour (vector 0 0 0))
+ (rotate (vmul (vector 0 (time) (time)) 20))
+ (scale 5)
+ (draw-cube)
+ )
+ )
+ (with-pixels-renderer renderer
+ (with-state
+ (clear-colour #(0.2 0.2 0.2))
+ (rotate (vmul (vector (time) (time) 0) 20))
+ (scale 5)
+ (draw-cube)
+ )
+ )
+)
+
+(every-frame (map-mask))
View
73 Tests/multitexture-pixels.scm
@@ -0,0 +1,73 @@
+(clear)
+(clear-colour 0.1)
+(reset-camera)
+(define s 5)
+(define mask (with-state (scale s) (translate (vector 1 0 0)) (build-pixels 500 500 #t)))
+
+(define renderer
+ (with-state
+ (scale s)
+ (translate (vector -1 0 0))
+ (build-pixels 500 500 #t)
+ )
+)
+(define mapping
+ (with-state
+ (translate (vector 0 0 .1))
+ (scale s)
+ (multitexture 0 (pixels->texture renderer))
+ (texture-params 0
+ (list
+ 'min 'nearest
+ 'mag 'nearest
+ 'wrap-t 'clamp
+ 'wrap-s 'clamp
+ 'tex-env 'replace
+ )
+ )
+ (multitexture 1 (pixels->texture mask))
+ (texture-params 1
+ (list
+ 'min 'nearest
+ 'mag 'nearest
+ 'wrap-s 'clamp
+ 'wrap-t 'clamp
+ 'tex-env 'blend
+ )
+ )
+ (build-plane)
+ )
+)
+#(with-primitive p
+ (show (pdata-exists? "t"))
+ (pdata-map!
+ (lambda (t)
+ (vmul t 1)
+ )
+ "t"
+ )
+)
+#(with-pixels-renderer mask
+ (build-cube)
+)
+(define (map-mask)
+ (with-pixels-renderer mask
+ (with-state
+ (clear-colour #(1 1 1))
+ (colour (vector 0 0 0))
+ (rotate (vmul (vector 0 (time) (time)) 20))
+ (scale 5)
+ (draw-cube)
+ )
+ )
+ (with-pixels-renderer renderer
+ (with-state
+ (clear-colour #(0.2 0.2 0.2))
+ (rotate (vmul (vector (time) (time) 0) 20))
+ (scale 5)
+ (draw-cube)
+ )
+ )
+)
+
+(every-frame (map-mask))
View
34 Tests/multitexture.scm
@@ -0,0 +1,34 @@
+(clear)
+(define (make-torus a b ea eb)
+ (with-state
+ (scale 0.02)
+ (translate (vector -20 -25 10))
+ (hint-unlit)
+ (build-type "Bitstream-Vera-Sans-Mono.ttf"
+ (string-append (symbol->string ea) "/" (symbol->string eb))))
+
+ (let ((p (build-torus 1 2 20 20)))
+
+ (with-primitive p
+ (scale 0.15)
+ (multitexture 0 (load-texture a))
+ (texture-params 0 (list 'tex-env ea))
+ (multitexture 1 (load-texture b))
+ (texture-params 1 (list 'tex-env eb))
+ (pdata-copy "t" "t1")
+ (pdata-map!
+ (lambda (t1)
+ (vmul t1 5))
+ "t1"))))
+
+(for-each
+ (lambda (ea)
+ (with-state
+ (for-each
+ (lambda (eb)
+ (make-torus "refmap.png" "transp.png" ea eb)
+ (translate (vector 1 0 0)))
+ '(modulate decal blend replace)))
+ (translate (vector 0 1 0)))
+ '(modulate decal blend replace))
+
View
21 Tests/pixels-feedback-simple.scm
@@ -0,0 +1,21 @@
+(clear)
+
+(scale (vector 20 15 1))
+
+(define p (build-pixels 512 512 #t 1))
+
+(define frame 0)
+
+(every-frame
+ (let ([tex (pixels->texture p frame)])
+ (with-primitive p
+ (pixels-render-to tex)
+ (pixels-display tex))
+ (with-pixels-renderer p
+ (clear-colour 1)
+ (with-state
+ (texture tex)
+ (rotate (vector (* 60 (time)) 45 0))
+ (scale 6)
+ (draw-cube)))))
+
View
23 Tests/pixels-feedback.scm
@@ -0,0 +1,23 @@
+(clear)
+
+(scale (vector 20 15 1))
+
+(define p (build-pixels 512 512 #t 2))
+
+(define frame 0)
+
+(every-frame
+ (let ([tex (pixels->texture p frame)]
+ [ptex (pixels->texture p (bitwise-xor frame 1))])
+ (with-primitive p
+ (pixels-render-to tex)
+ (pixels-display tex))
+ (with-pixels-renderer p
+ (clear-colour 1)
+ (with-state
+ (texture ptex)
+ (rotate (vector (* 60 (time)) 45 0))
+ (scale 6)
+ (draw-cube)))
+ (set! frame (bitwise-xor frame 1))))
+
View
90 Tests/pixels.scm
@@ -0,0 +1,90 @@
+(clear)
+
+; pixels primitive with 2 textures and active renderer
+(define p (build-pixels 1024 1024 #t 2))
+(with-primitive p ; hide it
+ (scale 0))
+
+; extra camera
+(define cam1 (with-pixels-renderer p
+ (build-camera)))
+
+(with-pixels-renderer p
+ (current-camera cam1)
+ (viewport 0.5 0 0.5 1) ; use the right handside for the extra camera
+ (set-camera (mmul (mtranslate (vector 0 0 -2))
+ (mrotate (vector 0 -145 0))))
+
+ (current-camera 0) ; left handside for the default camera
+ (viewport 0 0 0.5 1))
+
+; fullscreen quad for displaying the scene
+(define fs-quad (with-state
+ (hint-unlit)
+ (scale #(20 15 1))
+ (build-plane)))
+
+; set its texture coordinates to the default camera viewport
+; in the pixel primitive
+(with-primitive fs-quad
+ (pdata-set! "t" 0 #(0 1 0))
+ (pdata-set! "t" 1 #(.5 1 0))
+ (pdata-set! "t" 2 #(.5 0 0))
+ (pdata-set! "t" 3 #(0 0 0)))
+
+; scene object
+(define c (with-pixels-renderer p
+ (build-cube)))
+
+(with-pixels-renderer p
+ (with-primitive c
+ (hint-vertcols)
+ (pdata-map! (lambda (c) (rndvec)) "c")))
+
+; camera display
+(define tv (with-pixels-renderer p
+ (hint-unlit)
+ (build-plane)))
+
+(with-pixels-renderer p
+ (with-primitive tv
+ (hint-wire)
+ (hide 1)
+ (camera-hide 0) ; show only in the default camera
+ (rotate #(0 35 0))
+ (translate #(0 0 -5))
+ (scale #(6 8 1))
+
+ ; set texture coords to the extra camera viewport
+ (pdata-set! "t" 0 #(.5 1 0))
+ (pdata-set! "t" 1 #(1 1 0))
+ (pdata-set! "t" 2 #(1 0 0))
+ (pdata-set! "t" 3 #(.5 0 0))))
+
+; frame count to ping-pong render target
+(define frame-count 0)
+
+
+(every-frame
+ (let ([tex (pixels->texture p (remainder frame-count 2))]
+ [ptex (pixels->texture p (remainder (+ frame-count 1) 2))])
+
+ ; set render targets and display texture for the pixel primitive
+ (with-primitive p
+ (pixels-render-to tex)
+ (pixels-display tex))
+
+ ; fullscreen quad texture
+ (with-primitive fs-quad
+ (texture tex))
+
+ (with-pixels-renderer p
+ ; rotate the cube
+ (with-primitive c
+ (identity)
+ (rotate (vector (* 40 (time)) 35 0)))
+ ; camera display texture
+ (with-primitive tv
+ (texture ptex)))
+
+ (set! frame-count (+ frame-count 1))))
View
33 Tests/pixelsFFGL.scm
@@ -0,0 +1,33 @@
+;; example of using an ffgl plugin on a pixel primitive
+
+(clear)
+
+(scale #(20 15 1))
+
+; pixel primitive with 2 textures and an active renderer
+(define p (build-pixels 512 512 #t 2))
+
+(define plugin (ffgl-load "cibloom" 512 512))
+
+(with-ffgl plugin
+ (ffgl-process p ; output pixel primitive
+ (pixels->texture p 1) ; output texture of the pixel primitive
+ (pixels->texture p 0) ; input texture
+ ))
+
+(with-primitive p
+ ; the renderer of the pixels primitive renders to texture index 0
+ (pixels-render-to (pixels->texture p 0))
+ ; the primitive is displayed using texture index 1, the output texture
+ ; of the ffgl plugin
+ (pixels-display (pixels->texture p 1)))
+
+(define (anim)
+ (with-pixels-renderer p
+ (with-state
+ (clear-colour 0)
+ (scale 5)
+ (rotate (vector (* 50 (time)) -17 (* -35 (time))))
+ (draw-cube))))
+
+(every-frame (anim))
Please sign in to comment.
Something went wrong with that request. Please try again.