function stepplot
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      

global vertexmat patchmat
answer=questdlg('Start with vertices or patches?','Start-item:','vertices','patches','vertices');
if strcmp(answer,'vertices')
    h = figure;
	l = light('position',[0.1 0 0],'style','infinite','Color',[1 1 0]);
	view(45,20);
	warning off
    hold on
	for r=1:length(vertexmat)
       plot3(vertexmat(r,1),vertexmat(r,2),vertexmat(r,3),'o');
        pause
	end

else
	h = figure;
	l = light('position',[0.1 0 0],'style','infinite','Color',[1 1 0]);
	view(45,20);
	warning off
	for r=1:length(patchmat)
        t=patch('Vertices',vertexmat,'Faces',patchmat(r,:),'FaceVertexCData',hsv(1),'FaceColor','flat','EdgeColor','none');
        figure(h);
        pause
	end
end
