06.08.2013 Views

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9.7.7 纹理影射和曲面彩绘<br />

图 9.7-9<br />

【例 9.7.7.-1】在曲面上彩绘 unit8 编址图象<br />

clf reset,t=(0:20)/20;r=2.5-cos(2*pi*t);<br />

[x,y,z]=cylinder(r,40);<br />

%<br />

[C,CMAP]=imread('trees.tif');<br />

CC=double(C)+1;<br />

%<br />

surface(x,y,z,'Cdata',flipud(CC),'FaceColor','texturemap','EdgeColor'<br />

,'none','CDataMapping','direct','Ambient',0.6,'diffuse',0.8,'specular<br />

s',0.9)<br />

colormap(CMAP)<br />

view(3),axis off<br />

9.7.8 三维块建模和着色<br />

9.7.8.1 创建块对象的顶点坐标法<br />

图 9.7-10<br />

【例 9.7.8.1-1】顶点坐标法创建三维长方块。<br />

clf reset,k=8;<br />

X=[0 1 1 0;1 1 1 1;1 0 0 1;0 0 0 0;0 1 1 0;0 1 1 0]';<br />

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!