diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2016-01-21 10:07:27 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-01-23 07:45:43 +0000 |
commit | 44b11b5488a03f1b5d426f9e73458eb9cde205c9 (patch) | |
tree | 7fbcc27133e401af66dbc2a99fa6cd630b774ba4 /examples/qt3d/skybox | |
parent | ee59e9fb690da8586b76aa1ab21ec19509fb70f7 (diff) |
skybox: add QInputSettings component
Change-Id: I23d4cec1951d7fce3387198d1043e3da3bfe3e55
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/skybox')
-rw-r--r-- | examples/qt3d/skybox/main.qml | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/examples/qt3d/skybox/main.qml b/examples/qt3d/skybox/main.qml index e8cfdb2cf..fced62a91 100644 --- a/examples/qt3d/skybox/main.qml +++ b/examples/qt3d/skybox/main.qml @@ -36,43 +36,48 @@ import Qt3D.Core 2.0 import Qt3D.Render 2.0 +import Qt3D.Input 2.0 Entity { - id: root + id: root - components: FrameGraph { - ForwardRenderer { - camera: basicCamera - clearColor: "black" - } - } + components: [ + FrameGraph { + ForwardRenderer { + camera: basicCamera + clearColor: "black" + } + }, + // Event Source will be set by the Qt3DQuickWindow + InputSettings { } + ] - Camera { - id: basicCamera - projectionType: CameraLens.PerspectiveProjection - fieldOfView: 60 - aspectRatio: 16/9 - nearPlane: 0.01 - farPlane: 1000.0 - position: Qt.vector3d( 0.0, 0.0, 40.0 ) - viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) - upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) - } + Camera { + id: basicCamera + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 60 + aspectRatio: 16/9 + nearPlane: 0.01 + farPlane: 1000.0 + position: Qt.vector3d( 0.0, 0.0, 40.0 ) + viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) + upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) + } - // So that the camera is rendered always at the same position as the camera - SkyboxEntity { - cameraPosition: basicCamera.position - baseName: "qrc:/assets/cubemaps/miramar/miramar" - extension: ".webp" - } + // So that the camera is rendered always at the same position as the camera + SkyboxEntity { + cameraPosition: basicCamera.position + baseName: "qrc:/assets/cubemaps/miramar/miramar" + extension: ".webp" + } - FirstPersonCameraController { camera: basicCamera } + FirstPersonCameraController { camera: basicCamera } - Entity { - components: [ - SphereMesh { radius: 5 }, - PhongMaterial { diffuse: "dodgerblue" } - ] - } + Entity { + components: [ + SphereMesh { radius: 5 }, + PhongMaterial { diffuse: "dodgerblue" } + ] + } } |