|
发表于 2003-7-30 20:37:46
|
显示全部楼层
无
这是我写的那个小程序的代码:
movecomera.m
function movecamera(dist)
set(gca,'CameraViewAngleMode','manual')
newcp=cpos-dist*(cpos-ctarg);
set(gca,'CameraPosition',newcp)
function out=cpos
out=get(gca,'CameraPosition');
function out=ctarg
out=get(gca,'CameraTarget');
调用上面函数的代码:
t=(0:0.02:2)*pi;
x=sin(t);
y=cos(t);
z=cos(2*t);
plot3(x,y,z,'b-',x,y,z,'bd');
view([-82,58]);
box on;
legend('lian','baoshi');
movecamera(-0.9)
运行出来预期的效果。
|
|