function truck(action)
%TRUCK   - Shows truck image for patch example

%  Damian Packer
%  Modified by Yama Habibzai
%   Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%  $Revision: 1.9 $
%  $Date: 1997/12/03 17:30:08 $	

if nargin < 1
  action = 'initialize';
end

if strcmp(action, 'initialize')
  
  load dumpfv
  load payload
  % truck
  
  figpos = getfgpos(560, 420);
  fig = figure('NumberTitle', 'Off',...
      'Position', figpos,...
      'Name', 'MATLAB patch example');
  cla;
  p=patch('Faces',f,'verti',v,'FaceColor',[.7 .7 .7],...
      'Edgecolor','none', 'clip', 'off');
  lighting g;
  
  surface('XData',d{1},'YData',d{2},'ZData',d{3}*3-3.6,...
      'CData',d{3}*3-3.6, 'Clipping', 'off');
  
  %   L-Shaped Membrane
  surface('XData',([1:43]*.1-17), 'YData',([1:43]*.15-4)',...
      'ZData',(al-1.5)*.7,'CData',(al-1.5)*.7,...
      'FaceLighting','g',...
      'EdgeColor','none', 'Clipping', 'off');
  
  % knot
  surface('XData',atx*.6-6, 'YData',aty*.6,...
      'ZData',atz*.6+4,'CData',atz*.6+4,...
      'FaceLighting','g',...
      'EdgeColor','none', 'Clipping', 'off');
  
  light;
  
  view(125,0);
  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', [1 1 1]); 
  axis off; 
  
  % 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 = 'MATLAB Patch Objects';
  
  str ={...
      'Patch is the low-level graphics function for creating'
  'Patch graphics objects. A Patch object is one or more'
  'polygons defined by the coordinates of its vertices.'
  'You can specify the coloring and lighting of the Patch. '
  ' '
  'Patch(X,Y,C) adds the filled 2-D polygon to the current'
  'Axes. The elements of X and Y specify the vertices of the'
  'polygon. If X and Y are matrices, MATLAB draws one polygon'
  'per column. C determines the color of the Patch. It can be'
  'a single colorspec, one color per face, or one color per'
  'vertex.'
  ' '
  'filename: truck.m'
  ' '
  ' '};
  
  helpwin(str, ttl);
  
end





