summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-07 13:06:11 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-13 12:23:14 +0000
commit4a63bba7ce76801b8bea1094a7ff16a9f8029b37 (patch)
treec2a212103744ce02b222ed164ce928148c899659 /examples
parent90435d6cd003c727167af002f6e9d02fdd0bb98c (diff)
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 <andy.nichols@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/qgltf/Scene.qml (renamed from examples/qt3d/qgltf/Wine.qml)45
-rw-r--r--examples/qt3d/qgltf/main.qml24
-rw-r--r--examples/qt3d/qgltf/qgltf.pro9
-rw-r--r--examples/qt3d/qgltf/qgltf_example.qrc2
4 files changed, 42 insertions, 38 deletions
diff --git a/examples/qt3d/qgltf/Wine.qml b/examples/qt3d/qgltf/Scene.qml
index b24e9de3f..e6d0e7dd8 100644
--- a/examples/qt3d/qgltf/Wine.qml
+++ b/examples/qt3d/qgltf/Scene.qml
@@ -40,21 +40,34 @@ 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
+ Entity {
+ components: [
+ Transform {
+ translation: Qt.vector3d(-30, 0, 0)
+ rotation: fromEulerAngles(-90, 180, 0)
+ },
+ SceneLoader {
+ source: "qrc:/models/test_scene.qgltf"
+ }
+ ]
+ }
- components: [
- Transform {
- translation: root.position
- rotation: fromEulerAngles(root.angleX, root.angleY, root.angleZ)
- scale: root.scale
- },
- SceneLoader
- {
- source: "qrc:/models/wine.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/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 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
- <file>Wine.qml</file>
+ <file>Scene.qml</file>
</qresource>
</RCC>