function vache(action)
%UNEVACHE   - montre un exemple de représentation à 3D d'une vache

%  Jean-Bernard ROUX
%  $Date: 17.3.2001 $	

if nargin < 1
  action = 'initialize';
end

if strcmp(action, 'initialize')
  
  load vache
  % vache
  
  fig = figure('NumberTitle', 'Off',...
      'Name', 'Oh la vache!');
  cla;
  p=patch('Faces',F1,'verti',S1,'FaceColor',[.3 0.2 0.1],...
      'Edgecolor','none', 'clip', 'off');
  % tétine
  p=patch('Faces',F2,'verti',S2,'FaceColor',[0.8 0.4 0.3],...
      'Edgecolor','none', 'clip', 'off');
  % sabots
  p=patch('Faces',F3,'verti',S3,'FaceColor',[0.1 0.1 0.1],...
      'Edgecolor','none', 'clip', 'off');
  % museau oeil
  p=patch('Faces',F4,'verti',S4,'FaceColor',[0.8 0.4 0.3],...
      'Edgecolor','none', 'clip', 'off');
  % cornes
  p=patch('Faces',F5,'verti',S5,'FaceColor',[.7 0.7 0.7],...
      'Edgecolor','none', 'clip', 'off');
  % queue
  p=patch('Faces',F6,'verti',S6,'FaceColor',[0.25 0.15 0.05],...
      'Edgecolor','none', 'clip', 'off');
  p=patch('Faces',F7,'verti',S7,'FaceColor',[0 0 1],...
      'Edgecolor','none', 'clip', 'off');
	  
  lighting g;
  light('position',[4 0 4]);
  light('position',[0 4 4]);
  light('position',[-4 4 -4]);
  
  set(gca, 'CameraViewangle', 6.2,...
      'CameraPosition', [232.4 52.84 5.23])
  
  set(gca,'Projection','Perspective',...
      'Units', 'Normalized',...
      'Position', [.13 .09 .775 .815])
	  
  set(gcf, 'Color', [0.09 0.45 0.2]); 
  axis image
  axis off;
  view(10,90);
  view3d rot
  
%   % The frame
%   frm = uicontrol('Style', 'Frame',....
%       'Units', 'Normalized', 'Position',...
%       [.83 .005 .14 .17],...
%       'BackGroundColor', [.4 .4 .4]);
%   
%   %The buttons
%   hndl = uicontrol('Style', 'push',...
%       'String', 'Close', 'Units', 'Normalized',...
%       'Position', [.85 .03 .1 .05],...
%       'callback', 'close');
%   
%   
%   info =  uicontrol('Style', 'push',...
%       'String', 'info', 'Units', 'Normalized',...
%       'Position', [.85 .1 .1 .05],...
%       'callback', 'truck(''info'')');
  
elseif strcmp(action, 'info');
  
  ttl = 'Oh la vache!';
  
  str ={...
      'Exemple de représentation 3D'
  ' '
  'filename: unevache.m'
  ' '
  ' '};
  
  helpwin(str, ttl);
  
end
