[fluxus] errors at runtime

Dave Griffiths dave at pawfal.org
Wed Jun 21 05:01:58 PDT 2006


>> if you do:
>>
>> (define (render)
>>     (draw-cube))
>> (every-frame (render))
>>
>> you get no cube?
>
> i get a cube. but no "animation", no repetition - i thought that's what
> the
> function (is it called a function?) is good for

to animate that script you have to tell it what to change:

(define (render)
     (rotate (vector 0 1 0)) ; turn one degree in y each frame
     (draw-cube))
(every-frame (render))

you need to redraw the cube every frame. if you just execute:

(draw-cube)

on it's own you get a cube for a frame and then it's gone. this is called
immediate mode, retained mode will store and redraw the cube for you ie:

(build-cube)

which you want to use depends on what you want to do, immediate mode is
easier in some ways, but you have to recalculate the frame every time it's
drawn so it can be slow and a bit cumbersome when you start to do more
complex things.

cheers,

dave




More information about the Fluxus mailing list