Scene#

class ansys.stk.core.graphics.Scene#

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…

Overview#

render

Render the scene. To render all the scenes within an application, use the Render method.

pick

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

pick_rectangular

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

pick_screen_overlays

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

subscribe

β€œβ€β€Return an ISceneEventHandler that is subscribed to handle events associated with this instance of Scene.”””

camera

Get the camera associated with the scene, which affects the view that is rendered by the scene.

lighting

Get the lighting associated with the scene.

show_sunshine

Get or set whether sunshine is rendered by the Sun central body. Sunshine renders a halo effect around the sun when it is viewed in the scene.

central_bodies

Get the central body graphics for a specified central body.

background_color

Get or set the background color of the scene.

shade_sky_based_on_altitude

Get or set 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.

show_stars

Get or set whether stars are shown or hidden in the scene.

globe_overlay_settings

Get the scene globe overlay settings for the scene.

scene_id

Return the scene identifier.

show_water_surface

Get or set whether water surface on earth is shown or hidden in the scene.

anti_aliasing

Get or set 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.

visual_effects

Get the visual effects associated with the scene.

clouds

Get the clouds for the scene.

show_star_labels

Get or set whether stars labels are shown or hidden in the scene.

Examples#

Control the Display of Stars and Water Texture

# Scenario scenario: Scenario object
# Turn off the stars and water texture
manager = scenario.scene_manager
manager.scenes.item(0).show_stars = False
manager.scenes.item(0).show_water_surface = False

Import detail#

from ansys.stk.core.graphics import Scene

Property detail#

property Scene.camera: Camera#

Get the camera associated with the scene, which affects the view that is rendered by the scene.

property Scene.lighting: Lighting#

Get the lighting associated with the scene.

property Scene.show_sunshine: bool#

Get or set whether sunshine is rendered by the Sun central body. Sunshine renders a halo effect around the sun when it is viewed in the scene.

property Scene.central_bodies: CentralBodyGraphicsIndexer#

Get the central body graphics for a specified central body.

property Scene.background_color: Color#

Get or set the background color of the scene.

property Scene.shade_sky_based_on_altitude: bool#

Get or set 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.

property Scene.show_stars: bool#

Get or set whether stars are shown or hidden in the scene.

property Scene.globe_overlay_settings: SceneGlobeOverlaySettings#

Get the scene globe overlay settings for the scene.

property Scene.scene_id: int#

Return the scene identifier.

property Scene.show_water_surface: bool#

Get or set whether water surface on earth is shown or hidden in the scene.

property Scene.anti_aliasing: AntiAliasingMethod#

Get or set 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.

property Scene.visual_effects: VisualEffects#

Get the visual effects associated with the scene.

property Scene.clouds: Clouds#

Get the clouds for the scene.

property Scene.show_star_labels: bool#

Get or set whether stars labels are shown or hidden in the scene.

Method detail#

Scene.render(self) None#

Render the scene. To render all the scenes within an application, use the Render method.

Returns:

None

Scene.pick(self, x: int, y: int) PickResultCollection#

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

Parameters:

x : int

y : int

Returns:

PickResultCollection

Scene.pick_rectangular(self, left: int, bottom: int, right: int, top: int) PickResultCollection#

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

Parameters:

left : int

bottom : int

right : int

top : int

Returns:

PickResultCollection

Scene.pick_screen_overlays(self, x: int, y: int) ScreenOverlayPickResultCollection#

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

Parameters:

x : int

y : int

Returns:

ScreenOverlayPickResultCollection