function modemovie=animmode(Bars,Nodes,Shells,Phi,Freq,respDOF,nmod,isignmod,ibarlab,iundef,inodelab,hageom,nscale)
%
%  Name: animmode
% 
%  Usage: 
%
% 
%   Description:
%	Animates displaced mode shape of mode number 'nmod'

%  Version SWD970620
%
%  Author(s): Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%		ESA-EA
%
%  Copyright (c) 1996-1997, The Regents of the University
%     	of California. (See top level of code for
%	full copyright statement.)


%
% Define parameters
%

nframes = 16;
T=1/Freq(nmod);
omega=2*pi/T;
axes(hageom)
dtime=T/nframes;
time=0;

%
%  Compute Scaling factor, 'nscale'
%

if isignmod == 0,
    isign = 1;
else
    isign = -1;
end

%
%  Set up the Drawing information text
%

htext = uicontrol('style','text',...
	'units','normal',...
	'pos',[.75 .66 .25 .04],...
    	'string','Drawing Status');

%
%  Loop over each increment in the cycle
%

for istep = 1:nframes,
   
   time=dtime*(istep-1);
%
%  Display the drawing status
%

set(htext,'string',['Drawing Frame ',num2str(istep),' of ',num2str(nframes)])

if istep==1,
   irescale=1;
else
   irescale=0;
end   
   
   drawmode(Bars,Nodes,Shells,Phi,Freq,respDOF,nmod,isignmod,...
      iundef,nscale,hageom,irescale,omega*time);

%
%  Capture the movie image
%

if istep==1,
   modemovie = moviein(nframes,hageom);
end

modemovie(:,istep) = getframe(hageom);

end

set(htext,'visible','off')

return
