www.gusucode.com > 《matlab图像处理与界面编程宝典》秦襄培 编著,每章的MATLAB源代码程序 > 第9章/第9.4.3节中的代码.txt
load wind % 装入数据 wind_speed = sqrt(u.^2 + v.^2 + w.^2); % 风速计算 hpatch = patch(isosurface(x,y,z,wind_speed,35)); % 等值面绘制 isonormals(x,y,z,wind_speed,hpatch) % 计算等值面的顶点范数 set(hpatch,'FaceColor','red','EdgeColor','none'); % 设置等值面属性 [f vt] = reducepatch(isosurface(x,y,z,wind_speed,45),0.05); % 减少面片数量 daspect([1,1,1]); % 绘图比例 hcone = coneplot(x,y,z,u,v,w,vt(:,1),vt(:,2),vt(:,3),2); % 流锥图 set(hcone,'FaceColor','blue','EdgeColor','none'); % 设置流锥对象属性 camproj perspective % 相机透视投影 camva(25) % 设置相机 hlight = camlight('headlight'); % 设置相机光照类型 set(hpatch,'AmbientStrength',.1,... % 设置等值面属性 'SpecularStrength',1,... 'DiffuseStrength',1); set(hcone,'SpecularStrength',1); % 设置流锥体属性 set(gcf,'Color','k') % 设置图形窗口属性 lighting gouraud % 光照属性 set(gcf,'Renderer','OpenGL') % 设置渲染引擎 lighting phong % 光照属性 set(gcf,'Renderer','zbuffer') % 设置渲染引擎