function make_frames ( frame_max )

%*****************************************************************************80
%
%% make_frames() makes the frames of an animation.
%
%  Discussion:
%
%    This program makes JPEG files 0 through frame_max, which constitute
%    individual frames of an animation.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 November 2010
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer frame_max: the program will create frames 0 through frame_max.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'make_frames()\n' );
  fprintf ( 1, '  Create a sequence of JPG image files,\n' );
  fprintf ( 1, '  each containing one frame of a potential animation.\n' );

  if ( nargin < 1 )
    fprintf ( 1, '\n' );
    frame_max = input ( 'Enter the index of the last frame to create:  ' );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  This program has been asked to create\n' );
  fprintf ( 1, '  frames 0 through %d.\n', frame_max );
  fprintf ( 1, '  The first frame will be stored in "%s",\n', ...
    sprintf ( 'frame%04d.jpg', 0 ) );
  fprintf ( 1, '  The last frame will be stored in "%s".\n', ...
    sprintf ( 'frame%04d.jpg', frame_max ) );

  for frame_id = 0 : frame_max
    make_frame ( frame_id, frame_max );
  end

  return
end
