Path: news.mathworks.com!not-for-mail
From: "Drago Zarkovic" <dragozarkovic@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: 3D plot problem
Date: Fri, 5 Jun 2009 07:48:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <h0aiji$76j$1@fred.mathworks.com>
Reply-To: "Drago Zarkovic" <dragozarkovic@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244188082 7379 172.30.248.38 (5 Jun 2009 07:48:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Jun 2009 07:48:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1844830
Xref: news.mathworks.com comp.soft-sys.matlab:544995


I made a 3D plot and set cameraposition and target so that only a part of plot is displayed. As soon as I try rotate3d it sets cameraposition so far from a plot that it is shown whole. In earlier versions of Matlab (7.1, 7.0) it was OK, but in 7.7 I have this problem...
"""""""""""""""""""""""""
figure(1)
plot3([-25 25],[0 0],[0 0],'m')
hold on
plot3([0 0],[-25 25],[0 0],'m')
plot3([0 0],[0 0],[-25 25],'m')
[Xosa,Yosa] = meshgrid(-25:25,-25:25:-25:25);
Zosa=Xosa.*0;
surf(Xosa,Yosa,Zosa,'FaceAlpha',0,'LineStyle',':')
set(gca,'CameraPosition',[5 5 5],'CameraTarget',[0 0 0],'CameraUpVector',[0 0 1],'CameraViewAngle',45,'Projection','perspective')
rotate3d
"""""""""""""""""""""""""""
I want camera to stay close...

Thank you in advance