Figure Clipping at Large Distances

조회 수: 8 (최근 30일)
Loren Vorenkamp
Loren Vorenkamp 2019년 10월 6일
편집: Loren Vorenkamp 2019년 10월 6일
Hi there,
First post to this forum; I'm attempting to plot orbital trajectories around the earth and I have a really annoying issue where I can see the opposite side of the Earth to where I'm viewing and some of my plot3's are clipped. I have disabled axis clipping and tried disabling clipping for every individual plot and then using both 'refresh' and 'drawnow' and nothing has worked thus far. If I manually rotate the figure, everything pops back in and I can see the correct side of the earth, like it's refreshing when manually rotating, but I can't seem to get it to work from the start. Heres the code I'm using for the figure;
figure
[x,y,z] = sphere(50);
ime = imread('8k_earth_daymap.jpg');
h1 = surf(r_ECI0*x,r_ECI0*y,r_ECI0*z, flip(ime, 1), 'FaceColor', 'texturemap', 'EdgeColor', 'none');
h1.Clipping = 'off';
hold on
campos([7000 0 0]) % Set the camera view
% camzoom(2)
u = pi/2:0.1:5*pi/2; % Initialize parameter variable
h2 = plot3(r_ECI0*cos(u),r_ECI0*sin(u),zeros(length(u)),'--k','LineWidth',1); % Plot the equator on the sphere
f3 = plot3(r_ECI0*cos(u),zeros(length(u)),r_ECI0*sin(u),'--r','LineWidth',1); % Plot the prime meridian on the sphere
f4 = plot3(Rs_ECEF1(:,1),Rs_ECEF1(:,2),Rs_ECEF1(:,3),'-c','LineWidth',2);
f4.Clipping = 'off';
f5 = plot3(Rs_ECEF2(:,1),Rs_ECEF2(:,2),Rs_ECEF2(:,3),'-c','LineWidth',2);
f5.Clipping = 'off';
f6 = plot3(Rs_ECEF3(:,1),Rs_ECEF3(:,2),Rs_ECEF3(:,3),'-c','LineWidth',2);
f6.Clipping = 'off';
f7 = plot3(Rs_ECEF4(:,1),Rs_ECEF4(:,2),Rs_ECEF4(:,3),'-c','LineWidth',2);
f7.Clipping = 'off';
f8 = plot3(R_ECEF1(:,1),R_ECEF1(:,2),R_ECEF1(:,3),'-r','LineWidth',2);
f8.Clipping = 'off';
f9 = plot3(R_ECEF2(:,1),R_ECEF2(:,2),R_ECEF2(:,3),'-g','LineWidth',2);
f9.Clipping = 'off';
f10 = plot3(R_ECEF3(:,1),R_ECEF3(:,2),R_ECEF3(:,3),'-b','LineWidth',2);
f10.Clipping = 'off';
f11 = plot3(R_ECEF4(:,1),R_ECEF4(:,2),R_ECEF4(:,3),'-m','LineWidth',2);
f11.Clipping = 'off';
axis square off % Set the axes units as square and turn them off
daspect([1 1 1]) % Keep the aspect ratio of the figure 1 to 1 in all directions
set(gca,'BoxStyle','full','Box','on'); % Set box style to full
ax = gca;
ax.Clipping = 'off'; % Turn off clipping
refresh
drawnow
set(gcf,'color','w') % Set background to white
Any help would be appreciatted as this is drving me crazy.
EDIT 1: I have narrowed the problem down to the 'campos' command; if I remove this part of the code, the figure displays correctly. If I try to change the camera position at all with this command, I get the problems described above. Of course, how do I change the camera position then if I can't use 'campos'?
EDIT 2: I just answered my own question; the 'campos' command was clipping through my plots as the distances I was specifying (ie, 7000 km) were too small for the orbits I was trying to plot (ie, ~50000 km altitude GEO).
  댓글 수: 2
darova
darova 2019년 10월 6일
Please attach the you use data
Loren Vorenkamp
Loren Vorenkamp 2019년 10월 6일
편집: Loren Vorenkamp 2019년 10월 6일
Hi darova,
I figured out my issue already (see EDIT 2 above in my original post), but thanks for getting back to me. I didn't realise there was a 'close thread' option, so I'll now close this thread, cheers.
EDIT: 'close thread' isn't what I thought it was lol. Anyway, problem solved.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by