本页内容

AxisHelper QML Type

用于在3D场景中显示3个坐标轴和网格的视觉辅助工具。更多...

Import Statement: import QtQuick3D.Helpers
Inherits:

Node

属性

详细说明

带有RGB轴线、显示坐标系的球体

X 轴为红色,Y 轴为绿色,Z 轴为蓝色。

此示例场景中包含一个位于坐标(0, 0, 0) 的球体以及一个AxisHelper对象。借助WasdController 辅助工具,用户可以方便地在场景中导航。

View3D {
    anchors.fill: parent
    camera: camera

    PerspectiveCamera {
        id: camera
        position: Qt.vector3d(0, 0, 600)
    }

    DirectionalLight {
        position: Qt.vector3d(-500, 500, -100)
        color: Qt.rgba(0.4, 0.2, 0.6, 1.0)
        ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0)
    }

    Model {
        source: "#Sphere"
        materials: [ PrincipledMaterial { } ]
    }

    AxisHelper {
    }
}

WasdController {
    controlledObject: camera
}

属性文档

enableAxisLines : bool [default: true]

启用坐标轴线显示。

enableXYGrid : bool [default: false]

在XY平面上启用网格。

enableXZGrid : bool

/default true 启用 XZ 平面上的网格。

enableYZGrid : bool [default: false]

启用 YZ 平面上的网格。

gridColor : color [default: Qt.rgba(0.8, 0.8, 0.8, 1)]

指定网格的颜色。

gridOpacity : real [default: 0.5]

指定网格的不透明度。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.