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] );
Best Answer