
Fluxus Live Coding Practice
1 year ago
Live coding practice 05/07/2008
Music: Mile by Trapist
(clear)
(define pw 28)
(define ph 16)
(define p (build-nurbs-sphere pw ph))
(with-primitive p
(hint-none)
(hint-solid)
(hint-wire)
(hint-anti-alias)
(wire-colour (vector 1 1 1 .5))
(pdata-add "pos" "v")
(pdata-add "norm" "v")
(pdata-copy "p" "pos")
(pdata-copy "n" "norm"))
(blend-mode 'src-alpha 'one-minus-src-alpha)
(define fft-steps 32)
(define fft-matrix (build-list (* fft-steps 16) (lambda (x) 0)))
(define (update-fft-matrix)
(let ([current (map gh (build-list 16 values))])
(set! fft-matrix (list-tail fft-matrix 16))
(set! fft-matrix (append fft-matrix current))))
(define (fft-sphere)
(update-fft-matrix)
(with-primitive p
(pdata-index-map!
(lambda (i p)
(vadd (pdata-ref "pos" i)
(vmul (pdata-ref "norm" i) (list-ref fft-matrix i))))
"p")
(recalc-normals 0)))
(every-frame (fft-sphere))
Music: Mile by Trapist
(clear)
(define pw 28)
(define ph 16)
(define p (build-nurbs-sphere pw ph))
(with-primitive p
(hint-none)
(hint-solid)
(hint-wire)
(hint-anti-alias)
(wire-colour (vector 1 1 1 .5))
(pdata-add "pos" "v")
(pdata-add "norm" "v")
(pdata-copy "p" "pos")
(pdata-copy "n" "norm"))
(blend-mode 'src-alpha 'one-minus-src-alpha)
(define fft-steps 32)
(define fft-matrix (build-list (* fft-steps 16) (lambda (x) 0)))
(define (update-fft-matrix)
(let ([current (map gh (build-list 16 values))])
(set! fft-matrix (list-tail fft-matrix 16))
(set! fft-matrix (append fft-matrix current))))
(define (fft-sphere)
(update-fft-matrix)
(with-primitive p
(pdata-index-map!
(lambda (i p)
(vadd (pdata-ref "pos" i)
(vmul (pdata-ref "norm" i) (list-ref fft-matrix i))))
"p")
(recalc-normals 0)))
(every-frame (fft-sphere))
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo

Previous Week