本页内容

InstanceRange QML Type

指定RandomInstancing 的范围。更多内容...

Import Statement: import QtQuick3D.Helpers
Since: Qt 6.2
Inherits:

Object3D

属性

详细说明

InstanceRange QML 类型用于指定RandomInstancing 属性的变化范围。

属性文档

from : Variant

此属性指定了该范围的下限。其类型必须与该范围所应用的属性的类型相匹配。

proportional : bool

此属性决定属性的各个分量是成比例变化还是独立变化。默认值为true ,表示所有分量都是独立的。

例如,以下代码定义了一个在缩放时保持模型纵横比的缩放范围:

InstanceRange {
    from: Qt.vector3d(1, 1, 1)
    to: Qt.vector3d(5, 5, 5)
    proportional: true
}

这定义了一个灰度颜色范围:

InstanceRange {
    from: "black"
    to: "white"
    proportional: true
}

而以下代码定义了一个涵盖所有颜色的范围:

InstanceRange {
    from: "black"
    to: "white"
}

to : Variant

此属性指定了该范围的上限。其类型必须与该范围所适用的属性的类型相匹配。

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