summaryrefslogtreecommitdiffstats
path: root/examples/quick3d/solarsystem_qml/qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick3d/solarsystem_qml/qml')
-rw-r--r--examples/quick3d/solarsystem_qml/qml/attribution.txt4
-rw-r--r--examples/quick3d/solarsystem_qml/qml/moon-texture.jpgbin111322 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/planet.jpgbin90353 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solar.fsh70
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solar.jpgbin103406 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solar.vsh175
-rwxr-xr-xexamples/quick3d/solarsystem_qml/qml/solar2.jpgbin144007 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml130
8 files changed, 0 insertions, 379 deletions
diff --git a/examples/quick3d/solarsystem_qml/qml/attribution.txt b/examples/quick3d/solarsystem_qml/qml/attribution.txt
deleted file mode 100644
index 28fe61c3..00000000
--- a/examples/quick3d/solarsystem_qml/qml/attribution.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Image files based on textures courtesy of:
-qzma.deviantart.com
-sirius-sdz.deviantart.com
-
diff --git a/examples/quick3d/solarsystem_qml/qml/moon-texture.jpg b/examples/quick3d/solarsystem_qml/qml/moon-texture.jpg
deleted file mode 100644
index b6955e38..00000000
--- a/examples/quick3d/solarsystem_qml/qml/moon-texture.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/planet.jpg b/examples/quick3d/solarsystem_qml/qml/planet.jpg
deleted file mode 100644
index aab7f7b1..00000000
--- a/examples/quick3d/solarsystem_qml/qml/planet.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/solar.fsh b/examples/quick3d/solarsystem_qml/qml/solar.fsh
deleted file mode 100644
index b85bd708..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar.fsh
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation ([email protected])
-**
-** This file is part of the QtQuick3D module 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$
-**
-****************************************************************************/
-
-uniform sampler2D qt_Texture0;
-uniform sampler2D qt_Texture1;
-varying mediump vec4 lightingColor;
-varying highp vec4 texCoord0;
-uniform mediump float glowFactor;
-
-void main(void)
-{
- vec4 unlitColor0 = texture2D(qt_Texture0, texCoord0.st);
- vec4 unlitColor1 = texture2D(qt_Texture1, texCoord0.st);
-
- // interpolate between the two textures
- vec4 unlitColor = mix(unlitColor0, unlitColor1, glowFactor);
-
- // Apply lighting
- vec4 litColor = lightingColor * unlitColor;
- // Normally, we'd just paint this lit colour like so:
-// gl_FragColor = litColor;
-
- // However, we want a cool glow effect, because the sun is generating
- // it's own light.
-
- // Multiplying the color by itself will washing out the darker colours,
- // leaving the brighter colours brighter by comparison
- vec4 powerColor = unlitColor * unlitColor;
- powerColor = powerColor * powerColor ;
-
- // Then combine the higher contrast color and the lit color
- gl_FragColor= mix(litColor, powerColor, glowFactor);
-}
diff --git a/examples/quick3d/solarsystem_qml/qml/solar.jpg b/examples/quick3d/solarsystem_qml/qml/solar.jpg
deleted file mode 100644
index 86f5921a..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/solar.vsh b/examples/quick3d/solarsystem_qml/qml/solar.vsh
deleted file mode 100644
index 420bc701..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar.vsh
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation ([email protected])
-**
-** This file is part of the QtQuick3D module 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$
-**
-****************************************************************************/
-
-attribute highp vec4 qt_Vertex;
-attribute highp vec3 qt_Normal;
-attribute highp vec4 qt_MultiTexCoord0;
-uniform highp mat4 qt_ModelViewProjectionMatrix;
-uniform highp mat4 qt_ModelViewMatrix;
-uniform highp mat3 qt_NormalMatrix;
-varying highp vec4 texCoord0;
-
-// varying values for per-pixel lighting
-varying mediump vec4 lightingColor;
-varying highp vec3 normal;
-varying highp vec3 lightDirection;
-varying highp vec3 halfVector;
-varying highp vec3 vertexToLight;
-
-// Varying values for per-vertex lighting
-varying mediump vec4 litCombinedColor;
-
-// These structs are copied from the QGLShaderProgramEffect documentation
-struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
-};
-uniform qt_MaterialParameters qt_Material;
-
-struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
-};
-uniform qt_SingleLightParameters qt_Light;
-
-// This is a pretty standard lighting function, adapted from QGLLitMaterial.
-// The changes are mostly just renaming to improve readablity, but some
-// unecessary features are removed too (e.g. support for two-sided materials)
-
-void qLightVertex(vec4 vertex, vec3 normal)
-{
- // Start with the material's emissive color and the ambient scene color,
- // which have been combined into the emission parameter.
- vec4 color = qt_Material.emission;
- vec4 scolor = qt_Material.specular;
-
- // Viewer is at infinity.
- vec3 toEye = vec3(0, 0, 1);
-
- // Determine the angle between the normal and the light direction.
- vec4 lightPosition = qt_Light.position;
- vec3 lightDirection;
- if (lightPosition.w == 0.0)
- lightDirection = normalize(lightPosition.xyz);
- else
- lightDirection = normalize(lightPosition.xyz - vertex.xyz);
- // Clean up negative values
- float angle = max(dot(normal, lightDirection), 0.0);
-
- // Calculate the ambient and diffuse light components.
- vec4 adcomponent = qt_Material.ambient + angle * qt_Material.diffuse;
-
- // Calculate the specular light components, in case they're needed for
- // per-vertex lighting.
- vec4 scomponent;
- if (angle != 0.0) {
- halfVector = normalize(lightDirection + toEye);
- angle = max(dot(normal, halfVector), 0.0);
- float srm = qt_Material.shininess;
- vec4 scm = qt_Material.specular;
- if (srm != 0.0)
- scomponent = pow(angle, srm) * scm;
- else
- scomponent = scm;
- } else {
- scomponent = vec4(0, 0, 0, 0);
- }
-
- // Apply the spotlight angle and exponent.
- if (qt_Light.spotCutoff != 180.0) {
- vertexToLight = vertex.xyz - lightPosition.xyz;
- float spot = max(dot(normalize(vertexToLight),
- qt_Light.spotDirection), 0.0);
- if (spot < qt_Light.spotCosCutoff) {
- adcomponent = vec4(0, 0, 0, 0);
- scomponent = vec4(0, 0, 0, 0);
- } else {
- spot = pow(spot, qt_Light.spotExponent);
- adcomponent *= spot;
- scomponent *= spot;
- }
- }
-
- // Apply attenuation to the colors.
- if (lightPosition.w != 0.0) {
- float attenuation = qt_Light.constantAttenuation;
- float k1 = qt_Light.linearAttenuation;
- float k2 = qt_Light.quadraticAttenuation;
- if (k1 != 0.0 || k2 != 0.0) {
- float len = length(lightPosition.xyz - vertex.xyz);
- attenuation += k1 * len + k2 * len * len;
- }
- color += adcomponent / attenuation;
- scolor += scomponent / attenuation;
- } else {
- color += adcomponent;
- scolor += scomponent;
- }
-
- // Generate the final output colors to pass to the fragment shader.
- float alpha = qt_Material.diffuse.a;
- // This is the combined diffuse and ambient lighting color
- lightingColor = vec4(clamp(color.rgb, 0.0, 1.0), alpha);
- // Specular lighting and combined color is used for per vertex lighting if
- // per-pixel is too expensive or not required.
- vec4 specularLightingColor = vec4(clamp(scolor.rgb, 0.0, 1.0), 0.0);
- litCombinedColor = clamp(lightingColor + vec4(specularLightingColor.xyz, 0.0), 0.0, 1.0);
-}
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord0 = qt_MultiTexCoord0;
-
- // Calculate the vertex and normal to use for lighting calculations.
- highp vec4 vertex = qt_ModelViewMatrix * qt_Vertex;
- normal = normalize(qt_NormalMatrix * qt_Normal);
- qLightVertex(vertex,normal);
-}
-
diff --git a/examples/quick3d/solarsystem_qml/qml/solar2.jpg b/examples/quick3d/solarsystem_qml/qml/solar2.jpg
deleted file mode 100755
index 1aa0f02d..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml b/examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml
deleted file mode 100644
index 1b98f89c..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation ([email protected])
-**
-** 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$
-**
-****************************************************************************/
-//! [1]
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- width: 800; height: 600
- showSceneGraph: true
-
- //! [0]
- SphereMesh {
- id: planetoid
- levelOfDetail: 6
- axis: Qt.YAxis
- }
- //! [0]
-
- //! [1]
- Item3D {
- id: sun
- Item3D {
- transform: [ Scale3D { scale: "0.3, 0.3, 0.3" } ]
- mesh: planetoid
- }
- effect: Effect { texture: "solar.jpg" }
- transform: [
- Rotation3D { id: spin; axis: "0,1,0"; angle: 0 }
- ]
- NumberAnimation { target: spin; property: "angle"; to: 360; duration: 10000; running: true; loops: Animation.Infinite }
- }
- //! [1]
- Item3D {
- id: earth_system
- transform: [
- Translation3D { id: earth_orbit_distance; translate: "2,0,0" },
- Rotation3D { id: earth_orbit; axis: "0,1,0"; angle: 0 },
- Rotation3D { id: orbit_tilt; axis: "0,0,1"; angle: 20 }
- ]
- NumberAnimation { target: earth_orbit; property: "angle"; to: 360; duration: 20000;
- running: true; loops: Animation.Infinite }
- Item3D {
- Item3D {
- id: earth
- Item3D {
- transform: [ Scale3D { scale: "0.15, 0.15, 0.15" } ]
- mesh: planetoid
- }
- transform: [
- Rotation3D { id: earth_spin; axis: "0,1,0"; angle: 0 }
- ]
- NumberAnimation { target: earth_spin; property: "angle"; to: 360; duration: 2000;
- running: true; loops: Animation.Infinite }
- effect: Effect { texture: "planet.jpg" }
- }
- Item3D {
- id: moon
- Item3D {
- transform: [ Scale3D { scale: "0.09, 0.09, 0.09" } ]
- mesh: planetoid
- }
- transform: [
- Translation3D { id: moon_orbit_distance; translate: "0.5,0,0" },
- Rotation3D { id: moon_orbit; angle: 0; axis: "0,1,0" },
- Rotation3D { id: moon_orbit_tilt; angle: 90; axis: "1,0,0" }
- ]
- NumberAnimation { target: moon_orbit; property: "angle"; to: 360; duration: 8000;
- running: true; loops: Animation.Infinite }
- effect: Effect { texture: "moon-texture.jpg" }
- }
- }
- }
- Rectangle {
- id: quit
- width: parent.width
- height: parent.height / 8
- color: "blue"
- opacity: 0.5
- Text {
- id: quit_button
- anchors.centerIn: parent
- text: qsTr("Quit")
- font.bold: true
- font.pointSize: 24
- color: "white"
- }
- MouseArea {
- onClicked: Qt.quit()
- anchors.fill: parent
- }
- }
-}