diff options
author | Pasi Keränen <pasi.keranen@qt.io> | 2019-06-06 16:22:02 +0300 |
---|---|---|
committer | Pasi Keränen <pasi.keranen@qt.io> | 2019-06-07 13:52:44 +0300 |
commit | b4954701093739e7a4e54a0669f306922d0d4605 (patch) | |
tree | 73d71319a921234f6b507c9098fdc842f7fe06dc /examples/studio3d/simpleqml | |
parent | 8548a5f5579e3eee7e5ae6b1f6901dcc8bfee19e (diff) |
Long live the slayer!
Initial commit of OpenGL Runtime to repository.
Based on SHA1 61823aaccc6510699a54b34a2fe3f7523dab3b4e
of qt3dstudio repository.
Task-number: QT3DS-3600
Change-Id: Iaeb80237399f0e5656a19ebec9d1ab3a681d8832
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Diffstat (limited to 'examples/studio3d/simpleqml')
16 files changed, 588 insertions, 0 deletions
diff --git a/examples/studio3d/simpleqml/doc/images/simpleqml.png b/examples/studio3d/simpleqml/doc/images/simpleqml.png Binary files differnew file mode 100644 index 0000000..73d9207 --- /dev/null +++ b/examples/studio3d/simpleqml/doc/images/simpleqml.png diff --git a/examples/studio3d/simpleqml/doc/src/simpleqml.qdoc b/examples/studio3d/simpleqml/doc/src/simpleqml.qdoc new file mode 100644 index 0000000..a7dcec7 --- /dev/null +++ b/examples/studio3d/simpleqml/doc/src/simpleqml.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt 3D Studio. +** +** $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 simpleqml + \title Qt 3D Studio Runtime: Simple QML Example + \ingroup OpenGLRuntime-examples-qml + \brief Demonstrates using the Studio3D element in a Qt Quick application. + + \image simpleqml.png + + \e {This example demonstrates basic usage of the Studio3D element in Qt Quick applications} + + \include examples-run.qdocinc + + \section1 Description + + This example consists of a simple C++ main() function that sets up + a QQuickView and a QML scene demonstrating the usage of the \l + Studio3D, \l Presentation, \l DataInput, \l SceneElement, and \l + Element QML types. + + Besides displaying the presentation designed in the Qt 3D Studio + application, a few simple cases of interacting with the scene + (such as, changing 3D object properties via data input, changing + slides, controlling the timeline) are also demonstrated. +*/ diff --git a/examples/studio3d/simpleqml/main.cpp b/examples/studio3d/simpleqml/main.cpp new file mode 100644 index 0000000..f2640b5 --- /dev/null +++ b/examples/studio3d/simpleqml/main.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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 <QtWidgets/QApplication> // for MessageDialog +#include <QtQuick/QQuickView> +#include <qstudio3dglobal.h> + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + qputenv("QSG_INFO", "1"); + QApplication app(argc, argv); + + // Use the ideal format (i.e. OpenGL version and profile) recommended by + // the Qt 3D Studio runtime. Without this the format set on the QQuickView + // would be used instead. + QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); + + QQuickView viewer; + viewer.setSource(QUrl("qrc:/main.qml")); + + viewer.setTitle(QStringLiteral("Qt 3D Studio Example")); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.resize(1280, 720); + viewer.show(); + + return app.exec(); +} diff --git a/examples/studio3d/simpleqml/main.qml b/examples/studio3d/simpleqml/main.qml new file mode 100644 index 0000000..06321a7 --- /dev/null +++ b/examples/studio3d/simpleqml/main.qml @@ -0,0 +1,284 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.0 +import QtStudio3D.OpenGL 2.4 +import QtQuick.Window 2.3 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import Qt.labs.platform 1.0 + +Rectangle { + id: root + color: "lightGray" + + MessageDialog { + id: errorDialog + } + + Studio3D { + id: s3d + focus: true + anchors.margins: 60 + anchors.fill: parent + property string textValue: "hello world" + + Presentation { + id: s3dpres + source: "qrc:/presentation/barrel.uip" + onCustomSignalEmitted: customSignalName.text = Date.now() + ": " + name + onSlideEntered: slideEnter.text = "Entered slide " + name + "(index " + index + ") on " + elementPath + onSlideExited: slideExit.text = "Exited slide " + name + "(index " + index + ") on " + elementPath + + DataInput { + name: "di_text" + value: s3d.textValue + } + + SceneElement { + id: sceneElementForScene + elementPath: "Scene" // could also refer to a Component node instead + onCurrentSlideIndexChanged: console.log("Current slide index for 'Scene': " + currentSlideIndex) + onCurrentSlideNameChanged: console.log("Current slide name for 'Scene': " + currentSlideName) + } + + // Exercise Element a bit. This is no different from using the + // functions on Presentations, just avoids the need to specify the + // name/path repeatedly. + Element { + id: barrelRef + elementPath: "Barrel" // or Scene.Layer.Barrel but as long as it's unique the name's good enough + } + } + ignoredEvents: mouseEvCb.checked ? Studio3D.EnableAllEvents : (Studio3D.IgnoreMouseEvents | Studio3D.IgnoreWheelEvents) + onRunningChanged: console.log("running: " + s3d.running) + onPresentationReady: console.log("presentationReady") + onErrorChanged: { + if (s3d.error !== "") { + errorDialog.text = s3d.error; + errorDialog.open(); + } + } + + property int frameCount: 0 + onFrameUpdate: frameCount += 1 + + Timer { + running: true + repeat: true + interval: 1000 + onTriggered: { + fpsCount.text = "~" + s3d.frameCount + " FPS"; + s3d.frameCount = 0; + } + } + + Timer { + interval: 2000 + running: true + repeat: true + } + + NumberAnimation on opacity { + id: opacityAnimation + from: 1 + to: 0 + duration: 5000 + running: false + onStopped: s3d.opacity = 1 + } + } + + Window { + id: w + visible: false + width: 500 + height: 500 + Item { + id: wroot + anchors.fill: parent + } + title: "Second window" + } + + RowLayout { + Button { + text: "Move to other window" + onClicked: { + w.visible = true; + if (s3d.parent === wroot) s3d.parent = root; else s3d.parent = wroot; + } + focusPolicy: Qt.NoFocus + } + Button { + text: "Open barrel without background" + onClicked: s3dpres.source = "qrc:/presentation/barrel_no_background.uip" + focusPolicy: Qt.NoFocus + } + Button { + text: "Animate opacity" + onClicked: opacityAnimation.running = true + focusPolicy: Qt.NoFocus + } + Button { + text: "Reload" + onClicked: s3dpres.reload() + focusPolicy: Qt.NoFocus + } + Button { + text: "Open" + onClicked: openDialog.open() + focusPolicy: Qt.NoFocus + } + CheckBox { + id: mouseEvCb + text: "Let mouse events through" + checked: true + focusPolicy: Qt.NoFocus + } + Button { + text: "Toggle camera" + onClicked: { + var v = s3dpres.getAttribute("Scene.Layer.Camera", "eyeball") + s3dpres.setAttribute("Scene.Layer.Camera", "eyeball", !v) + } + focusPolicy: Qt.NoFocus + } + Button { + text: "Send new data input value" + property int invocationCount: 0 + onClicked: s3d.textValue = "Data input value " + (++invocationCount) + focusPolicy: Qt.NoFocus + } + } + + Text { + id: fpsCount + text: "0 FPS" + anchors.bottom: parent.bottom + anchors.left: parent.left + } + Text { + id: customSignalName + anchors.bottom: parent.bottom + anchors.left: fpsCount.right + anchors.leftMargin: 8 + } + Text { + id: slideEnter + anchors.bottom: parent.bottom + anchors.left: customSignalName.right + anchors.leftMargin: 8 + } + Text { + id: slideExit + anchors.bottom: parent.bottom + anchors.left: slideEnter.right + anchors.leftMargin: 8 + } + Button { + id: nextSlideByIndex + text: "Next slide (via pres., wrap)" + anchors.left: parent.left + anchors.bottom: fpsCount.top + onClicked: s3dpres.goToSlide("Scene", true, true) + focusPolicy: Qt.NoFocus + } + Button { + id: seekBtn + text: "Seek to 5 seconds (via pres.)" + anchors.left: nextSlideByIndex.right + anchors.bottom: fpsCount.top + onClicked: s3dpres.goToTime("Scene", 5) + focusPolicy: Qt.NoFocus + } + Button { + id: nextSlideViaSceneElement + text: "Next slide (via SceneElement, no wrap)" + anchors.left: seekBtn.right + anchors.bottom: fpsCount.top + onClicked: sceneElementForScene.currentSlideIndex += 1 + focusPolicy: Qt.NoFocus + } + Button { + id: seekBtn2 + text: "Seek to 5 seconds (via SceneElement)" + anchors.left: nextSlideViaSceneElement.right + anchors.bottom: fpsCount.top + onClicked: sceneElementForScene.goToTime(5) + focusPolicy: Qt.NoFocus + } + + Button { + id: profTogBtn + text: "Toggle profile UI" + anchors.right: parent.right + anchors.bottom: parent.bottom + focusPolicy: Qt.NoFocus + onClicked: s3dpres.profileUiVisible = !s3dpres.profileUiVisible + } + Slider { + id: profUiScale + width: profTogBtn.width + anchors.right: profTogBtn.left + anchors.bottom: parent.bottom + from: 50 + to: 400 + value: 100 + focusPolicy: Qt.NoFocus + } + + FileDialog { + id: openDialog + fileMode: FileDialog.OpenFile + nameFilters: ["UIP files (*.uip)", "UIA files (*.uia)", "All files (*)"] + onAccepted: s3dpres.source = file + } +} diff --git a/examples/studio3d/simpleqml/presentation/barrel.uia b/examples/studio3d/simpleqml/presentation/barrel.uia new file mode 100644 index 0000000..d936e42 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/barrel.uia @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<application> + <assets initial="barrel"> + <dataInput name="di_text" type="String"/> + <presentation id="barrel" src="barrel.uip"/> + </assets> + <statemachine ref="#logic"> + <visual-states> + <state ref="Initial"> + <enter> + <goto-slide element="main:Scene" rel="next"/> + </enter> + </state> + </visual-states> + </statemachine> +</application> diff --git a/examples/studio3d/simpleqml/presentation/barrel.uip b/examples/studio3d/simpleqml/presentation/barrel.uip new file mode 100644 index 0000000..48b4edc --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/barrel.uip @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="6" > + <Project > + <ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" > + <CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Graph > + <Scene id="Scene" > + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Model id="Barrel" > + <Material id="Material" > + <Image id="Material_diffusemap" /> + <Image id="Material_normalmap" /> + <Image id="Material_emissivemap" /> + <Image id="Material_specularmap" /> + </Material> + </Model> + <Text id="Text" /> + <Text id="Text2" /> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene" > + <Add ref="#Layer" /> + <Add ref="#Camera" /> + <Add ref="#Light" /> + <State id="Scene-Slide1" name="Slide1" playmode="Looping" > + <Add ref="#Barrel" name="Barrel" position="0 -42 -483" rotation="90 0 0" scale="100 100 100" sourcepath=".\barrel\meshes\Barrel.mesh#1" > + <AnimationTrack property="opacity" type="EaseInOut" /> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 90 100 100 5 64 100 100 10 90 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 5 -302 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 5 0 100 100 10 0 100 100</AnimationTrack> + </Add> + <Add ref="#Material" bumpamount="0" diffuse="1 1 1" diffusemap="#Material_diffusemap" emissivemap="#Material_emissivemap" fresnelPower="25" normalmap="#Material_normalmap" specularamount="4" specularmap="#Material_specularmap" specularmodel="Default" specularroughness="0.001" > + <AnimationTrack property="bumpamount" type="EaseInOut" >0 0 100 100 5 1 100 100</AnimationTrack> + </Add> + <Add ref="#Material_diffusemap" sourcepath=".\maps\barrel_barrel_Diffuse.png" /> + <Add ref="#Material_normalmap" sourcepath=".\maps\barrel_barrel_Normal.png" /> + <Add ref="#Material_emissivemap" sourcepath=".\maps\barrel_barrel_Emissive.png" /> + <Add ref="#Material_specularmap" sourcepath=".\maps\barrel_barrel_Specular.png" /> + <Add ref="#Text" name="Text" font="Arimo-Regular" position="-486.418 297.128 50.5569" textcolor="0 1 0" textstring="Barrel!" tracking="0" > + <AnimationTrack property="opacity" type="EaseInOut" >0 100 100 100 5.009 43.75 100 100 10 100 100 100</AnimationTrack> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 360 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="textcolor.x" type="EaseInOut" >0 0 100 100 5.009 0.501961 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="textcolor.y" type="EaseInOut" >0 1 100 100 5.009 0.235294 100 100 10 1 100 100</AnimationTrack> + <AnimationTrack property="textcolor.z" type="EaseInOut" >0 0 100 100 5.009 0.333333 100 100 10 0 100 100</AnimationTrack> + </Add> + <Add ref="#Text2" name="Text2" controlledproperty="di_text textstring" font="Arimo-Regular" position="435.899 267.025 0" /> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/examples/studio3d/simpleqml/presentation/barrel/barrel.import b/examples/studio3d/simpleqml/presentation/barrel/barrel.import new file mode 100644 index 0000000..cf56bb4 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/barrel/barrel.import @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP Version="1" > + <Project Revision="1" > + <Graph > + <Group id="__import__root__" > + <Model id="Barrel" name="Barrel" orientation="Right Handed" position="0 0 -0" rotation="-90 -0 0" rotationorder="XYZr" scale="100 100 100" sourcepath=".\meshes\Barrel.mesh#1" > + <Material id="Barrel_0001" name="Barrel" blendmode="Normal" diffuse="0.64 0.64 0.64" emissivepower="0" opacity="100" specularamount="0" specularroughness="9.60784" /> + </Model> + </Group> + </Graph> + <Import SrcFile="..\..\..\barrel.fbx" ImageDir="Images" MeshDir="Meshes" > + <Mesh > + <Source >Barrel</Source> + <Dest >.\meshes\Barrel.mesh</Dest> + </Mesh> + </Import> + </Project> +</UIP> diff --git a/examples/studio3d/simpleqml/presentation/barrel/meshes/Barrel.mesh b/examples/studio3d/simpleqml/presentation/barrel/meshes/Barrel.mesh Binary files differnew file mode 100644 index 0000000..1d935a4 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/barrel/meshes/Barrel.mesh diff --git a/examples/studio3d/simpleqml/presentation/barrel_no_background.uip b/examples/studio3d/simpleqml/presentation/barrel_no_background.uip new file mode 100644 index 0000000..aef5ddb --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/barrel_no_background.uip @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="4" > + <Project > + <ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" > + <CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Graph > + <Scene id="Scene" bgcolorenable="False" > + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Model id="Barrel" > + <Material id="Material" > + <Image id="Material_diffusemap" /> + <Image id="Material_normalmap" /> + <Image id="Material_emissivemap" /> + <Image id="Material_specularmap" /> + </Material> + </Model> + <Text id="Text" /> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene" > + <Add ref="#Layer" /> + <Add ref="#Camera" /> + <Add ref="#Light" /> + <State id="Scene-Slide1" name="Slide1" playmode="Looping" > + <Add ref="#Barrel" name="Barrel" position="0 -42 -483" rotation="90 0 0" scale="100 100 100" sourcepath=".\barrel\meshes\Barrel.mesh#1" > + <AnimationTrack property="opacity" type="EaseInOut" /> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 90 100 100 5 64 100 100 10 90 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 5 -302 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 5 0 100 100 10 0 100 100</AnimationTrack> + </Add> + <Add ref="#Material" bumpamount="0" diffusemap="#Material_diffusemap" emissivemap="#Material_emissivemap" fresnelPower="25" normalmap="#Material_normalmap" specularamount="4" specularmap="#Material_specularmap" specularmodel="Default" specularroughness="0.001" > + <AnimationTrack property="bumpamount" type="EaseInOut" >0 0 100 100 5 1 100 100</AnimationTrack> + </Add> + <Add ref="#Material_diffusemap" sourcepath=".\maps\barrel_barrel_Diffuse.png" /> + <Add ref="#Material_normalmap" sourcepath=".\maps\barrel_barrel_Normal.png" /> + <Add ref="#Material_emissivemap" sourcepath=".\maps\barrel_barrel_Emissive.png" /> + <Add ref="#Material_specularmap" sourcepath=".\maps\barrel_barrel_Specular.png" /> + <Add ref="#Text" name="Text" font="Arimo-Regular" position="-486.418 297.128 50.5569" textcolor="0 1 0" textstring="Barrel!" tracking="0" > + <AnimationTrack property="opacity" type="EaseInOut" >0 100 100 100 5.009 43.75 100 100 10 100 100 100</AnimationTrack> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 360 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="textcolor.x" type="EaseInOut" >0 0 100 100 5.009 0.501961 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="textcolor.y" type="EaseInOut" >0 1 100 100 5.009 0.235294 100 100 10 1 100 100</AnimationTrack> + <AnimationTrack property="textcolor.z" type="EaseInOut" >0 0 100 100 5.009 0.333333 100 100 10 0 100 100</AnimationTrack> + </Add> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/examples/studio3d/simpleqml/presentation/fonts/Arimo-Regular.ttf b/examples/studio3d/simpleqml/presentation/fonts/Arimo-Regular.ttf Binary files differnew file mode 100644 index 0000000..720d419 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/fonts/Arimo-Regular.ttf diff --git a/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Diffuse.png b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Diffuse.png Binary files differnew file mode 100644 index 0000000..426f129 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Diffuse.png diff --git a/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Emissive.png b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Emissive.png Binary files differnew file mode 100644 index 0000000..b6be9f3 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Emissive.png diff --git a/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Normal.png b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Normal.png Binary files differnew file mode 100644 index 0000000..4e16c47 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Normal.png diff --git a/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Specular.png b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Specular.png Binary files differnew file mode 100644 index 0000000..1882559 --- /dev/null +++ b/examples/studio3d/simpleqml/presentation/maps/barrel_barrel_Specular.png diff --git a/examples/studio3d/simpleqml/simpleqml.pro b/examples/studio3d/simpleqml/simpleqml.pro new file mode 100644 index 0000000..62afa78 --- /dev/null +++ b/examples/studio3d/simpleqml/simpleqml.pro @@ -0,0 +1,16 @@ +TEMPLATE = app + +QT += widgets qml quick studio3d + +SOURCES += \ + main.cpp + +RESOURCES += simpleqml.qrc + +OTHER_FILES += \ + main.qml \ + doc/src/* \ + doc/images/* + +target.path = $$[QT_INSTALL_EXAMPLES]/studio3d/$$TARGET +INSTALLS += target diff --git a/examples/studio3d/simpleqml/simpleqml.qrc b/examples/studio3d/simpleqml/simpleqml.qrc new file mode 100644 index 0000000..bc843a9 --- /dev/null +++ b/examples/studio3d/simpleqml/simpleqml.qrc @@ -0,0 +1,14 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>presentation/barrel.uip</file> + <file>presentation/barrel.uia</file> + <file>presentation/barrel_no_background.uip</file> + <file>presentation/barrel/meshes/Barrel.mesh</file> + <file>presentation/fonts/Arimo-Regular.ttf</file> + <file>presentation/maps/barrel_barrel_Diffuse.png</file> + <file>presentation/maps/barrel_barrel_Emissive.png</file> + <file>presentation/maps/barrel_barrel_Normal.png</file> + <file>presentation/maps/barrel_barrel_Specular.png</file> + </qresource> +</RCC> |