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

该属性指定了范围的上限。类型需要与应用此范围的属性类型相匹配。


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