3D animate plot of satellite in orbit around Earth
Afficher commentaires plus anciens
Hello.
I am developing an app with app designer and I need to animate the plot of a satellite on a fixed orbit.
In the following, a simplified version of what I've always used:
C = imread('map.jpg');
[x, y, z] = ellipsoid(0,0,0, 6378.135, 6378.135,6356.750,1E2);
surf(x,y,z,circshift(flip(C),[0,ceil(size(C,2)/360)]), 'FaceColor', 'texturemap','EdgeColor','none');
axis equal;
hold on;
plot3(orbit(1,:),orbit(2,:),orbit(3,:),'linewidth',2,'color', .6*ones(1,3));
position = scatter3(orbit(1,1),orbit(2,1),orbit(3,1),'filled','color', 'r');
for j = 2 : size(position,2)
position.XData = orbit(1,j);
position.YData = orbit(2,j);
position.ZData = orbit(3,j);
pause(0.1);
end
uif = uifigure;
earth = geoglobe(uif);
hold(earth,'on');
geoplot3(earth,latitude,longitude,altitude,'linewidth',2,'color', .6*ones(1,3));
position = geoplot3(earth,latitude(1),longitude(1),altitude(3,1),'ro');
for j = 2 : length(altitude)
position.LatitudeData = latitude(j);
position.LongitudeData = longitude(j);
position.HeightData = altitude(j);
pause(0.1);
end
Unfortunately I faced two major problems:
- The Marker can't be set as 'filled' and I don't really like it this way
- The pause command doesn't work properly as the time elapsed between cycles is much larger
- The view of the globe is automatically updated and when the user tries to rotate the view with the figure tools, the values of campos are reset to a reference view automatically
The second problem can be fixed by setting campos before the loop.
The third problem is related to the automatic view update of geoglobe and I did not find a solution on how to disable it.
I am confident that disabling the automatic view update would also solve the second problem.
A side problem is the flickering transition given by the loop update, but I hope I can solve this with timer.
Is there a simple solution to these three problems that you might be aware of?
Are there any alternatives to obtain animated fancy plot like the second one?
Thanks
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur CubeSat and Satellites dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!