このページでは

GridGeometry QML Type

グリッドをレンダリングするためのカスタムジオメトリプロバイダー。詳細...

Import Statement: import QtQuick3D.Helpers
Inherits:

Geometry

プロパティ

詳細な説明

このヘルパーはグリッドのジオメトリを実装しており、シーン内にグリッドを表示することができます。

たとえば、次のスニペットを実行すると、ライトが 1 つあるシーンに、両方向に 19 セルずつあるグリッドが表示されます。追加の変形を行わない場合、グリッドはデフォルトでカメラの方を向いています。

19×19マスのセルグリッドを備えた、指向性照明付きのカメラ

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 {
        scale: Qt.vector3d(100, 100, 100)
        geometry: GridGeometry {
            horizontalLines: 20
            verticalLines: 20
        }
        materials: [ DefaultMaterial { } ]
    }
}

「 Qt Quick 3D - カスタムジオメトリの例」および「Model 」も参照してください 。

プロパティのドキュメント

horizontalLines : int

グリッド内の水平線の数を指定します。デフォルト値は 1000 です。

horizontalStep : real

水平線間の間隔を指定します。デフォルト値は 0.1 です。

verticalLines : int

グリッド内の縦線の数を指定します。デフォルト値は 1000 です。

verticalStep : real

垂直線間の間隔を指定します。デフォルト値は 0.1 です。

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