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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
import QtQuick
import QtQuick.Window
import QtQuick3D
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
color: "black"
Node {
id: sceneRoot
DirectionalLight {
}
Model {
source: "#Cone"
materials: DefaultMaterial {
}
}
Model {
source: "#Sphere"
z: -100
x: -100
materials: DefaultMaterial {
}
}
Model {
source: "#Cube"
z: 100
x: 100
materials: DefaultMaterial {
}
}
}
View3D {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height * 0.5
importScene: sceneRoot
PerspectiveCamera {
id: perspectiveCamera
z: 600
}
}
View3D {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width * 0.5
height: parent.height * 0.5
importScene: sceneRoot
OrthographicCamera {
id: orthgraphicCamera
z: 600
}
}
View3D {
id: frustumView
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height * 0.5
importScene: sceneRoot
FrustumCamera {
id: frustumCamera
z: 600
top: frustumView.height * 0.05
bottom: frustumView.height * -0.05
right: frustumView.width * 0.05
left: frustumView.width * -0.05
}
}
View3D {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width * 0.5
height: parent.height * 0.5
importScene: sceneRoot
CustomCamera {
id: customCamera
z: 600
projection: Qt.matrix4x4(1.299, 0, 0, 0,
0, 1.732, 0, 0,
0, 0, -1, -20,
0, 0, -1, 0);
}
}
}
|