[Fluxus] delay

Kassen signal.automatique at gmail.com
Tue Jul 12 02:08:50 PDT 2011


Here is my take on it all, clearly all of this can be done in many ways....

(clear)
(define s (time))
(define ds 0.001)
(define max-spheres 170)
(define num 0)


(define core (build-locator))

(define (animate)
    ;get rid of it all when we reach the max and start over
    (when (> num max-spheres)
        (for-each (lambda (x) (destroy x)) (with-primitive core
(get-children)))
        (set! s (time))
        (set! ds 0.001)
        (set! num 0))
    ;add spheres at a increasingly slow pace
    (when (> (- (time) s) ds)
        (set! s (time))
        (set! ds (* 1.05 ds))
        (set! num (+ num 1))
        (with-state
            (parent core)
                (translate (vector 0 (* 2 (grndf)) (* 2 (grndf))))
                (colour (vector (* (sin (time))  (/ num 100)) (/ num 100)
 num))
                (scale .1)
                (build-sphere 5 5)))
    ;rotate the whole thing every frame, with slowdown
    (with-primitive core
        (rotate (vector 0 (* (/ 5 ds) (delta)) 0 ))))

(every-frame (animate))

I tried to keep it as simple as possible, but I did need one "anonymous
function" (the lambda thing). If there are parts you don't get and that
don't get mentioned in the fluxus help then this is a good resource;
http://docs.racket-lang.org/reference/
Aside from that I do think that for more persistent shapes "building" makes
more sense than "drawing", but the downside is that you do indeed need a way
to get rid of what you build again. It's probably a matter of taste.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20110712/5eb8df85/attachment-0001.html>


More information about the Fluxus mailing list