0001 function [status] = show_mesh(mesh_type, image_width, number_of_images, X, Y, Z) 0002 0003 if (strcmp(mesh_type,'Surface Red')), 0004 surf(X,Y,Z,'FaceColor', 'red', 'EdgeColor', 'none'); 0005 camlight left; 0006 lighting phong; 0007 elseif (strcmp(mesh_type,'Surface Blue')), 0008 surf(X,Y,Z,'FaceColor', 'blue', 'EdgeColor', 'none'); 0009 camlight left; 0010 lighting phong; 0011 elseif (strcmp(mesh_type,'Polygons')), 0012 mesh(X,Y,Z); 0013 elseif (strcmp(mesh_type,'Illuminated Surface')), 0014 surface(X,Y,Z, ... 0015 'EdgeColor','none', ... 0016 'FaceColor',[0.5 0.5 0.5], ... 0017 'FaceLighting','phong', ... 0018 'AmbientStrength',0.3, ... 0019 'DiffuseStrength',0.6, ... 0020 'Clipping','off',... 0021 'BackFaceLighting','lit', ... 0022 'SpecularStrength',1.1, ... 0023 'SpecularColorReflectance',1, ... 0024 'SpecularExponent',7); 0025 l1 = light('Position',[40 100 20], ... 0026 'Style','local', ... 0027 'Color',[0 0.7 0.7]); 0028 l2 = light('Position',[.5 -1 .4], ... 0029 'Color',[1 1 0]); 0030 else 0031 error ('Mesh type not recognised. Internal error.'); 0032 end 0033 axis off; 0034 axis([0 number_of_images*5 -image_width/2 image_width/2 0 1]); 0035 status='OK';