AGI STK Graphics 11 Send 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.

Object Model



Public Methods

Public Method CartographicToWindow Converts 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 TryCartographicToWindow Converts a Cartographic position to a pixel coordinate relative to the globe control. This method does not throw an exception.
Public Method TryWindowToCartographic Converts 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 View Views from a point to a point. Sets the camera's position and the reference point the camera is looking at.
Public Method ViewCentralBody Zoom 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 ViewDirection Views from a point to a direction. Sets the camera's position and the direction vector indicating where the camera is looking.
Public Method ViewDirectionWithUpAxis Views from a point to a direction. Sets the camera's position and the direction vector indicating where the camera is looking.
Public Method ViewExtent Zooms 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 ViewOffset Sets 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 ViewOffsetDirection Sets 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 ViewOffsetDirectionWithUpAxis Sets 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 ViewOffsetWithUpAxis Sets 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 ViewRectangularExtent Zooms 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 ViewWithUpAxis Views from a point to a point. Sets the camera's position and the reference point the camera is looking at.
Public Method VisibilityTest Gets the visibility of a sphere against the view frustum and any occluding central bodies.
Public Method WindowToCartographic Converts 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 AllowRotationOverConstrainedUpAxis Gets 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 Axes Gets or sets camera's axes of rotation.
Public Property ConstrainedUpAxis Gets or sets the axis to constrain the up vector to.
Public Property Direction Gets 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 Distance Gets or sets the distance the camera position is from the reference point.
Public Property DistancePerRadius Returns 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 FarNearPlaneRatio Gets 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 FarPlane Gets or sets the distance in meters from the camera to the far plane.
Public Property FieldOfView Gets or sets field of view in radians. 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 HorizontalFieldOfView Gets the horizontal field of view in radians.
Public Property LockViewDirection Gets or sets whether the camera's direction is locked.
Public Property NearPlane Gets or sets the distance in meters from the camera to the near plane.
Public Property PixelSizePerDistance Gets 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 Position Gets or sets the position of the camera. The array contains the components of the position arranged in the order x, y, z.
Public Property PositionReferenceFrame Gets 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 ReferencePoint Gets 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 ReferencePointReferenceFrame Gets 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 Snapshot Gets the camera snapshot settings.
Public Property UpVector Gets 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 VerticalFieldOfView Gets the vertical field of view in radians.
Public Property VideoRecording Gets the camera video recorder.

Example

Change camera view to Imagery Extents
[MATLAB] Copy Code
% 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] Copy Code
% 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 = 45; 
camera.LockViewDirection = false; 
manager.Render; 
 
 
Change camera reference frame
[MATLAB] Copy Code
% 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; 
 
 
© 2016 All Rights Reserved.

STK Programming Interface 11.0.1