next up previous contents index
Next: Examples Up: Python Gist Graphics Previous: Overview of module slice3   Contents   Index


movie.py: PyGist 3D Animation

The module movie.py supports 3D real time animation. Function movie accepts as argument the name of a drawing function which has as its single argument a frame number; movie then calls this drawing function within a loop, halting when the function returns zero. The idea is that the drawing function increments from the previous frame and draws the new frame, returning zero when some predefined event takes place, e. g., some set number of frames has been drawn, or a certain amount of time has elapsed. The function spin3 in module pl3d calls movie; the drawing function _spin3 draws the successive frames of a rotating 3D plot. The demonstration module demo5.py contains an example of a shaded surface with a moving light source; the drawing function, demo5_light, moves the light and draws the next frame.



Subsections

Michiel Jan Laurens de Hoon 2003-04-19