From 4a63bba7ce76801b8bea1094a7ff16a9f8029b37 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 7 Jan 2016 13:06:11 +0100 Subject: Make the qgltf example use other assets Wine is complex and not ideal for a getting started example. Instead, use three of the simpler scenes. Change-Id: I6859714e14c47c4907e85a48cde27d0ea5748ffa Reviewed-by: Andy Nichols --- examples/qt3d/qgltf/Scene.qml | 73 +++++++++++++++++++++++++++++++++++ examples/qt3d/qgltf/Wine.qml | 60 ---------------------------- examples/qt3d/qgltf/main.qml | 24 +++--------- examples/qt3d/qgltf/qgltf.pro | 9 +++-- examples/qt3d/qgltf/qgltf_example.qrc | 2 +- 5 files changed, 86 insertions(+), 82 deletions(-) create mode 100644 examples/qt3d/qgltf/Scene.qml delete mode 100644 examples/qt3d/qgltf/Wine.qml (limited to 'examples') diff --git a/examples/qt3d/qgltf/Scene.qml b/examples/qt3d/qgltf/Scene.qml new file mode 100644 index 000000000..e6d0e7dd8 --- /dev/null +++ b/examples/qt3d/qgltf/Scene.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt3D.Core 2.0 +import Qt3D.Render 2.0 + +Entity { + id: root + + Entity { + components: [ + Transform { + translation: Qt.vector3d(-30, 0, 0) + rotation: fromEulerAngles(-90, 180, 0) + }, + SceneLoader { + source: "qrc:/models/test_scene.qgltf" + } + ] + } + + Entity { + components: [ + SceneLoader { + source: "qrc:/models/toyplane.qgltf" + } + ] + } + + Entity { + components: [ + Transform { + translation: Qt.vector3d(0, -20, 0) + }, + SceneLoader { + source: "qrc:/models/trefoil.qgltf" + } + ] + } +} diff --git a/examples/qt3d/qgltf/Wine.qml b/examples/qt3d/qgltf/Wine.qml deleted file mode 100644 index b24e9de3f..000000000 --- a/examples/qt3d/qgltf/Wine.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Entity { - id: root - - property vector3d position: Qt.vector3d(0, 0, 0) - property real angleX: 0 - property real angleY: 0 - property real angleZ: 0 - property real scale: 1 - - components: [ - Transform { - translation: root.position - rotation: fromEulerAngles(root.angleX, root.angleY, root.angleZ) - scale: root.scale - }, - SceneLoader - { - source: "qrc:/models/wine.qgltf" - } - ] -} diff --git a/examples/qt3d/qgltf/main.qml b/examples/qt3d/qgltf/main.qml index 7f8f081ab..6ee7ae39e 100644 --- a/examples/qt3d/qgltf/main.qml +++ b/examples/qt3d/qgltf/main.qml @@ -48,8 +48,8 @@ Entity { aspectRatio: 16/9 nearPlane : 0.1 farPlane : 1000.0 - position: Qt.vector3d( 0.0, -100.0, -120.0 ) - upVector: Qt.vector3d( 0.0, -1.0, 0.0 ) + position: Qt.vector3d( 0.0, 0.0, 100.0 ) + upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) } @@ -58,24 +58,12 @@ Entity { } components: FrameGraph { - activeFrameGraph : Viewport { - CameraSelector { - camera: camera - ClearBuffer { - buffers: ClearBuffer.ColorDepthBuffer - SortMethod { - criteria: [ - SortCriterion { sort: SortCriterion.BackToFront } - ] - } - } - } + activeFrameGraph: ForwardRenderer { + clearColor: Qt.rgba(0, 0.5, 1, 1) + camera: camera } } - Wine { - id: wineRack - position: Qt.vector3d(-60.0, 0.0, 50.0) - angleX: 180 + Scene { } } diff --git a/examples/qt3d/qgltf/qgltf.pro b/examples/qt3d/qgltf/qgltf.pro index 3ba543ec5..61361b0e6 100644 --- a/examples/qt3d/qgltf/qgltf.pro +++ b/examples/qt3d/qgltf/qgltf.pro @@ -11,10 +11,13 @@ SOURCES += \ OTHER_FILES += \ main.qml \ - Wine.qml + Scene.qml -QT3D_MODELS = ../exampleresources/assets/gltf/wine/wine.dae -QGLTF_PARAMS = -g +QT3D_MODELS = ../exampleresources/assets/test_scene.dae \ + ../exampleresources/assets/obj/toyplane.obj \ + ../exampleresources/assets/obj/trefoil.obj + +QGLTF_PARAMS = -b -S load(qgltf) RESOURCES += \ diff --git a/examples/qt3d/qgltf/qgltf_example.qrc b/examples/qt3d/qgltf/qgltf_example.qrc index 0da7ea21f..72868031a 100644 --- a/examples/qt3d/qgltf/qgltf_example.qrc +++ b/examples/qt3d/qgltf/qgltf_example.qrc @@ -1,6 +1,6 @@ main.qml - Wine.qml + Scene.qml -- cgit v1.2.3