SceneCamera Camera { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Camera property of the ScenePanel class specifies the camera that will be used to render the scene onto the panel. This property is essential for determining the viewpoint and perspective from which the scene is rendered.

Usage

To use the Camera property, you need to assign a SceneCamera object to it. This camera will then be used to render the scene associated with the ScenePanel. Ensure that the camera is properly configured with the desired position, orientation, and settings to achieve the intended rendering effect.

Example

// Create a new ScenePanel
ScenePanel scenePanel = new ScenePanel();

// Create and configure a SceneCamera
SceneCamera camera = new SceneCamera();
camera.Position = new Vector3(0, 0, 10);
camera.Rotation = Rotation.FromAxis(Vector3.Up, 180);

// Assign the camera to the ScenePanel
scenePanel.Camera = camera;

// Optionally, set other properties
scenePanel.RenderOnce = true;
scenePanel.RenderScene = new Scene();