TextureData QML Type (Uncreatable)
カスタムテクスチャデータの基本型。詳細...
| Import Statement: | import QtQuick3D |
| In C++: | QQuick3DTextureData |
| Inherits: | |
| Inherited By: |
注:これは作成不可能な型です。QML ではインスタンス化できません。
詳細な説明
カスタムテクスチャデータを使用すると、アプリケーションで生成されたテクスチャデータを利用できます。このデータは動的に変更される場合もあります。カスタムテクスチャデータを使用するには、Texture のtextureData プロパティを設定し、TextureDataオブジェクトを参照するようにします。
カスタムテクスチャデータは、C++でQQuick3DTextureData のインスタンスを作成することで実装されます(多くの場合、これをサブクラス化します)。QQuick3DTextureData 型は、TextureDataという名前でQMLに登録されます。サブクラスがQMLに登録されると、Textureオブジェクトはそれを参照できるようになります。
このAPIを使用する例としては、ファイルから静的な画像を読み込むのではなく、実行時にテクスチャをプロシージャルに生成する必要がある場合などが挙げられます。
import MyCustomTexture 1.0
Model {
source: "#Cube"
materials: [
DefaultMaterial {
diffuseMap: diffuseMapCustomTexture
}
]
}
Texture {
id: diffuseMapCustomTexture
textureData: MyCustomTextureData {
}
}Textureも参照してください 。
© 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.