[Fluxus] problem from mexico

gabor papp gabor.lists at mndl.hu
Sun Apr 12 12:07:43 PDT 2009


> Last night I started with some tutorials and when I run the example of
> recursion
> (define (draw-row count)
>        (cond
>                ((not (zero? count))
>                       (draw-cube)
>                       (translate (vector 1.1 0 0))
>                       (draw-row (- count 1)))))
> (every-frame (draw-row 10))
> 
> and nothing happens, I can't  see a row of 10 cubes.
the translate's get accumulated during the successive frames.
try this:

(define (draw-row count)
    (with-state
        (cond
            ((not (zero? count))
                (draw-cube)
                (translate (vector 1.1 0 0))
                (draw-row (- count 1))))))

(every-frame (draw-row 10))

or:

(define (draw-row count)
    (cond
        ((not (zero? count))
            (identity)
            (translate (vector (* count 1.1) 0 0))
            (draw-cube)
            (draw-row (- count 1)))))

(every-frame (draw-row 10))


best,
gabor




More information about the Fluxus mailing list