Main Content

campitch

Set or get pitch angle of camera for Satellite Scenario Viewer

Since R2021a

Description

campitch(viewer,pitch) sets the pitch angle of the camera for the specified Satellite Scenario Viewer. Setting the pitch angle tilts the camera up or down about its y-axis.

Camera with double-headed arrow, pointing up and down in front of lens

example

outPitch = campitch(viewer,___) returns the pitch angle of the camera. If the second input is pitch, then the function sets the output equal to the input pitch.

Examples

collapse all

Create a satellite scenario object.

sc = satelliteScenario;

Launch the Satellite Scenario Viewer.

v = satelliteScenarioViewer(sc);

In the Satellite Scenario Viewer, set the pitch angle of the camera to -60 degrees.

pitch = -60;      % degrees
campitch(v,pitch);

Input Arguments

collapse all

Satellite Scenario Viewer, specified as a scalar satelliteScenarioViewer object.1

Pitch angle of the camera in degrees, specified as a scalar in the range [–90, 90]. By default, the pitch angle is –90 degrees, which means that camera points directly toward the surface of the globe.

Output Arguments

collapse all

Camera pitch angle in degrees, returned as a numeric scalar.

Tips

  • When the pitch angle is near –90 (the default value) or 90 degrees, the camera loses one rotational degree of freedom. As a result, when you change the roll angle, the heading angle might change instead. This phenomenon is called gimbal lock. To avoid the effects of gimbal lock, call the camheading function instead of the camroll function.

Version History

Introduced in R2021a


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®.