AxisHelper QML Type

用于在 3D 场景中显示 3 个坐标轴和网格的可视化助手。更多

Import Statement: import QtQuick3D.Helpers
Inherits:

Node

属性

详细说明

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

示例场景中有一个位于(0, 0, 0) 位置的球体和一个 AxisHelper 对象。通过WasdController helper,可以方便地浏览场景。

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

/启用 XZ 平面上的网格。


enableYZGrid : bool [default: false]

启用 YZ 平面上的网格。


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

指定网格的颜色。


gridOpacity : real [default: 0.5]

指定网格的不透明度。


© 2025 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.