1

I'm plotting flight data around a 3D globe in MATLAB using this Earth_example file:

http://www.mathworks.com/matlabcentral/fileexchange/13823-3d-earth-example

In order to examine the flight paths, I'd like to be able to move the rotate point to somewhere along the flight path or at the arrival or departure point, but I can't find a command that will let me do that. I've tried camtarget and campos, but neither let me rotate around a new point in the plot, and campos throws warnings and fails with the 3D Earth plot. Is there a function that lets you update the scene center to make rotating around a new point easy?

Here's a snippet of my code:

%% Calculate & Plot Great Circle Trajectories

for flight = flight_struct
    % [lat,lon] = gcwaypts(lat1,lon1,lat2,lon2,nlegs) - (nlegs = # of waypts along path)
    [lat,lon] = gcwaypts(flight.DepartureLatitude,flight.DepartureLongitude,flight.ArrivalLatitude,flight.ArrivalLongitude,50);

    % 3D Trajectories
    alt = ones(length(lat),1)*cruise_alt;
    lla_pos = [lat,lon,alt];
    ecef_pos = lla2ecef(lla_pos);
    x = ecef_pos(:,1);
    y = ecef_pos(:,2);
    z = ecef_pos(:,3);
    plot3(x,y,z,'r','LineWidth',1)

Thanks for any help/guidance.

np99
  • 13
  • 4

1 Answers1

0

I think you're looking for camorbit as seen here:

http://www.mathworks.com/help/matlab/views.html

anon01
  • 10,618
  • 8
  • 35
  • 58
  • Thanks, while this does let me rotate programatically around the target point, the view just resets when I attempt to zoom or rotate in the figure. For that reason, I'd like to set the target as the permanent scene center so that I can orbit around it or zoom in and out using the figure toolbar. Is this possible? – np99 Jun 24 '15 at 23:14
  • I'm afraid I don't understand exactly - can you post stand-alone code, or try to re-explain? – anon01 Jul 31 '15 at 15:10
  • So the command you gave does exactly what I'd like programmatically. But instead, I would like to set a new center point, and then use the MATLAB plotting GUI's rotate tool to orbit around a new desired focus point in the GUI. I think this would be the easiest way to work in the GUI and change what the user is looking at in a 3D plot more easily? – np99 Aug 01 '15 at 16:24