main.qml Example File
scene3d/main.qml
import QtQuick 2.0
import QtQuick.Scene3D 2.0
Item {
Text {
text: "Click me!"
anchors.top: parent.top
anchors.topMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
MouseArea {
anchors.fill: parent
onClicked: animation.start()
}
}
Text {
text: "Multisample: " + scene3d.multisample
anchors.bottom: parent.bottom
anchors.bottomMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
MouseArea {
anchors.fill: parent
onClicked: scene3d.multisample = !scene3d.multisample
}
}
Rectangle {
id: scene
anchors.fill: parent
anchors.margins: 50
color: "darkRed"
transform: Rotation {
id: sceneRotation
axis.x: 1
axis.y: 0
axis.z: 0
origin.x: scene.width / 2
origin.y: scene.height / 2
}
Scene3D {
id: scene3d
anchors.fill: parent
anchors.margins: 10
focus: true
aspects: ["input", "logic"]
cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
AnimatedEntity {}
}
}
SequentialAnimation {
id: animation
RotationAnimation {
to: 45
duration: 1000
target: sceneRotation
property: "angle"
easing.type: Easing.InOutQuad
}
PauseAnimation { duration: 500 }
NumberAnimation {
to: 0.5
duration: 1000
target: scene
property: "scale"
easing.type: Easing.OutElastic
}
PauseAnimation { duration: 500 }
NumberAnimation {
to: 1.0
duration: 1000
target: scene
property: "scale"
easing.type: Easing.OutElastic
}
PauseAnimation { duration: 500 }
RotationAnimation {
to: 0
duration: 1000
target: sceneRotation
property: "angle"
easing.type: Easing.InOutQuad
}
}
}