% DEMO_ANAVIEW  Test ANAVIEW function

switch 1
 case 1    
	logo ;
	fig=gcf;
  
 case 2
	fig=100 ;
	figure(fig) ; clf ;
	set(gcf,'Color',[0;0;0],'Position',[10 10 640 480]) ;
	
	z=rand(18,80) ;
	h=bar3(z) ; colormap cool ;
	set(h,'linestyle','none') ;
	lighting gouraud ;
	light('position',randn(1,3)) ; 
	light('position',randn(1,3)) ; 
	light('position',campos) ;
	campos([-28,46,2]);
	camtarget([38, -1, 0]) ;
	camva(32) ;
end

figure(fig) ;
dist = [50  20   5  1   0.8  0.6 ] ;
sf   = [0.3 0.5  1  1.1 1.2  1.5 ] ;
switch 5
  case 3
    I1 = anaview('TargetDistance',dist(1)) ;
    I2 = anaview('TargetDistance',dist(2)) ;
    I3 = anaview('TargetDistance',dist(3)) ;
    I4 = anaview('TargetDistance',dist(4)) ;
    I5 = anaview('TargetDistance',dist(5)) ;
    I6 = anaview('TargetDistance',dist(6)) ;
  
  case 2
    I1 = anaview('ImageDistance',dist(1)) ; 
    I2 = anaview('ImageDistance',dist(2)) ;
    I3 = anaview('ImageDistance',dist(3)) ;
    I4 = anaview('ImageDistance',dist(4)) ;
    I5 = anaview('ImageDistance',dist(5)) ;
    I6 = anaview('ImageDistance',dist(6)) ;
  
  case 3
    I1 = anaview('ScaleFocal',dist(1)) ;
    I2 = anaview('ScaleFocal',dist(2)) ;
    I3 = anaview('ScaleFocal',dist(3)) ;
    I4 = anaview('ScaleFocal',dist(4)) ;
    I5 = anaview('ScaleFocal',dist(5)) ;
    I6 = anaview('ScaleFocal',dist(6)) ;
  
  case 4
    I1 = anaview('TargetDistance',dist(1),'ImageDistance',10000) ;
    I2 = anaview('TargetDistance',dist(2),'ImageDistance',10000) ;
    I3 = anaview('TargetDistance',dist(3),'ImageDistance',10000) ;
    I4 = anaview('TargetDistance',dist(4),'ImageDistance',10000) ;
    I5 = anaview('TargetDistance',dist(5),'ImageDistance',10000) ;
    I6 = anaview('TargetDistance',dist(6),'ImageDistance',10000) ;
    
  case 5 
    I1 = anaview('TargetDistance',dist(1),'ScaleFocal',dist(1),'ImageDistance',dist(1)) ;
    I2 = anaview('TargetDistance',dist(2),'ScaleFocal',dist(2),'ImageDistance',dist(2)) ;
    I3 = anaview('TargetDistance',dist(3),'ScaleFocal',dist(3),'ImageDistance',dist(3)) ;
    I4 = anaview('TargetDistance',dist(4),'ScaleFocal',dist(4),'ImageDistance',dist(4)) ;
    I5 = anaview('TargetDistance',dist(5),'ScaleFocal',dist(5),'ImageDistance',dist(5)) ;
    I6 = anaview('TargetDistance',dist(6),'ScaleFocal',dist(6),'ImageDistance',dist(6)) ;
    
end
    
I = [ I1 I2 ; I3 I4 ; I5 I6 ] ;

figure(101) ; clf ;
axes('position',[0 0 1 1]) ;
imagesc(I) ; axis image ; axis off ;

