| color_change(col,my_view,x,y,Zvalues,x_view,y_view,maxIter,myLight,axis_value)
|
function color_change(col,my_view,x,y,Zvalues,x_view,y_view,maxIter,myLight,axis_value)
% This function does the coloring and light effect for the Mandel120
% program. It applies several standard a few custom colormaps to fit the
% mandelbrot set.
% Example
% color_change(15,3,x,y,Zvalues,29,72,50,3);
% where x,y,Zvalues are the coordinates that are generated by dummy2.m
% the dummy2.m returns x,y,Zvalues to the worksapce is launched from the
% command line.
%%
%Load custom colormaps
if col < 13
myColMaps={@jet;@hsv;@gray;@prism;@cool;@hot;@copper;@pink;@spring;@summer;@autumn;@winter;@bone;@lines;};
colormap(myColMaps{col}(maxIter));
elseif col>12
colMap=strcat('MyColorMaps',num2str(col-12))
colMap
col
load(colMap,'mandelcmap')
set(gcf,'Colormap',mandelcmap)
end
% elseif col==16
% load('MyColormaps2','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==17
% load('MyColormaps3','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==18
% load('MyColormaps4','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==19
% load('MyColormaps5','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==20
% load('MyColormaps6','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==21
% load('MyColormaps6','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==22
% load('MyColormaps6','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==23
% load('MyColormaps7','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
% elseif col==24
% load('MyColormaps8','mandelcmap')
% set(gcf,'Colormap',mandelcmap)
%end
%hier werden die errechneten Daten an Handles ubergegeben.
if my_view == 2
pcolor(x,y,log(single(Zvalues)));
pcolor(x,y,Zvalues);
elseif my_view == 3
meshz(x,y,Zvalues);
view([x_view y_view]);
end
% Select from a panel of light efffects.
mylightSelection={'flat';'gouraud';'phong';'none'};
lighting (mylightSelection{myLight})
shading interp;
if axis_value==1
axis on;
elseif axis_value==0
axis off;
end
|
|