AGI STK Graphics 11 Send comments on this topic.
IAgStkGraphicsScene Interface





Description

A Scene provides properties and functionality that are reflected in the rendering of the globe control that it is associated with. An globe control's Scene is available from the Scene property. Any changes that are made to a Scene will only affect the rendering of the particular globe control it is associated with. The static SceneManager class provides global properties and functionality that apply to all Scenes and thus affect the rendering of every globe control. A Scene has a Camera, and various properties for changing the visual state of the scene and its Central Bodies, including changes to Lighting. To render a particular Scene, use the Render method. To render all Scenes, use use the SceneManager.Render method.

Object Model








Public Methods

Public Method Pick Executes a pick at the given x, y and returns a depth sorted collection of picked objects. The coordinate origin is top, left. To pick screen overlays, use the PickScreenOverlays method.
Public Method PickRectangular Executes a pick in the given rectangular region and returns a depth sorted collection of picked objects. The coordinate origin is top, left. To pick screen overlays, use the PickScreenOverlays method.
Public Method PickScreenOverlays Executes a pick on screen overlays at the given x, y and returns a front to back sorted collection of picked overlays. The coordinate origin is top, left. To pick other objects in the scene, use the Pick method.
Public Method Render Renders the scene. To render all the scenes within an application, use the SceneManager.Render method.

Public Properties

Public Property BackgroundColor Gets or sets the background color of the scene.
Public Property Camera Gets the Camera associated with the scene, which affects the view that is rendered by the scene.
Public Property CentralBodies Gets the CentralBodyGraphics for a specified Central Body.
Public Property GlobeOverlaySettings Gets the SceneGlobeOverlaySettings for the scene.
Public Property Lighting Gets the Lighting associated with the scene.
Public Property SceneID Returns the scene identifier.
Public Property ShadeSkyBasedOnAltitude Gets or sets whether the sky will be shaded based on Camera altitude. When Shade Sky Based On Altitude is set to true, the sky will become more blue as the Camera gets closer to the surface of the Central Body.
Public Property ShowStars Gets or sets whether stars are shown or hidden in the scene.
Public Property ShowSunshine Gets or sets whether sunshine is rendered by the Sun Central Body. Sunshine renders a halo effect around the sun when it is viewed in the scene.
Public Property ShowWaterSurface Gets or sets whether water surface on earth is shown or hidden in the scene.

Example

Change view mode to use Earth's fixed frame
[C#] Copy Code
scene.Camera.ViewCentralBody("Earth", root.VgtRoot.WellKnownAxes.Earth.Fixed); 
 

Take a snapshot of the camera's view
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
 
// 
// The snapshot can be saved to a file, texture, image, or the clipboard 
// 
IAgStkGraphicsRendererTexture2D texture = scene.Camera.Snapshot.SaveToTexture(); 
 
IAgStkGraphicsTextureScreenOverlay textureScreenOverlay = manager.Initializers.TextureScreenOverlay.InitializeWithXYTexture(00, texture); 
IAgStkGraphicsOverlay overlay = (IAgStkGraphicsOverlay)textureScreenOverlay; 
overlay.BorderSize = 2
overlay.BorderColor = Color.White; 
overlay.Scale = 0.2
overlay.Origin = AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginCenter; 
IAgStkGraphicsScreenOverlayCollectionBase screenOverlayManager = (IAgStkGraphicsScreenOverlayCollectionBase)manager.ScreenOverlays; 
screenOverlayManager.Add((IAgStkGraphicsScreenOverlay)overlay); 
 

Change view mode to use Earth's fixed frame
[Visual Basic .NET] Copy Code
scene.Camera.ViewCentralBody("Earth", root.VgtRoot.WellKnownAxes.Earth.Fixed)

Take a snapshot of the camera's view
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager

'
' The snapshot can be saved to a file, texture, image, or the clipboard
'
Dim texture As IAgStkGraphicsRendererTexture2D = scene.Camera.Snapshot.SaveToTexture()

Dim overlay As IAgStkGraphicsTextureScreenOverlay = CreateOverlayFromTexture(texture, root)
Dim screenOverlayManager As IAgStkGraphicsScreenOverlayCollectionBase = DirectCast(manager.ScreenOverlays, IAgStkGraphicsScreenOverlayCollectionBase)
screenOverlayManager.Add(DirectCast(overlay, IAgStkGraphicsScreenOverlay))

Control Display of Stars and Water Texture
[MATLAB] Copy Code
% IAgScenario scenario: Scenario object 
% Turn off the stars and water texture 
manager = scenario.SceneManager; 
manager.Scenes.Item(0).ShowStars = false; 
manager.Scenes.Item(0).ShowWaterSurface = false; 
 
 

See Also

CoClasses that Implement IAgStkGraphicsScene

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1