
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                           affichage de la texture                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


function afficher(Qr,handles)
global NG choix_mapping tailles ng_min ng_max 


   if (choix_mapping==0)
      if (length(tailles)~=0)
         NG=niveaux_gris(Qr,ng_min,ng_max);
      else
         NG=niveaux_gris(Qr);
      end
      imagesc(NG);
   else
      cla reset           
      switch choix_mapping,    
         case 1,
            [x,y,z]=sphere(70);
         case 2,
            [x,y,z]=cylinder(15,70);
         case 3,  
            [x,y,z]=ellipsoid(20,20,20,7,20,33,70);  
         end
      props.AmbientStrength=0.1;
      props.DiffuseStrength=1;
      props.SpecularColorReflectance=.5; 
      props.SpecularExponent=20;
      props.SpecularStrength=1;
      props.FaceColor='texture';
      props.EdgeColor='none';
      props.FaceLighting='phong';
      props.Cdata=NG;
      surface(x,y,z,props);
      light('position',[-1 0 1]);
      light('position',[-1.5 0.5 -0.5],'color',[.6 .2 .2]);
      view(3)
   end

axis image;