STK Graphics PrimitivesSend comments on this topic.
IAgStkGraphicsCamera Interface

Description

Implemented by the scene camera. Contains operations to manipulate the camera position, view direction and orientation in the scene.

Public Methods

Public Method CartographicToWindowConverts a Cartographic position to a pixel coordinate relative to the globe control. This method can throw an exception. Returns an array containing the pixel coordinate (in the order x, y) of the Cartographic position relative to the globe control. The coordinate can be fractional.
Public Method TryCartographicToWindowConverts a Cartographic position to a pixel coordinate relative to the globe control. This method does not throw an exception.
Public Method TryWindowToCartographicConverts a pixel coordinate relative to the globe control to a Cartographic position. For speed, terrain is not considered. This method does not throw an exception.
Public Method ViewViews from a point to a point. Sets the camera's position and the reference point the camera is looking at.
Public Method ViewCentralBodyZoom to a central body and use the specified axes for rotation. The reference point is set to the center of the central body and the camera's position is set so the entire central body is visible.
Public Method ViewDirectionViews from a point to a direction. Sets the camera's position and the direction vector indicating where the camera is looking.
Public Method ViewDirectionWithUpAxisViews from a point to a direction. Sets the camera's position and the direction vector indicating where the camera is looking.
Public Method ViewExtentZooms to a Cartographic Extent on the centralBody. The camera will be looking straight down at the extent, with the up vector pointing toward local north. The Axes is set to an east-north-up axes at the center of extent.
Public Method ViewOffsetSets the camera's reference point - the point the camera is looking at. The camera's position is the reference point translated by the offset.
Public Method ViewOffsetDirectionSets the camera's reference point - the point the camera is looking at. The camera's position is the reference point translated by the direction vector.
Public Method ViewOffsetDirectionWithUpAxisSets the camera's reference point - the point the camera is looking at. The camera's position is the reference point translated by the direction vector.
Public Method ViewOffsetWithUpAxisSets the camera's reference point - the point the camera is looking at. The camera's position is the reference point translated by the offset.
Public Method ViewRectangularExtentZooms to a rectangular extent composed of west, south, east, north on the centralBody. The camera will be looking straight down at the extent, with the up vector pointing toward local north. The Axes is set to an east-north-up axes at the center of the extent.
Public Method ViewWithUpAxisViews from a point to a point. Sets the camera's position and the reference point the camera is looking at.
Public Method VisibilityTestGets the visibility of a sphere against the view frustum and any occluding central bodies.
Public Method WindowToCartographicConverts a pixel coordinate relative to the globe control to a Cartographic position. For speed, terrain is not considered; if the pixel coordinate does not intersect the ellipsoid, an exception is thrown. Returns the Cartographic position. The array contains the elements of the position in the order latitude, longitude, altitude.

Public Properties

Public Property AllowRotationOverConstrainedUpAxisGets or sets whether the camera can rotate over the constrained up axis. For example, if true the camera would be able to flip over the North Pole and view the globe upside down.
Public Property AxesGets or sets camera's axes of rotation.
Public Property ConstrainedUpAxisGets or sets the axis to constrain the up vector to.
Public Property DirectionGets or sets the direction of the camera in Axes. The array contains the components of the direction arranged in the order x, y, z.
Public Property DistanceGets or sets the distance the camera position is from the reference point.
Public Property DistancePerRadiusReturns the distance that the Camera's Position should be from the ReferencePoint in order to ensure that a sphere with a 1 meter radius centered at the ReferencePoint fits entirely in the view frustum.
Public Property FarNearPlaneRatioGets or sets the value that is used to compute subdivisions of the viewing frustum. A large value will be faster but lose z-value precision. A small value will have better precision but perform slower. The default value of 1000 achieves a good balance between speed and accuracy.
Public Property FarPlaneGets or sets the distance from the camera to the far plane.
Public Property FieldOfViewGets or sets field of view. The field of view is applied to the larger of the window dimensions. For example, if the window width was 640 and the height was 480, the field of view applies to the horizontal. Use Horizontal Field Of View and Vertical Field Of View to get the horizontal and vertical field of views. Wide fields of views generally show more objects but can look distorted as compared to narrower ones.
Public Property HorizontalFieldOfViewGets the horizontal field of view.
Public Property LockViewDirectionGets or sets whether the camera's direction is locked.
Public Property NearPlaneGets or sets the distance from the camera to the near plane.
Public Property PixelSizePerDistanceGets the approximate number of meters covered by a pixel that is 1 meter away from the camera. This is commonly multiplied by the distance from the camera to an object to compute the approximate number of meters covered by a pixel of the object.
Public Property PositionGets or sets the position of the camera. The array contains the components of the position arranged in the order x, y, z.
Public Property PositionReferenceFrameGets the Reference Frame that the Position is returned in. This Reference Frame is composed of the camera's from Point and the Axes.
Public Property ReferencePointGets or sets the reference point of the camera. The array contains the components of the reference point arranged in the order x, y, z.
Public Property ReferencePointReferenceFrameGets the Reference Frame that the Reference Point is returned in. This Reference Frame is composed of the camera's to Point and the Axes.
Public Property SnapshotGets the camera snapshot settings.
Public Property UpVectorGets or sets the up direction of the camera in Axes. The array contains the components of the direction arranged in the order x, y, z.
Public Property VerticalFieldOfViewGets the vertical field of view.
Public Property VideoRecordingGets the camera video recorder.

Example

Change camera view to Imagery Extents
[Python - STK API]
# IAgScenario scenario: Scenario object
# IAgStkGraphicsAGIProcessedImageGlobeOverlay imageryTile: Image Overlay object
manager = scenario.SceneManager
extent = imageryTile.Extent
# Change extent in the default 3D window
manager.Scenes.Item(0).Camera.ViewExtent('Earth', extent)
manager.Render()

Change camera reference frame
[Python - STK API]
# IAgScenario scenario: Scenario object
# IAgStkObjectRoot root: STK Object Model Root
manager = scenario.SceneManager
manager.Scenes.Item(0).Camera.ViewCentralBody('Earth', root.CentralBodies.Earth.Vgt.Axes.Item('Fixed'))
manager.Render()

Change camera view to Imagery Extents
[MATLAB]
% IAgScenario scenario: Scenario object
% IAgStkGraphicsAGIProcessedImageGlobeOverlay imageryTile: Image Overlay object
manager = scenario.SceneManager;
extent = imageryTile.Extent;
% Change extent in the default 3D window
manager.scenes.Item(0).Camera.ViewExtent('Earth', extent);
manager.Render();


        
Camera view object with offset
[MATLAB]
% IAgSatellite satellite: Satellite object
% IAgScenario scenario: Scenario object
axes = satellite.Vgt.Axes.Item('TopoCentric');
point = satellite.Vgt.Points.Item('Center');
offset = {0.0975; 0.0279; 0.0273};
upDirection = {-0.0906; -0.6908; 0.7173};

manager = scenario.SceneManager;
camera = manager.scenes.Item(0).Camera;
camera.ViewOffsetWithUpAxis(axes , point, offset, upDirection);
camera.ConstrainedUpAxis	= 'eStkGraphicsConstrainedUpAxisZ';
camera.FieldOfView = deg2rad(45);
camera.LockViewDirection = false;
manager.Render();


        
Change camera reference frame
[MATLAB]
% IAgScenario scenario: Scenario object
% IAgStkObjectRoot root: STK Object Model Root
manager = scenario.SceneManager;
manager.scenes.Item(0).Camera.ViewCentralBody('Earth', root.CentralBodies.Earth.Vgt.Axes.Item('Fixed'));
manager.Render();


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.