diff options
author | Antti Määttä <antti.maatta@qt.io> | 2017-02-07 11:25:02 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2017-02-27 08:19:54 +0000 |
commit | f4601e86d20a39c9d41500bd8378e990f4739506 (patch) | |
tree | 55d010857df4dbd3a62cf285a9dbe0540f9aef01 /examples/qt3d/multiviewport/main.qml | |
parent | 7253d10a1026be03eab83edd628b72455d7bcd28 (diff) |
Update multiviewport example
Change-Id: I57ea393e3abc5de2230f464d612d36a8075fa979
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/multiviewport/main.qml')
-rw-r--r-- | examples/qt3d/multiviewport/main.qml | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/examples/qt3d/multiviewport/main.qml b/examples/qt3d/multiviewport/main.qml index df01bacec..169b694ed 100644 --- a/examples/qt3d/multiviewport/main.qml +++ b/examples/qt3d/multiviewport/main.qml @@ -73,53 +73,57 @@ Entity { id: cameraSet property var cameras: [camera1, camera2, camera3, camera4] - Timer { - running: true - interval: 10000 - repeat: true - property int count: 0 - onTriggered: { - quadViewportFrameGraph.topLeftCamera = cameraSet.cameras[count++ % 4]; - quadViewportFrameGraph.topRightCamera = cameraSet.cameras[count % 4]; - quadViewportFrameGraph.bottomLeftCamera = cameraSet.cameras[(count + 1) % 4]; - quadViewportFrameGraph.bottomRightCamera = cameraSet.cameras[(count + 2) % 4]; - } - } - CameraLens { - id : cameraLens + id: cameraLens projectionType: CameraLens.PerspectiveProjection fieldOfView: 45 aspectRatio: 16/9 - nearPlane : 0.01 - farPlane : 1000.0 + nearPlane: 0.01 + farPlane: 1000.0 + } + CameraLens { + id: cameraLens2 + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 15 + aspectRatio: 16/9 + nearPlane: 0.01 + farPlane: 1000.0 + } + CameraLens { + id: cameraLens3 + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 5 + aspectRatio: 16/9 + nearPlane: 0.01 + farPlane: 1000.0 } SimpleCamera { id: camera1 - lens: cameraLens - position: Qt.vector3d( 0.0, 0.0, -20.0 ) + lens: cameraLens2 + position: Qt.vector3d(10.0, 1.0, 10.0) + viewCenter: Qt.vector3d(0.0, 1.0, 0.0) } SimpleCamera { id: camera2 lens: cameraLens - position: Qt.vector3d( 0.0, 0.0, 20.0 ) - viewCenter: Qt.vector3d( -3.0, 0.0, 10.0 ) + position: Qt.vector3d(0.0, 0.0, 5.0) + viewCenter: Qt.vector3d(0.0, 0.0, 0.0) } SimpleCamera { id: camera3 - lens: cameraLens - position: Qt.vector3d( 0.0, 30.0, 30.0 ) - viewCenter: Qt.vector3d( -5.0, -20.0, -10.0 ) + lens: cameraLens2 + position: Qt.vector3d(30.0, 30.0, 20.0) + viewCenter: Qt.vector3d(0.0, 0.0, -8.0) } SimpleCamera { id: camera4 - lens: cameraLens - position: Qt.vector3d( 0.0, 15.0, 20.0 ) - viewCenter: Qt.vector3d( 0.0, -15.0, -20.0 ) + lens: cameraLens3 + position: Qt.vector3d(100.0, 0.0, -6.0) + viewCenter: Qt.vector3d(0.0, 0.0, -6.0) } } @@ -130,7 +134,7 @@ Entity { SequentialAnimation { running: true loops: Animation.Infinite - NumberAnimation { target: sceneRoot; property: "rotationAngle"; to: 360; duration: 2000; } + NumberAnimation { target: sceneRoot; property: "rotationAngle"; to: 360; duration: 4000; } } Entity { @@ -139,7 +143,7 @@ Entity { rotation: fromAxisAndAngle(Qt.vector3d(0, 0, 1), -sceneRoot.rotationAngle) }, SceneLoader { - source: "qrc:/assets/test_scene.dae" + source: "qrc:/Gear_scene.dae" } ] } |