diff options
author | Robert Brock <robert.brock@kdab.com> | 2016-05-09 12:21:09 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-05-15 13:45:19 +0000 |
commit | 9c6230517492b77cc594aef283433c2300467fa2 (patch) | |
tree | a5a34b2e508a94d339dcab4defe10b8810039d59 /examples/qt3d/transforms-qml | |
parent | a8cad56f61c94b0bb8dc6883e697b6619e922642 (diff) |
Moved transforms-qml example to manual test
Part of an examples cleanup
Change-Id: Ie142144a848bfec271fa9a0779e07a022fe79911
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/transforms-qml')
-rw-r--r-- | examples/qt3d/transforms-qml/RenderableEntity.qml | 72 | ||||
-rw-r--r-- | examples/qt3d/transforms-qml/TemporaryCamera.qml | 81 | ||||
-rw-r--r-- | examples/qt3d/transforms-qml/TrefoilKnot.qml | 76 | ||||
-rw-r--r-- | examples/qt3d/transforms-qml/main.cpp | 67 | ||||
-rw-r--r-- | examples/qt3d/transforms-qml/main.qml | 115 | ||||
-rw-r--r-- | examples/qt3d/transforms-qml/transforms-qml.pro | 18 | ||||
-rw-r--r-- | examples/qt3d/transforms-qml/transforms-qml.qrc | 8 |
7 files changed, 0 insertions, 437 deletions
diff --git a/examples/qt3d/transforms-qml/RenderableEntity.qml b/examples/qt3d/transforms-qml/RenderableEntity.qml deleted file mode 100644 index 61e2294a7..000000000 --- a/examples/qt3d/transforms-qml/RenderableEntity.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Entity { - id: root - - property Material material: null - property alias meshSource: mesh.source - property alias translation: transform.translation - property alias rotation: transform.rotation - property alias scale: transform.scale - - components: [ transform, mesh, material ] - - Transform { - id: transform - } - - Mesh { - id: mesh - } -} diff --git a/examples/qt3d/transforms-qml/TemporaryCamera.qml b/examples/qt3d/transforms-qml/TemporaryCamera.qml deleted file mode 100644 index 95f0ab103..000000000 --- a/examples/qt3d/transforms-qml/TemporaryCamera.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Entity { - id: root - - property vector3d pos: Qt.vector3d(0.0, 0.0, 0.0) - property vector3d viewCenter: Qt.vector3d(0.0, 0.0, -10.0) - property vector3d up: Qt.vector3d(0.0, 1.0, 0.0) - - components: [ transform, lens ] - - Transform { - id: transform - - matrix: { - var m = Qt.matrix4x4(); - m.lookAt( root.pos, root.viewCenter, root.up ); - return m; - } - } - - CameraLens { - id: lens - projectionType: CameraLens.PerspectiveProjection - fieldOfView: 45 - aspectRatio: _view.width / _view.height - nearPlane: 0.1 - farPlane: 1000.0 - } -} diff --git a/examples/qt3d/transforms-qml/TrefoilKnot.qml b/examples/qt3d/transforms-qml/TrefoilKnot.qml deleted file mode 100644 index 413b7fe8e..000000000 --- a/examples/qt3d/transforms-qml/TrefoilKnot.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Entity { - id: root - - property vector3d translation: Qt.vector3d(0.0, 0.0, 0.0) - property real scale: 1.0 - property real theta: 0.0 - property real phi: 0.0 - property Material material - - components: [ transform, mesh, root.material ] - - Transform { - id: transform - translation: root.translation - rotation: fromEulerAngles(theta, phi, 0) - scale: root.scale - } - - Mesh { - id: mesh - source: "assets/obj/trefoil.obj" - } -} diff --git a/examples/qt3d/transforms-qml/main.cpp b/examples/qt3d/transforms-qml/main.cpp deleted file mode 100644 index 3487e7bb2..000000000 --- a/examples/qt3d/transforms-qml/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <Qt3DQuickExtras/qt3dquickwindow.h> -#include <Qt3DQuick/QQmlAspectEngine> -#include <QQmlEngine> -#include <QQmlContext> -#include <QGuiApplication> - -int main(int argc, char* argv[]) -{ - QGuiApplication app(argc, argv); - Qt3DExtras::Quick::Qt3DQuickWindow view; - - view.engine()->qmlEngine()->rootContext()->setContextProperty("_view", &view); - view.setSource(QUrl("qrc:/main.qml")); - view.show(); - - return app.exec(); -} diff --git a/examples/qt3d/transforms-qml/main.qml b/examples/qt3d/transforms-qml/main.qml deleted file mode 100644 index f49e161f2..000000000 --- a/examples/qt3d/transforms-qml/main.qml +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 -import Qt3D.Extras 2.0 - -Entity { - id: sceneRoot - - components: [ - RenderSettings { - activeFrameGraph: ForwardRenderer { - clearColor: Qt.rgba(0, 0.5, 1, 1) - camera: camera - } - } - ] - - TemporaryCamera { - id: camera - pos: Qt.vector3d( 0.0, 0.0, 120.0 ) - viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) - up: Qt.vector3d( 0.0, 1.0, 0.0 ) - } - - RenderableEntity { - id: rootEntity - - meshSource: "assets/obj/toyplane.obj" - material: PhongMaterial { - diffuse: "red" - } - - RenderableEntity { - id: trefoil - - translation: Qt.vector3d( 0.0, 20.0, 0.0 ) - scale: 4 - - meshSource: "assets/obj/trefoil.obj" - material: PhongMaterial { - diffuse: "green" - } - - RenderableEntity { - id: ball - - translation: Qt.vector3d( 0.0, 5.0, 0.0 ) - scale: 0.2 - - meshSource: "assets/obj/ball.obj" - material: PhongMaterial { - diffuse: "purple" - } - } - } - } - - TrefoilKnot { - translation: Qt.vector3d( 20, 0, 0 ) - scale: 6.0 - phi: 60.0 - material: PhongMaterial { - diffuse: "grey" - } - } -} diff --git a/examples/qt3d/transforms-qml/transforms-qml.pro b/examples/qt3d/transforms-qml/transforms-qml.pro deleted file mode 100644 index 060ddbd2a..000000000 --- a/examples/qt3d/transforms-qml/transforms-qml.pro +++ /dev/null @@ -1,18 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -QT += 3dcore 3drender 3dinput 3dquick qml quick 3dquickextras - -SOURCES += \ - main.cpp - -OTHER_FILES += \ - main.qml \ - RenderableEntity.qml \ - TemporaryCamera.qml \ - TrefoilKnot.qml - -RESOURCES += \ - transforms-qml.qrc \ - ../exampleresources/obj.qrc diff --git a/examples/qt3d/transforms-qml/transforms-qml.qrc b/examples/qt3d/transforms-qml/transforms-qml.qrc deleted file mode 100644 index 9035959d9..000000000 --- a/examples/qt3d/transforms-qml/transforms-qml.qrc +++ /dev/null @@ -1,8 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>RenderableEntity.qml</file> - <file>TemporaryCamera.qml</file> - <file>TrefoilKnot.qml</file> - </qresource> -</RCC> |