1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
import QtQuick
import QtQuick3D
View3D {
width: 640
height: 480
id: view1
anchors.fill: parent
PerspectiveCamera {
id: camera1
}
Texture {
id: tex1
sourceItem: Rectangle {
width: 256
height: 256
color: "red"
}
}
Texture {
id: tex2
sourceItem: Rectangle {
width: 200
height: 200
color: "blue"
Text {
anchors.centerIn: parent
text: "test"
}
}
}
Rectangle {
id: item1
width: 100
height: 100
color: "green"
}
Texture {
id: tex3
sourceItem: item1
}
Model {
source: "#Cube"
materials: DefaultMaterial {
diffuseMap: tex1
}
}
Model {
source: "#Cube"
materials: DefaultMaterial {
diffuseMap: tex2
}
}
Model {
source: "#Cube"
materials: DefaultMaterial {
diffuseMap: tex3
}
}
Model {
source: "#Cube"
materials: DefaultMaterial {
diffuseMap: Texture {
sourceItem: Item {
width: 400
height: 400
}
}
}
}
}
|