function plane(action)
%   Lighting demo 
%   Part 1 of 4 (plane1, plane2, plane3, plane4)

%   Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%   $Revision: 1.7 $  $Date: 1998/08/19 19:37:40 $

 fig = findobj('Type', 'figure', 'Name', 'Lighting Example');
if ~isempty(fig)
   % do nothing;
 else
   fig = figure('NumberTitle', 'off', 'Name', 'Lighting Example');
end

s=surf(zeros(20));
set(gca, 'DataAspectRatio', [1 1 1],...
      'Position', [.05 .05 .95 .95],...
      'Projection', 'Perspective',...
      'CameraPosition', [-7 -7 17],...
      'CameraTarget', [10 10 0]);
axis off;
set(s, 'facec', [.4 .8 0], 'Clipping', 'off');
lighting gouraud;
set(gca, 'CameraViewAngle', 45);
if nargin
        switch action
        case 1 
                l(1)=lsurf([5 11 1],'w');
                set(gca, 'CameraViewAngle', 34.4);

        case 2 
                l(1)=lsurf([5 11 1], 'w');
                l(2)=lsurf([15 20 2], 'r');
                set(gca, 'CameraViewAngle', 34.4);

        case 3 
                l(1)=lsurf([5 11 1],'w');
                l(2)=lsurf([15 20 2],'r');
                l(3)=lsurf([20 11 3],'b');              

        case 4 
                l(1)=lsurf([5 11 1],'w');
                l(2)=lsurf([15 20 2],'r');
                l(3)=lsurf([20 11 3],'b');
                l(4)=lsurf([15 5 1.5], 'm');
        end
        set(l,'Style','local');
end
