#------------------------------------------------------------------------------
#
#		  Save some image for animation
#
#   This simple example save 40 different frames of a simple function
#   f(x,y,t) = sin(x+t)*cos(y+2*t). The saved image can be used by the
#   demo program 'cine' to do a rapid animation. 
#
#   commands demostrated here are:
#    'save image'
#    'save image for cine'
#    'base on'
#     micro definition and 'for loop' construction.
#    
#------------------------------------------------------------------------------


dt = 0.157029; j = 10;

framej = sur{[sin(0.7*(x*x+y*y-j*dt))]}

b = obj{ mat default, push scale 1.3 1.3 1.6 framej pop}

CMD="save image for cine; base on; plot b; !Wait; !mv IMAGE.rgb SIN.00$(j).rgb"

for(j=10;j<50;j=j+1) {  !echo  Frame $(j); $(CMD) }

#------------------------------------------------------------------------------
