Here is my take on it all, clearly all of this can be done in many ways....<div><br></div><div><div>(clear)</div><div>(define s (time))</div><div>(define ds 0.001)</div><div>(define max-spheres 170)</div><div>(define num 0)</div>
<div><br></div><div><br></div><div>(define core (build-locator))</div><div><br></div><div>(define (animate)</div><div>    ;get rid of it all when we reach the max and start over</div><div>    (when (> num max-spheres)</div>
<div>        (for-each (lambda (x) (destroy x)) (with-primitive core (get-children)))</div><div>        (set! s (time))</div><div>        (set! ds 0.001)</div><div>        (set! num 0))</div><div>    ;add spheres at a increasingly slow pace</div>
<div>    (when (> (- (time) s) ds)</div><div>        (set! s (time))</div><div>        (set! ds (* 1.05 ds))</div><div>        (set! num (+ num 1))</div><div>        (with-state</div><div>            (parent core)</div>
<div>                (translate (vector 0 (* 2 (grndf)) (* 2 (grndf))))</div><div>                (colour (vector (* (sin (time))  (/ num 100)) (/ num 100)  num))</div><div>                (scale .1)</div><div>                (build-sphere 5 5)))</div>
<div>    ;rotate the whole thing every frame, with slowdown</div><div>    (with-primitive core</div><div>        (rotate (vector 0 (* (/ 5 ds) (delta)) 0 ))))</div><div><br></div><div>(every-frame (animate))</div></div><div>
<br></div><div>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; <a href="http://docs.racket-lang.org/reference/">http://docs.racket-lang.org/reference/</a></div>
<div>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.</div>
<div><br></div><div>Yours,</div><div>Kas.</div><meta http-equiv="content-type" content="text/html; charset=utf-8">