Why do three-dimensional axes get clipped on rotation when using camera "perspective" projection in MATLAB 6.5 (R13)?
1 次查看(过去 30 天)
显示 更早的评论
I face this problem at some camera positions when the 3D graph is rotated.
For example, If I run the code below and rotate the axes, then the axes are clipped:
f = figure;
set(f,'Renderer','zbuffer');
set(gca,'Projection','Perspective');
axis vis3d on;
axis equal;
grid on;
axis (gca,[-30 30 -30 30 -30 30])
X = -15;
Y = -15;
widthX = 30;
widthY = 30;
verts = 20;
Sx = linspace(0,1,verts);
Sy = linspace(0,1,verts);
Sx = Sx * widthX + X;
Sy = Sy * widthY + Y;
Sz = zeros(verts, verts);
surface(Sx,Sy,Sz);
x = 0.0;
y = 0.0;
z = 1.0;
az = -0.5;
el = 0.0;
fov = 25;
campos(gca, [x,y,z]);
[targx,targy,targz] = sph2cart(az,el,1);
camtarget(gca, [x+targx, y+targy, z+targz] );
采纳的回答
MathWorks Support Team
2009-6-27
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This problem has been fixed in MATLAB 7.0 (R14). If you are using a previous version, read the following:
We have verified that there is a bug in MATLAB 6.5 (R13) in the way that rotation is handled with the "perspective" projection of an axes.
In some camera positions, the 3D graph is clipped during camera rotation.
To work around this issue, set the axes' "Projection" property to "orthographic" instead of "perspective" while performing the rotation.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Camera Views 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!