diff options
Diffstat (limited to 'examples/qt3d/materials')
-rw-r--r-- | examples/qt3d/materials/Barrel.qml | 87 | ||||
-rw-r--r-- | examples/qt3d/materials/BasicCamera.qml | 66 | ||||
-rw-r--r-- | examples/qt3d/materials/Chest.qml | 76 | ||||
-rw-r--r-- | examples/qt3d/materials/HousePlant.qml | 98 | ||||
-rw-r--r-- | examples/qt3d/materials/Lights.qml | 142 | ||||
-rw-r--r-- | examples/qt3d/materials/PlaneEntity.qml | 74 | ||||
-rw-r--r-- | examples/qt3d/materials/RenderableEntity.qml | 76 | ||||
-rw-r--r-- | examples/qt3d/materials/SortedForwardRenderer.qml | 91 | ||||
-rw-r--r-- | examples/qt3d/materials/TrefoilKnot.qml | 79 | ||||
-rw-r--r-- | examples/qt3d/materials/doc/images/materials.png | bin | 29503 -> 0 bytes | |||
-rw-r--r-- | examples/qt3d/materials/doc/src/materials.qdoc | 39 | ||||
-rw-r--r-- | examples/qt3d/materials/main.cpp | 68 | ||||
-rw-r--r-- | examples/qt3d/materials/main.qml | 205 | ||||
-rw-r--r-- | examples/qt3d/materials/materials.pro | 23 | ||||
-rw-r--r-- | examples/qt3d/materials/materials.qrc | 14 |
15 files changed, 0 insertions, 1138 deletions
diff --git a/examples/qt3d/materials/Barrel.qml b/examples/qt3d/materials/Barrel.qml deleted file mode 100644 index 31abd329f..000000000 --- a/examples/qt3d/materials/Barrel.qml +++ /dev/null @@ -1,87 +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: root - - property string diffuseColor: "red" - property string bump: "no_bumps" - property string specular: "" - - property real x: 0 - property real y: 0 - property real z: 0 - property alias shininess: material.shininess - property real scale: 1.0 - - RenderableEntity { - id: barrel - source: "assets/metalbarrel/metal_barrel.obj" - scale: 0.03 * root.scale - position: Qt.vector3d(root.x, root.y, root.z) - - material: NormalDiffuseSpecularMapMaterial { - id: material - ambient: "black" - diffuse: TextureLoader { source: "assets/metalbarrel/diffus_" + root.diffuseColor + ".webp" } //TextureLoader { source: ("assets/metalbarrel/diffus_" + root.diffuseColor + ".webp") } - normal: TextureLoader { source: "assets/metalbarrel/normal_" + root.bump + ".webp" } - specular: TextureLoader { - source: root.specular !== "" ? "assets/metalbarrel/specular_" + root.specular + ".webp" - : "assets/metalbarrel/specular.webp" - } - - shininess: 5.0 - } - } -} diff --git a/examples/qt3d/materials/BasicCamera.qml b/examples/qt3d/materials/BasicCamera.qml deleted file mode 100644 index 9f2ce729b..000000000 --- a/examples/qt3d/materials/BasicCamera.qml +++ /dev/null @@ -1,66 +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 - -Camera { - id: mainCamera - objectName: "mainCamera" - - projectionType: CameraLens.PerspectiveProjection - fieldOfView: 22.5 - aspectRatio: _window.width / _window.height - onAspectRatioChanged: console.log( "aspectRatio = " + aspectRatio ) - nearPlane: 0.01 - farPlane: 1000.0 - viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) - upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) -} diff --git a/examples/qt3d/materials/Chest.qml b/examples/qt3d/materials/Chest.qml deleted file mode 100644 index 227e32864..000000000 --- a/examples/qt3d/materials/Chest.qml +++ /dev/null @@ -1,76 +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: root - - property real x: 0 - property real y: 0 - property real z: 0 - property real scale: 1.0 - - RenderableEntity { - id: chest - source: "assets/chest/Chest.obj" - position: Qt.vector3d(root.x, root.y, root.z) - scale: 0.03 * root.scale - - material: DiffuseMapMaterial { - id: material - diffuse: TextureLoader { source: "assets/chest/diffuse.webp" } - specular: Qt.rgba( 0.2, 0.2, 0.2, 1.0 ) - shininess: 2.0 - } - } -} diff --git a/examples/qt3d/materials/HousePlant.qml b/examples/qt3d/materials/HousePlant.qml deleted file mode 100644 index 7ee810d7f..000000000 --- a/examples/qt3d/materials/HousePlant.qml +++ /dev/null @@ -1,98 +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: root - - property string potShape: "cross" - property string plantType: "bamboo" - - property real x: 0 - property real y: 0 - property real z: 0 - property real scale: 1.0 - - RenderableEntity { - id: pot - source: "assets/houseplants/" + root.potShape + "-pot.obj" - scale: 0.03 * root.scale - position: Qt.vector3d(root.x, root.y, root.z) - - material: NormalDiffuseMapMaterial { - diffuse: TextureLoader { source: "assets/houseplants/pot.webp" } - normal: TextureLoader { source: "assets/houseplants/pot_normal.webp" } - specular: Qt.rgba( 0.75, 0.75, 0.75, 1.0 ) - shininess: 5.0 - } - - RenderableEntity { - source: "assets/houseplants/" + root.potShape + "-" + root.plantType + ".obj" - material: NormalDiffuseMapAlphaMaterial { - diffuse: TextureLoader { source: "assets/houseplants/" + root.plantType + ".webp" } - normal: TextureLoader { source: "assets/houseplants/" + root.plantType + "_normal.webp" } - shininess: 10.0 - } - } - - RenderableEntity { - source: "assets/houseplants/" + root.potShape + "-pot-cover.obj" - material: NormalDiffuseMapMaterial { - diffuse: TextureLoader { source: "assets/houseplants/cover.webp" } - normal: TextureLoader { source: "assets/houseplants/cover_normal.webp" } - specular: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - shininess: 5.0 - } - } - } -} diff --git a/examples/qt3d/materials/Lights.qml b/examples/qt3d/materials/Lights.qml deleted file mode 100644 index efcb2e14e..000000000 --- a/examples/qt3d/materials/Lights.qml +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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 QtQuick 2.1 -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.0 - -Entity { - id: lights - - // Point Light (pulsing) - Entity { - components: [ - PointLight { - color: "red" - intensity: 0.3 - constantAttenuation: 1.0 - linearAttenuation: 0.0 - quadraticAttenuation: 0.0025 - - NumberAnimation on intensity { - from: 0.3; to: 0.8; - running: true - loops: Animation.Infinite - duration: 1000 - easing.type: Easing.CosineCurve - } - }, - Transform { - translation: Qt.vector3d(0.0, 5.0, 0.0) - } - ] - } - - // 2 x Directional Lights (steady) - Entity { - components: [ - DirectionalLight { - worldDirection: Qt.vector3d(0.3, -3.0, 0.0).normalized(); - color: "#fbf9ce" - intensity: 0.3 - } - ] - } - - Entity { - components: [ - DirectionalLight { - worldDirection: Qt.vector3d(-0.3, -0.3, 0.0).normalized(); - color: "#9cdaef" - intensity: 0.15 - } - ] - } - - // Spot Light (sweeping) - Entity { - components: [ - SpotLight { - localDirection: Qt.vector3d(0.0, -1.0, 0.0) - color: "white" - intensity: 0.6 - }, - Transform { - id: spotLightTransform - translation: Qt.vector3d(0.0, 5.0, 0.0) - rotationZ: -60.0 - - - SequentialAnimation { - loops: Animation.Infinite - running: true - - NumberAnimation { - target: spotLightTransform - property: "rotationZ" - from: -60; to: 60 - duration: 2000 - easing.type: Easing.InOutQuad - } - - NumberAnimation { - target: spotLightTransform - property: "rotationZ" - from: 60; to: -60 - duration: 2000 - easing.type: Easing.InOutQuad - } - } - } - ] - } -} diff --git a/examples/qt3d/materials/PlaneEntity.qml b/examples/qt3d/materials/PlaneEntity.qml deleted file mode 100644 index 268c59add..000000000 --- a/examples/qt3d/materials/PlaneEntity.qml +++ /dev/null @@ -1,74 +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: root - property alias position: transform.translation - property alias scale: transform.scale - property alias width: mesh.width - property alias height: mesh.height - property alias resolution: mesh.meshResolution - property Material material - - components: [ transform, mesh, root.material ] - - Transform { id: transform } - - PlaneMesh { - id: mesh - width: 1.0 - height: 1.0 - meshResolution: Qt.size(2, 2) - } -} diff --git a/examples/qt3d/materials/RenderableEntity.qml b/examples/qt3d/materials/RenderableEntity.qml deleted file mode 100644 index d64f75a72..000000000 --- a/examples/qt3d/materials/RenderableEntity.qml +++ /dev/null @@ -1,76 +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 - -Entity { - id: root - - property vector3d position: Qt.vector3d(0, 0, 0) - property real scale: 1.0 - property real rotationAngle: 0.0 - property vector3d rotationAxis: Qt.vector3d(1, 0, 0) - property alias source: mesh.source - property Material material - - components: [ transform, mesh, root.material ] - - Transform { - id: transform - scale: root.scale - rotation: fromAxisAndAngle(root.rotationAxis, root.rotationAngle) - translation: root.position - } - - Mesh { - id: mesh - } -} diff --git a/examples/qt3d/materials/SortedForwardRenderer.qml b/examples/qt3d/materials/SortedForwardRenderer.qml deleted file mode 100644 index e19d9d865..000000000 --- a/examples/qt3d/materials/SortedForwardRenderer.qml +++ /dev/null @@ -1,91 +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 - -TechniqueFilter { - id: root - objectName : "techniqueFilter" - - // Expose camera to allow user to choose which camera to use for rendering - property alias camera: cameraSelector.camera - property alias window: surfaceSelector.surface - - // Select the forward rendering Technique of any used Effect - matchAll: [ FilterKey { name: "renderingStyle"; value: "forward" } ] - - RenderSurfaceSelector { - id: surfaceSelector - - // Use the whole viewport - Viewport { - id: viewport - objectName : "viewport" - normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0) - - // Use the specified camera - CameraSelector { - id : cameraSelector - objectName : "cameraSelector" - ClearBuffers { - buffers : ClearBuffers.ColorDepthBuffer - clearColor: "black" - SortPolicy { - sortTypes: [ - SortPolicy.StateChangeCost, - SortPolicy.Material - ] - } - } - } - } - } -} diff --git a/examples/qt3d/materials/TrefoilKnot.qml b/examples/qt3d/materials/TrefoilKnot.qml deleted file mode 100644 index 2ea1bdea9..000000000 --- a/examples/qt3d/materials/TrefoilKnot.qml +++ /dev/null @@ -1,79 +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 - -Entity { - id: root - - property real x: 0.0 - property real y: 0.0 - property real z: 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: Qt.vector3d(root.x, root.y, root.z) - rotationX: theta - rotationY: phi - scale: root.scale - } - - Mesh { - id: mesh - source: "assets/obj/trefoil.obj" - } -} diff --git a/examples/qt3d/materials/doc/images/materials.png b/examples/qt3d/materials/doc/images/materials.png Binary files differdeleted file mode 100644 index 6e177507e..000000000 --- a/examples/qt3d/materials/doc/images/materials.png +++ /dev/null diff --git a/examples/qt3d/materials/doc/src/materials.qdoc b/examples/qt3d/materials/doc/src/materials.qdoc deleted file mode 100644 index dc8101ef0..000000000 --- a/examples/qt3d/materials/doc/src/materials.qdoc +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example materials - \title Qt 3D: Materials QML Example - \ingroup qt3d-examples-qml - \brief A QML application that demonstrates using materials. - - \image materials.png - - \e {Materials} demonstrates using the Qt 3D material system. - - \include examples-run.qdocinc -*/ diff --git a/examples/qt3d/materials/main.cpp b/examples/qt3d/materials/main.cpp deleted file mode 100644 index faed40390..000000000 --- a/examples/qt3d/materials/main.cpp +++ /dev/null @@ -1,68 +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 <QGuiApplication> -#include <QQmlEngine> -#include <QQmlContext> - -int main(int argc, char* argv[]) -{ - QGuiApplication app(argc, argv); - Qt3DExtras::Quick::Qt3DQuickWindow view; - - // Expose the window as a context property so we can set the aspect ratio - view.engine()->qmlEngine()->rootContext()->setContextProperty("_window", &view); - view.setSource(QUrl("qrc:/main.qml")); - view.show(); - - return app.exec(); -} diff --git a/examples/qt3d/materials/main.qml b/examples/qt3d/materials/main.qml deleted file mode 100644 index c09454065..000000000 --- a/examples/qt3d/materials/main.qml +++ /dev/null @@ -1,205 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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 QtQuick 2.1 -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 -import Qt3D.Input 2.0 -import Qt3D.Extras 2.0 - -Entity { - id: root - objectName: "root" - - // Use the renderer configuration specified in ForwardRenderer.qml - // and render from the mainCamera - components: [ - RenderSettings { - activeFrameGraph: SortedForwardRenderer { - id: renderer - camera: mainCamera - } - }, - // Event Source will be set by the Qt3DQuickWindow - InputSettings { } - ] - - BasicCamera { - id: mainCamera - position: Qt.vector3d( 0.0, 3.5, 25.0 ) - viewCenter: Qt.vector3d( 0.0, 3.5, 0.0 ) - } - - FirstPersonCameraController { camera: mainCamera } - - Lights { } - - PhongMaterial { - id: redAdsMaterial - ambient: Qt.rgba( 0.02, 0.02, 0.02, 1.0 ) - diffuse: Qt.rgba( 0.8, 0.0, 0.0, 1.0 ) - } - - PlaneEntity { - id: floor - - width: 100 - height: 100 - resolution: Qt.size(20, 20) - - material: NormalDiffuseSpecularMapMaterial { - ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - diffuse: TextureLoader { source: "assets/textures/pattern_09/diffuse.webp" } - specular: TextureLoader { source: "assets/textures/pattern_09/specular.webp" } - normal: TextureLoader { source: "assets/textures/pattern_09/normal.webp" } - textureScale: 10.0 - shininess: 10.0 - } - } - - TrefoilKnot { - id: trefoilKnot - material: redAdsMaterial - y: 3.5 - scale: 0.5 - - ParallelAnimation { - loops: Animation.Infinite - running: true - - NumberAnimation { - target: trefoilKnot - property: "theta" - from: 0; to: 360 - duration: 2000 - } - - NumberAnimation { - target: trefoilKnot - property: "phi" - from: 0; to: 360 - duration: 2000 - } - } - } - - Chest { - x: -8 - } - - HousePlant { - x: 4 - potShape: "square" - plantType: "bamboo" - } - - HousePlant { - z: 4 - potShape: "triangle" - plantType: "palm" - } - - HousePlant { - x: -4 - potShape: "sphere" - plantType: "pine" - } - - HousePlant { - z: -4 - potShape: "cross" - plantType: "spikes" - } - - HousePlant { - z: -8 - potShape: "cross" - plantType: "palm" - scale: 1.15 - } - - HousePlant { - z: 8 - potShape: "cross" - plantType: "shrub" - scale: 1.15 - } - - Barrel { - x: 8 - } - - Barrel { - x: 10 - diffuseColor: "rust" - bump: "hard_bumps" - specular: "rust" - } - - Barrel { - x: 12 - diffuseColor: "blue" - bump: "middle_bumps" - } - - Barrel { - x: 14 - diffuseColor: "green" - bump: "soft_bumps" - } - - Barrel { - x: 16 - diffuseColor: "stainless_steel" - bump: "no_bumps" - specular: "stainless_steel" - shininess: 15 - } -} diff --git a/examples/qt3d/materials/materials.pro b/examples/qt3d/materials/materials.pro deleted file mode 100644 index c19361472..000000000 --- a/examples/qt3d/materials/materials.pro +++ /dev/null @@ -1,23 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -QT += 3dcore 3drender 3dinput 3dquick qml quick 3dquickextras - -HEADERS += \ - -SOURCES += \ - main.cpp - -OTHER_FILES += \ - main.qml \ - *.qml \ - HousePlant.qml - -RESOURCES += \ - materials.qrc \ - ../exampleresources/chest.qrc \ - ../exampleresources/houseplants.qrc \ - ../exampleresources/metalbarrel.qrc \ - ../exampleresources/obj.qrc \ - ../exampleresources/textures.qrc diff --git a/examples/qt3d/materials/materials.qrc b/examples/qt3d/materials/materials.qrc deleted file mode 100644 index b984a2778..000000000 --- a/examples/qt3d/materials/materials.qrc +++ /dev/null @@ -1,14 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>BasicCamera.qml</file> - <file>TrefoilKnot.qml</file> - <file>PlaneEntity.qml</file> - <file>RenderableEntity.qml</file> - <file>HousePlant.qml</file> - <file>Barrel.qml</file> - <file>Chest.qml</file> - <file>SortedForwardRenderer.qml</file> - <file>Lights.qml</file> - </qresource> -</RCC> |