labfansyao
2008-03-01, 10:01
函数如下:
function threshold(t) %t从0到1取值
if nargin==0
t=0.7;
end
[x,y,z,v]=flow;
v_min=min(v(:));v_max=max(v(:));
value=v_min+(v_max-v_min)*t;
str=strcat('surface value=',num2str(value));
title(str);
hpatch=patch(isosurface(x,y,z,v,value));
isonormals(x,y,z,v,hpatch);
set(hpatch,'facecolor','red','edgecolor','none');
daspect([1,4,4]);%注意调整此处
view([65,20]);
axis tight;
camlight left;
set(gcf,'renderer','zbuffer');
lighting phong;
所获得的等值面两侧的v值肯定是一大一小,目前等值面无论从哪个方向看上去都是红色(red),所以从图中看不出等值面两侧的v值谁大谁小,可不可以将等值面的两侧设置成不同的颜色?
function threshold(t) %t从0到1取值
if nargin==0
t=0.7;
end
[x,y,z,v]=flow;
v_min=min(v(:));v_max=max(v(:));
value=v_min+(v_max-v_min)*t;
str=strcat('surface value=',num2str(value));
title(str);
hpatch=patch(isosurface(x,y,z,v,value));
isonormals(x,y,z,v,hpatch);
set(hpatch,'facecolor','red','edgecolor','none');
daspect([1,4,4]);%注意调整此处
view([65,20]);
axis tight;
camlight left;
set(gcf,'renderer','zbuffer');
lighting phong;
所获得的等值面两侧的v值肯定是一大一小,目前等值面无论从哪个方向看上去都是红色(red),所以从图中看不出等值面两侧的v值谁大谁小,可不可以将等值面的两侧设置成不同的颜色?