function [status] = show_mesh(mesh_type, image_width, number_of_images, X, Y, Z)
% SHOW MESH: Show a mesh of a given type in AART
%
%    GENERAL
%
%      [status] = show_mesh(mesh_type, image_width, number_of_images, X, Y, Z)
%
%    INPUT/S
%
%      -
%           
%    OUTPUT/S
%
%      -status:
%           Indicates if an error occured.
%
%    PENDING WORK
%
%      -
%
%    KNOWN BUG/S
%
%      -
%
%    COMMENT/S
%
%      -
%
%    RELATED FUNCTION/S
%
%      
%
%    ABOUT
%
%      -Created:     2004
%      -Last update: 2004
%      -Revision:    0.0.2
%      -Author:      R. S. Schestowitz, University of Manchester
% ==============================================================

  if (strcmp(mesh_type,'Surface Red')),      
    surf(X,Y,Z,'FaceColor', 'red', 'EdgeColor', 'none');
    camlight left;
    lighting phong;
  elseif (strcmp(mesh_type,'Surface Blue')),      
    surf(X,Y,Z,'FaceColor', 'blue', 'EdgeColor', 'none');
    camlight left;
    lighting phong;
  elseif (strcmp(mesh_type,'Polygons')),   
    mesh(X,Y,Z);
  elseif (strcmp(mesh_type,'Illuminated Surface')), 
    surface(X,Y,Z, ...
      'EdgeColor','none', ...
      'FaceColor',[0.5 0.5 0.5], ...
      'FaceLighting','phong', ...
      'AmbientStrength',0.3, ...
      'DiffuseStrength',0.6, ... 
      'Clipping','off',...
      'BackFaceLighting','lit', ...
      'SpecularStrength',1.1, ...
      'SpecularColorReflectance',1, ...
      'SpecularExponent',7);
    l1 = light('Position',[40 100 20], ...
      'Style','local', ...
      'Color',[0 0.7 0.7]);
    l2 = light('Position',[.5 -1 .4], ...
      'Color',[1 1 0]);
  else
    error ('Mesh type not recognised. Internal error.');
  end
  axis off;
  axis([0 number_of_images*5 -image_width/2 image_width/2 0 1]);
  status='OK';
