Full window 3D plots got clipped

9 views (last 30 days)
Sandor Toth
Sandor Toth on 19 Sep 2011
I am plotting crystal structure in 3D without showing axes or labels. I want a figure where only the plotted 3D surfaces are visible and it can be manually rotated but during manual rotation the objects are not rescaled. If come up with this code:
rotate3d on;
daspect([1 1 1]);
pbaspect([1 1 1]);
axis off
axis vis3d
set(gca,'OuterPosition',[0 0 1 1]);
The only problem is that after rotation some part of the figure got clipped: http://picturepush.com/public/6576546 It is not only in the sides, also on the "back" side of the figure some things are disappearing. It looks like there is a box, outside which things don't get rendered.
Any idea how to solve it?

Accepted Answer

Jan on 19 Sep 2011
Do not set the OuterPosition, but the Position:
set(gca,'Position', [0 0 1 1]);
Setting the OuterPosition considers space for the TickMarks, Labels and the Title.
Objects on the front dissappear, when they are moved behind the camera position. Then changing the CameraViewAngle instead of the CamaraPosition is helpful. In both cases the zooming effect is similar (not identical), but the view-angle does not change the distance between the view point and the oobjects.

More Answers (1)

Sandor Toth
Sandor Toth on 19 Sep 2011
Thanks for the quick answer! I tried:
set(gca,'Position', [0 0 1 1]);
but it does not help. I don't think parts of the plot is hidden because things are behind the camera. If you check the screenshot, you can see left and right side of the plot is cut, independently of the depth. I played around with the CameraPosition and CameraViewAngle with no succes either.
Sandor Toth
Sandor Toth on 20 Sep 2011
Great! The problem is solved, I had to set the Clipping properties of all objects to Off.

Sign in to comment.


No tags entered yet.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!