summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2011-08-15 00:26:17 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-19 11:45:56 +0200
commit589b45ea7106140f81808972c499655a8690bb06 (patch)
tree890c3d26f4a9304958a455f525f8b7a258c36219 /demos
parent7d9baf2b3301e4c8a8f5e1b9772a55754e92720d (diff)
Put the skybox stuff into QML3D.
This skybox functionality was originally written for the photobrowser3d demo. Begin creating a flick3d demo which will eventually replace the photobrowser3d using the network aware url support for textures, and the 3d data models recently implemented. At present all the flickr3d demo does is to display a textured cube inside a skybox. Change-Id: I1d8bbb4a8853b1e39de96d9eab220b198df31707 Reviewed-on: http://codereview.qt.nokia.com/2921 Reviewed-by: Patrick Burke <patrick.burke@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/3249 Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Diffstat (limited to 'demos')
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/flickr3d.qml73
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_down.pngbin0 -> 249343 bytes
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_east.pngbin0 -> 367747 bytes
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_north.pngbin0 -> 331943 bytes
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_south.pngbin0 -> 407823 bytes
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_up.pngbin0 -> 127393 bytes
-rw-r--r--demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_west.pngbin0 -> 362244 bytes
-rw-r--r--demos/quick3d/flickr3d/flickr3d.pro16
-rw-r--r--demos/quick3d/flickr3d/flickr3d.rc1
-rw-r--r--demos/quick3d/flickr3d/m5-robo_bounce.desktop14
-rw-r--r--demos/quick3d/flickr3d/main.cpp69
-rw-r--r--demos/quick3d/flickr3d/qml/flickr3d.qml71
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_down.pngbin0 -> 249343 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_east.pngbin0 -> 367747 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_north.pngbin0 -> 331943 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_south.pngbin0 -> 407823 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_up.pngbin0 -> 127393 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_west.pngbin0 -> 362244 bytes
-rw-r--r--demos/quick3d/flickr3d/qtquick3d.icobin0 -> 51262 bytes
-rw-r--r--demos/quick3d/quick3d.pro2
20 files changed, 245 insertions, 1 deletions
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/flickr3d.qml b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/flickr3d.qml
new file mode 100644
index 000000000..d8d47d620
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/flickr3d.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt3D 1.0
+import Qt3D.Shapes 1.0
+
+Viewport {
+ width: 1024
+ height: 768
+
+ camera: Camera {
+ id: cam
+ property real viewAngle: 0.0
+ eye: Qt.vector3d(Math.sin(cam.viewAngle) * 20.0, 3.0, Math.cos(cam.viewAngle) * 20.0)
+ }
+
+ NumberAnimation {
+ running: true
+ target: cam; property: "viewAngle";
+ from: 0.0; to: 360.0; duration: 2000000;
+ loops: Animation.Infinite
+ }
+
+ Skybox {
+ source: "skybox"
+ }
+
+ Cube {
+ effect: Effect {
+ color: "#aaca00"
+ texture: "qtlogo.png"
+ decal: true
+ }
+ }
+}
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_down.png b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_down.png
new file mode 100644
index 000000000..685c28c4f
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_down.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_east.png b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_east.png
new file mode 100644
index 000000000..f6463abf8
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_east.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_north.png b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_north.png
new file mode 100644
index 000000000..153b833cb
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_north.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_south.png b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_south.png
new file mode 100644
index 000000000..b3b013211
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_south.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_up.png b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_up.png
new file mode 100644
index 000000000..3d4d6233c
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_up.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_west.png b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_west.png
new file mode 100644
index 000000000..14325371b
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.app/Contents/Resources/qml/skybox/default_sky_west.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/flickr3d.pro b/demos/quick3d/flickr3d/flickr3d.pro
new file mode 100644
index 000000000..560660272
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.pro
@@ -0,0 +1,16 @@
+TEMPLATE = app
+TARGET = flickr3d
+CONFIG += qt warn_on
+
+INSTALL_DIRS = qml
+CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
+include(../../../pkg.pri)
+qtcAddDeployment()
+
+SOURCES += main.cpp
+
+OTHER_FILES += \
+ flickr3d.rc
+
+RC_FILE = flickr3d.rc
+
diff --git a/demos/quick3d/flickr3d/flickr3d.rc b/demos/quick3d/flickr3d/flickr3d.rc
new file mode 100644
index 000000000..1b6228c97
--- /dev/null
+++ b/demos/quick3d/flickr3d/flickr3d.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/demos/quick3d/flickr3d/m5-robo_bounce.desktop b/demos/quick3d/flickr3d/m5-robo_bounce.desktop
new file mode 100644
index 000000000..709103d57
--- /dev/null
+++ b/demos/quick3d/flickr3d/m5-robo_bounce.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Name=RoboBounce
+Comment=Qt3D example application
+Exec=/usr/bin/robo_bounce -fullscreen
+Icon=icon-l-qtquick3d
+Terminal=false
+Type=Application
+Categories=Development;
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
+X-Text-Domain=qt3d
+
diff --git a/demos/quick3d/flickr3d/main.cpp b/demos/quick3d/flickr3d/main.cpp
new file mode 100644
index 000000000..c53ea6db1
--- /dev/null
+++ b/demos/quick3d/flickr3d/main.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qdeclarativeview3d.h"
+
+#include "../qmlres.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView3D view;
+ QString qml = q_get_qmldir(QLatin1String("qml/flickr3d.qml"));
+ view.setSource(QUrl::fromLocalFile(qml));
+
+#ifdef Q_OS_SYMBIAN
+ view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
+ view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ view.showFullScreen();
+#else
+ if (QApplication::arguments().contains(QLatin1String("-maximize")))
+ view.showMaximized();
+ else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
+ view.showFullScreen();
+ else
+ view.show();
+#endif
+
+ return app.exec();
+}
diff --git a/demos/quick3d/flickr3d/qml/flickr3d.qml b/demos/quick3d/flickr3d/qml/flickr3d.qml
new file mode 100644
index 000000000..10a9c48ec
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/flickr3d.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+import Qt3D 1.0
+import Qt3D.Shapes 1.0
+
+Viewport {
+ width: 1024
+ height: 768
+
+ camera: Camera {
+ id: cam
+ property real viewAngle: 0.0
+ eye: Qt.vector3d(Math.sin(cam.viewAngle) * 20.0, 3.0, Math.cos(cam.viewAngle) * 20.0)
+ }
+
+ NumberAnimation {
+ running: true
+ target: cam; property: "viewAngle";
+ from: 0.0; to: 360.0; duration: 2000000;
+ loops: Animation.Infinite
+ }
+
+ Skybox {
+ source: "skybox"
+ }
+
+ Cube {
+ effect: Effect {
+ color: "#aaca00"
+ }
+ }
+}
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_down.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_down.png
new file mode 100644
index 000000000..685c28c4f
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/skybox/default_sky_down.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_east.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_east.png
new file mode 100644
index 000000000..f6463abf8
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/skybox/default_sky_east.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_north.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_north.png
new file mode 100644
index 000000000..153b833cb
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/skybox/default_sky_north.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_south.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_south.png
new file mode 100644
index 000000000..b3b013211
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/skybox/default_sky_south.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_up.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_up.png
new file mode 100644
index 000000000..3d4d6233c
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/skybox/default_sky_up.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_west.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_west.png
new file mode 100644
index 000000000..14325371b
--- /dev/null
+++ b/demos/quick3d/flickr3d/qml/skybox/default_sky_west.png
Binary files differ
diff --git a/demos/quick3d/flickr3d/qtquick3d.ico b/demos/quick3d/flickr3d/qtquick3d.ico
new file mode 100644
index 000000000..b3b85e37b
--- /dev/null
+++ b/demos/quick3d/flickr3d/qtquick3d.ico
Binary files differ
diff --git a/demos/quick3d/quick3d.pro b/demos/quick3d/quick3d.pro
index 7c71fa551..0459eb93c 100644
--- a/demos/quick3d/quick3d.pro
+++ b/demos/quick3d/quick3d.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-SUBDIRS = model_viewer robo_bounce tea_service
+SUBDIRS = model_viewer robo_bounce tea_service flickr3d