matlab 旋转clear all; close all%option menuOPT.color = hsv;for a=0:112; for b=0:60; u=a/2; w=b/2; v=w/50-0.3; X(a+1,b+1)=cos(u)+v*cos(u/2)*cos(u); Y(a+1,b+1)=sin(u)+v*cos(u/2)*sin(u); Z(a+1,b+1)=v*sin(u/2); end endsurf(X,Y,Z) view(45,45) shading in
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 07:57:26
matlab 旋转clear all; close all%option menuOPT.color = hsv;for a=0:112; for b=0:60; u=a/2; w=b/2; v=w/50-0.3; X(a+1,b+1)=cos(u)+v*cos(u/2)*cos(u); Y(a+1,b+1)=sin(u)+v*cos(u/2)*sin(u); Z(a+1,b+1)=v*sin(u/2); end endsurf(X,Y,Z) view(45,45) shading in
matlab 旋转
clear all; close all
%option menu
OPT.color = hsv;
for a=0:112;
for b=0:60;
u=a/2;
w=b/2;
v=w/50-0.3;
X(a+1,b+1)=cos(u)+v*cos(u/2)*cos(u);
Y(a+1,b+1)=sin(u)+v*cos(u/2)*sin(u);
Z(a+1,b+1)=v*sin(u/2);
end
end
surf(X,Y,Z)
view(45,45)
shading interp %É«²Êƽ»¬
light %¹âÕÕ
lighting phong
material dull %Âþ·´Éä
colormap (OPT.color)
这里面添加语句,实现一个物体在mobius band 上移动,同时图像旋转,保持物体在画面中央?
matlab 旋转clear all; close all%option menuOPT.color = hsv;for a=0:112; for b=0:60; u=a/2; w=b/2; v=w/50-0.3; X(a+1,b+1)=cos(u)+v*cos(u/2)*cos(u); Y(a+1,b+1)=sin(u)+v*cos(u/2)*sin(u); Z(a+1,b+1)=v*sin(u/2); end endsurf(X,Y,Z) view(45,45) shading in
matlab函数:B = imrotate(A,angle,method);A是原始图像,angle是旋转角度,B为旋转后的图像;使用method参数可以改变插值算法,例如:{'nearest'}:最邻近线性插值(Nearest-neighbor interpolation)'bilinear':双线性插值(Bilinear interpolation)'bicubic':双三次插值(或叫做双立方插值)(Bicubic interpolation).B = imrotate(A,angle,method,bbox)bbox参数用于指定输出图像属性:'crop':通过对旋转后的图像B进行裁剪,保持旋转后输出图像B的尺寸和输入图像A的尺寸一样.{'loose'}:使输出图像足够大,以保证源图像旋转后超出图像尺寸范围的像素值没有丢失.一般上这种格式产生的图像的尺寸都要大于源图像的尺寸