#------------------------------------------------------------------------------
#
#		  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;

framet = sur{[sin(x+j*dt)*cos(y+2*j*dt)]};

mat1 = material{ spec 1,1,1, diffu: 0.01,0.557,0.7, shininess: 5.0,}

a = object{ material mat1 push  scale 1.4,1.4,1.4  framet pop};

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

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

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