Skip to content

Graphics3DControl class

Renders interactive 3D models with the Vulkan API and lets the user navigate the scene with the mouse and the keyboard.

Namespace: Eremex.AvaloniaUI.Controls3D
Assembly: Eremex.Avalonia.Controls3D.dll
NuGet Package: Eremex.Avalonia.Controls3D

Declaration

public class Graphics3DControl : Graphics3DControlBase, ISceneHolder

Public Members

name description
Graphics3DControl() Initializes a new instance of the Graphics3DControl class.
AllowDefaultLight { get; set; } Gets or sets whether a default light attached to the camera is used when the scene has no lights of its own.
AvailableMultisamplingModes { get; } Gets the multisampling modes supported by the graphics device the control runs on.
AxesCenter { get; set; } Gets or sets the point that the coordinate axes and the grid pass through.
AxisLength { get; set; } Gets or sets the length of the coordinate axes. When no value is set, the axes match the size of the scene.
AxisThickness { get; set; } Gets or sets the width, in pixels, of the coordinate axes.
Camera { get; set; } Gets or sets the camera that defines the view of the scene. When no camera is assigned, the control renders the scene with its own perspective camera.
CompositionMode { get; set; } Gets or sets how the rendered image is combined with the Avalonia compositor.
CoordinateSystem { get; set; } Gets or sets the handedness of the coordinate system in which the scene geometry is defined. The value determines the direction of the camera's Z axis, and therefore the sense of rotation, panning, and zooming.
CullMode { get; set; } Gets or sets which triangle faces are discarded before rasterization.
Exposure { get; set; } Gets or sets the exposure multiplier applied to the image during tone mapping. Larger values make the image brighter.
Gamma { get; set; } Gets or sets the gamma value applied to the image during tone mapping. Larger values make the image brighter.
Gizmo { get; set; } Gets or sets the orientation indicator rendered on top of the control.
GridSpacing { get; set; } Gets or sets the distance between the grid lines. When no value is set, the grid is split into ten equal parts.
GridThickness { get; set; } Gets or sets the width, in pixels, of the grid lines.
HighlightColor { get; set; } Gets or sets the color of the box drawn around the highlighted element.
HighlightedElement { get; set; } Gets or sets the model or mesh under the mouse pointer. It is drawn with the highlight outline.
HighlightMode { get; set; } Gets or sets the level of the scene at which elements are highlighted when the mouse pointer hovers over them.
KeyboardMoveStep { get; set; } Gets or sets the step used to pan the scene with the keyboard. The step is relative to the width of the control and defaults to one tenth of that width.
Lights { get; } Gets the lights that illuminate the models of the scene.
LightsSource { get; set; } Gets or sets the collection used to populate the lights of the control.
LightTemplate { get; set; } Gets or sets the template used to create a light for each item of LightsSource.
Logger { get; set; } Gets or sets the logger that receives the messages produced by the Vulkan renderer.
LogLevel { get; set; } Gets or sets the minimum severity of the messages written to the logger.
LookCameraAtSceneCommand { get; } Gets the command that moves the camera to a predefined view of the scene. Its parameter is a CameraPosition value.
MultisamplingMode { get; set; } Gets or sets the number of samples per pixel used for multisample antialiasing. If the graphics device does not support the value, the closest supported mode is used.
NavigationBindings { get; set; } Gets or sets the keyboard shortcuts that navigate the scene. When null, the control uses its default shortcuts.
RotateStep { get; set; } Gets or sets the sensitivity of mouse-driven rotation. Larger values rotate the scene more slowly.
SelectedElement { get; set; } Gets or sets the selected model or mesh. It is drawn with the selection outline.
SelectionColor { get; set; } Gets or sets the color of the box drawn around the selected element.
SelectionMode { get; set; } Gets or sets the level of the scene at which elements are selected when the user clicks them.
ShowAxes { get; set; } Gets or sets whether the coordinate axes are drawn in the scene.
ShowGrid { get; set; } Gets or sets whether a grid is drawn on the coordinate planes of the scene.
ShowHints { get; set; } Gets or sets whether a tooltip with the hint of the highlighted element is shown.
ShowInfoPanel { get; set; } Gets or sets whether the panel that reports rendering statistics is displayed in the corner of the control.
Skybox { get; set; } Gets or sets the environment map that illuminates the scene and, when visible, forms its background.
ZoomRate { get; set; } Gets or sets the part of the scene size by which the camera moves on a single mouse wheel notch.
Export() Creates a bitmap of the currently rendered image.
HitTest(…) Searches the scene for the model and mesh located under the given point.
LookCameraAtScene(…) Moves the camera to a predefined view of the scene and places it at a distance that fits the scene into the control. (2 methods)

Remarks

The user rotates the scene with the left mouse button, pans it with the right mouse button, and zooms it with the mouse wheel. The keyboard shortcuts are defined by the NavigationBindings property.

See Also

Used in articles