From 0dacd686a106dfe677161e1bb01c2f5780c7540b Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 19 Jan 2016 14:05:21 +0000 Subject: Adapt Scene3D example to use automatic aspect ratio mode Change-Id: Iba759f89d33779a85010a3a1dc915358b24ab033 Reviewed-by: Paul Lemire --- examples/qt3d/scene3d/AnimatedEntity.qml | 15 ++------------- examples/qt3d/scene3d/main.qml | 6 +++--- 2 files changed, 5 insertions(+), 16 deletions(-) (limited to 'examples/qt3d/scene3d') diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml index ba7cf4ff1..c09f48d7a 100644 --- a/examples/qt3d/scene3d/AnimatedEntity.qml +++ b/examples/qt3d/scene3d/AnimatedEntity.qml @@ -47,7 +47,6 @@ Entity { id: camera projectionType: CameraLens.PerspectiveProjection fieldOfView: 45 - aspectRatio: 16/9 nearPlane : 0.1 farPlane : 1000.0 position: Qt.vector3d( 0.0, 0.0, 40.0 ) @@ -59,19 +58,9 @@ Entity { components: [ FrameGraph { - activeFrameGraph: Viewport { - id: viewport - rect: Qt.rect(0.0, 0.0, 1.0, 1.0) // From Top Left + activeFrameGraph: ForwardRenderer { + camera: camera clearColor: "transparent" - - CameraSelector { - id : cameraSelector - camera: camera - - ClearBuffer { - buffers : ClearBuffer.ColorDepthBuffer - } - } } } ] diff --git a/examples/qt3d/scene3d/main.qml b/examples/qt3d/scene3d/main.qml index 6419309a8..9e5dbd0bd 100644 --- a/examples/qt3d/scene3d/main.qml +++ b/examples/qt3d/scene3d/main.qml @@ -64,9 +64,8 @@ Item { Rectangle { id: scene - width: Math.min(parent.width, parent.height) - 100 - height: width - anchors.centerIn: parent + anchors.fill: parent + anchors.margins: 50 color: "darkRed" transform: Rotation { @@ -84,6 +83,7 @@ Item { anchors.margins: 10 focus: true aspects: "input" + cameraAspectRatioMode: Scene3D.AutomaticAspectRatio AnimatedEntity {} } -- cgit v1.2.3