Main Content

campos

Set or query camera position in trackingGlobeViewer

Description

position = campos(viewer) returns the current position of the camera in the tracking globe viewer.

campos(viewer,lat,lon) sets the latitude and longitude of the camera in the tracking globe viewer.

campos(viewer,lat,lon,alt) additionally sets the altitude of the camera in the tracking globe viewer.

example

campos(viewer,lla) sets the latitude, longitude, and altitude of the camera in the tracking globe viewer using a vector of geodetic coordinates.

Examples

collapse all

Create a tracking globe viewer.

viewer = trackingGlobeViewer;

Change the camera position to Boston, Massachusetts.

pos = [42.33598 -71.03103 1.5e4];
campos(viewer,pos);

Take a snapshot and show the results.

drawnow
snapshot(viewer)

Input Arguments

collapse all

Tracking globe viewer, specified as a trackingGlobeViewer object.1

Latitude of the camera, in degrees, specified as a scalar in the range [-90 90].

Data Types: single | double

Longitude of the camera, in degrees, specified as a scalar in the range [-360 360].

Data Types: single | double

Altitude of the camera above the WGS84 Earth model, in meters, specified as a scalar.

Data Types: single | double

Geodetic coordinates of the camera, specified as a real-valued three-element vector [lat lon alt], where:

  • lat is the latitude in degrees, specified as a scalar in the range [-90 90].

  • lon is the longitude in degrees, specified as a scalar in the range [-360 360].

  • alt is the altitude above the WGS84 Earth model in meters, specified as a scalar.

Data Types: single | double

Output Arguments

collapse all

Geodetic position of the camera, returned as a real-valued three-element vector [lat lon alt], where:

  • lat is the latitude in degrees, returned as a scalar in the range [-90 90].

  • lon is the longitude in degrees, returned as a scalar in the range [-360 360].

  • alt is the altitude above the WGS84 Earth model in meters, returned as a scalar.

Version History

Introduced in R2021b

1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.