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 scene manager 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 Render method.
Public Methods
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. |
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. |
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. |
Render | Renders the scene. To render all the scenes within an application, use the Render method. |
Public Properties
AntiAliasing | Gets or sets the multisample anti-aliasing (MSAA) option for this scene. As the level of anti-aliasing increases, performance will generally decrease, but the quality of the anti-aliasing will improve. |
BackgroundColor | Gets or sets the background color of the scene. |
Camera | Gets the camera associated with the scene, which affects the view that is rendered by the scene. |
CentralBodies | Gets the central body graphics for a specified central body. |
GlobeOverlaySettings | Gets the scene globe overlay settings for the scene. |
Lighting | Gets the lighting associated with the scene. |
SceneID | Returns the scene identifier. |
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. |
ShowStars | Gets or sets whether stars are shown or hidden in the scene. |
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. |
ShowWaterSurface | Gets or sets whether water surface on earth is shown or hidden in the scene. |
Interfaces
CoClasses that Implement IAgStkGraphicsScene
Example
Change view mode to use Earth's fixed frame
[C#] |
---|
scene.Camera.ViewCentralBody("Earth", root.VgtRoot.WellKnownAxes.Earth.Fixed);
|
|
Take a snapshot of the camera's view
[C#] |
---|
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(0, 0, 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] |
---|
scene.Camera.ViewCentralBody("Earth", root.VgtRoot.WellKnownAxes.Earth.Fixed)
|
|
Take a snapshot of the camera's view
[Visual Basic .NET] |
---|
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
[Python] |
---|
# 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
|
|
Control Display of Stars and Water Texture
[MATLAB] |
---|
% 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