diff options
Diffstat (limited to 'examples')
26 files changed, 3677 insertions, 70 deletions
diff --git a/examples/examples.pro b/examples/examples.pro index 6d61af094..6a3c01d76 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,5 @@ TEMPLATE = subdirs -SUBDIRS += qt3d + +QT_FOR_CONFIG += 3dcore + +qtConfig(qt3d-extras): SUBDIRS += qt3d diff --git a/examples/qt3d/advancedcustommaterial/shaders/es2/water.frag b/examples/qt3d/advancedcustommaterial/shaders/es2/water.frag index ea54a87f1..f471504fa 100644 --- a/examples/qt3d/advancedcustommaterial/shaders/es2/water.frag +++ b/examples/qt3d/advancedcustommaterial/shaders/es2/water.frag @@ -1,6 +1,8 @@ #define FP highp varying FP vec3 worldPosition; +varying FP vec3 worldNormal; +varying FP vec4 worldTangent; varying FP vec2 texCoord; varying FP vec2 waveTexCoord; varying FP vec2 movtexCoord; @@ -9,7 +11,6 @@ varying FP vec2 skyTexCoord; varying FP vec3 vpos; -varying FP mat3 tangentMatrix; varying FP vec3 color; uniform FP sampler2D diffuseTexture; @@ -23,13 +24,13 @@ uniform FP float offsetx; uniform FP float offsety; uniform FP float specularity; uniform FP float waveStrenght; -uniform FP vec3 ka; -uniform FP vec3 specularColor; +uniform FP vec4 ka; uniform FP float shininess; uniform FP float normalAmount; uniform FP vec3 eyePosition; -#pragma include light.inc.frag +#pragma include phong.inc.frag +#pragma include coordinatesystems.inc void main() { @@ -50,21 +51,24 @@ void main() // 2 Animated Layers of specularTexture mixed with the newCoord FP vec4 specularTextureColor = texture2D( specularTexture, multexCoord+newCoord) + (texture2D( specularTexture, movtexCoord+newCoord )); // 2 Animated Layers of normalTexture mixed with the newCoord - FP vec3 normal = normalAmount * texture2D( normalTexture, movtexCoord+newCoord ).rgb - vec3( 1.0 )+(normalAmount * texture2D( normalTexture, multexCoord+newCoord ).rgb - vec3( 1.0 )); + FP vec3 tNormal = normalAmount * texture2D( normalTexture, movtexCoord+newCoord ).rgb - vec3( 1.0 )+(normalAmount * texture2D( normalTexture, multexCoord+newCoord ).rgb - vec3( 1.0 )); // Animated skyTexture layer FP vec4 skycolor = texture2D(skyTexture, skyTexCoord); skycolor = skycolor * 0.4; //Animated foamTexture layer FP vec4 foamTextureColor = texture2D(foamTexture, texCoord); - // Calculate the lighting model, keeping the specular component separate - FP vec3 diffuseColor, specularColor; - adsModelNormalMapped(worldPosition, normal, eyePosition, shininess, tangentMatrix, diffuseColor, specularColor); + FP mat3 tangentMatrix = calcWorldSpaceToTangentSpaceMatrix(worldNormal, worldTangent); + FP mat3 invertTangentMatrix = transpose(tangentMatrix); - // Combine final fragment color - FP vec4 outputColor = vec4(((skycolor.rgb + ka + diffuseTextureColor.rgb * (diffuseColor))+(specularColor * specularTextureColor.a*specularity)), vpos.y ); + FP vec3 wNormal = normalize(invertTangentMatrix * tNormal); + FP vec3 worldView = normalize(eyePosition - worldPosition); + FP vec4 diffuse = vec4(diffuseTextureColor.rgb, vpos.y); + FP vec4 specular = vec4(specularTextureColor.a*specularity); + FP vec4 outputColor = phongFunction(ka, diffuse, specular, shininess, worldPosition, worldView, wNormal); + outputColor += vec4(skycolor.rgb, vpos.y); outputColor += (foamTextureColor.rgba*vpos.y); gl_FragColor = vec4(outputColor.rgb,1.0); diff --git a/examples/qt3d/advancedcustommaterial/shaders/es2/water.vert b/examples/qt3d/advancedcustommaterial/shaders/es2/water.vert index 1a7d46a46..76dd3f8c0 100644 --- a/examples/qt3d/advancedcustommaterial/shaders/es2/water.vert +++ b/examples/qt3d/advancedcustommaterial/shaders/es2/water.vert @@ -6,12 +6,13 @@ attribute FP vec2 vertexTexCoord; attribute FP vec4 vertexTangent; varying FP vec3 worldPosition; +varying FP vec3 worldNormal; +varying FP vec4 worldTangent; varying FP vec2 texCoord; varying FP vec2 movtexCoord; varying FP vec2 multexCoord; varying FP vec2 waveTexCoord; varying FP vec2 skyTexCoord; -varying FP mat3 tangentMatrix; varying FP vec3 vpos; uniform FP mat4 modelMatrix; @@ -42,25 +43,9 @@ void main() // Transform position, normal, and tangent to world coords worldPosition = vec3(modelMatrix * vec4(vertexPosition, 1.0)); - FP vec3 normal = normalize(modelNormalMatrix * vertexNormal); - FP vec3 tangent = normalize(vec3(modelMatrix * vec4(vertexTangent.xyz, 0.0))); - - // Make the tangent truly orthogonal to the normal by using Gram-Schmidt. - // This allows to build the tangentMatrix below by simply transposing the - // tangent -> world space matrix (which would now be orthogonal) - tangent = normalize(tangent - dot(tangent, normal) * normal); - - // Calculate binormal vector. No "real" need to renormalize it, - // as built by crossing two normal vectors. - // To orient the binormal correctly, use the fourth coordinate of the tangent, - // which is +1 for a right hand system, and -1 for a left hand system. - FP vec3 binormal = cross(normal, tangent) * vertexTangent.w; - - // Construct matrix to transform from eye coords to tangent space - tangentMatrix = mat3( - tangent.x, binormal.x, normal.x, - tangent.y, binormal.y, normal.y, - tangent.z, binormal.z, normal.z); + worldNormal = normalize(modelNormalMatrix * vertexNormal); + worldTangent.xyz = normalize(vec3(modelMatrix * vec4(vertexTangent.xyz, 0.0))); + worldTangent.w = vertexTangent.w; // Calculate animated vertex positions diff --git a/examples/qt3d/advancedcustommaterial/shaders/gl3/water.frag b/examples/qt3d/advancedcustommaterial/shaders/gl3/water.frag index 9657cc63a..6e9722314 100644 --- a/examples/qt3d/advancedcustommaterial/shaders/gl3/water.frag +++ b/examples/qt3d/advancedcustommaterial/shaders/gl3/water.frag @@ -1,6 +1,8 @@ #version 150 core in vec3 worldPosition; +in vec3 worldNormal; +in vec4 worldTangent; in vec2 texCoord; in vec2 waveTexCoord; in vec2 movtexCoord; @@ -9,7 +11,6 @@ in vec2 skyTexCoord; in vec3 vpos; -in mat3 tangentMatrix; in vec3 color; uniform sampler2D diffuseTexture; @@ -23,7 +24,7 @@ uniform float offsetx; uniform float offsety; uniform float specularity; uniform float waveStrenght; -uniform vec3 ka; +uniform vec4 ka; uniform vec3 specularColor; uniform float shininess; uniform float normalAmount; @@ -31,7 +32,8 @@ uniform vec3 eyePosition; out vec4 fragColor; -#pragma include light.inc.frag +#pragma include phong.inc.frag +#pragma include coordinatesystems.inc void main() { @@ -52,21 +54,24 @@ void main() // 2 Animated Layers of specularTexture mixed with the newCoord vec4 specularTextureColor = texture( specularTexture, multexCoord+newCoord) + (texture( specularTexture, movtexCoord+newCoord )); // 2 Animated Layers of normalTexture mixed with the newCoord - vec3 normal = normalAmount * texture( normalTexture, movtexCoord+newCoord ).rgb - vec3( 1.0 )+(normalAmount * texture( normalTexture, multexCoord+newCoord ).rgb - vec3( 1.0 )); + vec3 tNormal = normalAmount * texture( normalTexture, movtexCoord+newCoord ).rgb - vec3( 1.0 )+(normalAmount * texture( normalTexture, multexCoord+newCoord ).rgb - vec3( 1.0 )); // Animated skyTexture layer vec4 skycolor = texture(skyTexture, skyTexCoord); skycolor = skycolor * 0.4; //Animated foamTexture layer vec4 foamTextureColor = texture(foamTexture, texCoord); - // Calculate the lighting model, keeping the specular component separate - vec3 diffuseColor, specularColor; - adsModelNormalMapped(worldPosition, normal, eyePosition, shininess, tangentMatrix, diffuseColor, specularColor); + mat3 tangentMatrix = calcWorldSpaceToTangentSpaceMatrix(worldNormal, worldTangent); + mat3 invertTangentMatrix = transpose(tangentMatrix); - // Combine final fragment color - vec4 outputColor = vec4(((skycolor.rgb + ka + diffuseTextureColor.rgb * (diffuseColor))+(specularColor * specularTextureColor.a*specularity)), vpos.y ); + vec3 wNormal = normalize(invertTangentMatrix * tNormal); + vec3 worldView = normalize(eyePosition - worldPosition); + vec4 diffuse = vec4(diffuseTextureColor.rgb, vpos.y); + vec4 specular = vec4(specularTextureColor.a*specularity); + vec4 outputColor = phongFunction(ka, diffuse, specular, shininess, worldPosition, worldView, wNormal); + outputColor += vec4(skycolor.rgb, vpos.y); outputColor += (foamTextureColor.rgba*vpos.y); fragColor = vec4(outputColor.rgb,1.0); diff --git a/examples/qt3d/advancedcustommaterial/shaders/gl3/water.vert b/examples/qt3d/advancedcustommaterial/shaders/gl3/water.vert index a4ddcf62b..3af37e9a5 100644 --- a/examples/qt3d/advancedcustommaterial/shaders/gl3/water.vert +++ b/examples/qt3d/advancedcustommaterial/shaders/gl3/water.vert @@ -6,12 +6,13 @@ in vec2 vertexTexCoord; in vec4 vertexTangent; out vec3 worldPosition; +out vec3 worldNormal; +out vec4 worldTangent; out vec2 texCoord; out vec2 movtexCoord; out vec2 multexCoord; out vec2 waveTexCoord; out vec2 skyTexCoord; -out mat3 tangentMatrix; out vec3 vpos; uniform mat4 modelMatrix; @@ -42,25 +43,9 @@ void main() // Transform position, normal, and tangent to world coords worldPosition = vec3(modelMatrix * vec4(vertexPosition, 1.0)); - vec3 normal = normalize(modelNormalMatrix * vertexNormal); - vec3 tangent = normalize(vec3(modelMatrix * vec4(vertexTangent.xyz, 0.0))); - - // Make the tangent truly orthogonal to the normal by using Gram-Schmidt. - // This allows to build the tangentMatrix below by simply transposing the - // tangent -> world space matrix (which would now be orthogonal) - tangent = normalize(tangent - dot(tangent, normal) * normal); - - // Calculate binormal vector. No "real" need to renormalize it, - // as built by crossing two normal vectors. - // To orient the binormal correctly, use the fourth coordinate of the tangent, - // which is +1 for a right hand system, and -1 for a left hand system. - vec3 binormal = cross(normal, tangent) * vertexTangent.w; - - // Construct matrix to transform from eye coords to tangent space - tangentMatrix = mat3( - tangent.x, binormal.x, normal.x, - tangent.y, binormal.y, normal.y, - tangent.z, binormal.z, normal.z); + worldNormal = normalize(modelNormalMatrix * vertexNormal); + worldTangent.xyz = normalize(vec3(modelMatrix * vec4(vertexTangent.xyz, 0.0))); + worldTangent.w = vertexTangent.w; // Calculate animated vertex positions diff --git a/examples/qt3d/controls/Logo.qml b/examples/qt3d/controls/Logo.qml index a686e29bd..2eb9abd1a 100644 --- a/examples/qt3d/controls/Logo.qml +++ b/examples/qt3d/controls/Logo.qml @@ -56,6 +56,18 @@ import Qt3D.Extras 2.0 Entity { id: sceneRoot + readonly property double cameraZ: camera.position.z + + function viewAll() { + camera.viewAll() + } + function viewLogo() { + camera.viewEntity(logoEntity) + } + function setPositionZ(z) { + camera.position = Qt.vector3d( 0.0, 0.0, z ) + } + Camera { id: camera projectionType: CameraLens.PerspectiveProjection @@ -63,7 +75,7 @@ Entity { aspectRatio: 4/3 nearPlane : 0.1 farPlane : 1000.0 - position: Qt.vector3d( 0.0, 0.0, viewCenter_z.value ) + position: Qt.vector3d( 0.0, 0.0, 7.5 ) upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) } diff --git a/examples/qt3d/controls/main.qml b/examples/qt3d/controls/main.qml index 2b438ac20..5d1f9c02c 100644 --- a/examples/qt3d/controls/main.qml +++ b/examples/qt3d/controls/main.qml @@ -178,13 +178,20 @@ Item { spacing: 5 Text { text: "Camera"; font.bold: true } - Text { text: "View Center Z" } + Text { text: "View Ctr Z: " + watch.cameraZ.toFixed(2) } Slider { id: viewCenter_z Layout.fillWidth: true minimumValue: 4 maximumValue: 12 value: 7.5 + onValueChanged: watch.setPositionZ(value) + } + Button { + id: viewAll + Layout.fillWidth: true + text: "View All" + onClicked: watch.viewLogo() } } diff --git a/examples/qt3d/exampleresources/assets/envmaps/cedar-bridge/cedar_bridge_irradiance.dds b/examples/qt3d/exampleresources/assets/envmaps/cedar-bridge/cedar_bridge_irradiance.dds Binary files differnew file mode 100644 index 000000000..c08c46301 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/envmaps/cedar-bridge/cedar_bridge_irradiance.dds diff --git a/examples/qt3d/exampleresources/assets/envmaps/cedar-bridge/cedar_bridge_specular.dds b/examples/qt3d/exampleresources/assets/envmaps/cedar-bridge/cedar_bridge_specular.dds Binary files differnew file mode 100644 index 000000000..ac9d49cc2 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/envmaps/cedar-bridge/cedar_bridge_specular.dds diff --git a/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedFigure/RiggedFigure.gltf b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedFigure/RiggedFigure.gltf new file mode 100644 index 000000000..0cbcfd04c --- /dev/null +++ b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedFigure/RiggedFigure.gltf @@ -0,0 +1,2731 @@ +{ + "asset": { + "generator": "COLLADA2GLTF", + "version": "2.0" + }, + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "nodes": [ + { + "children": [ + 21, + 1 + ], + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + -1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ] + }, + { + "mesh": 0, + "skin": 0 + }, + { + "children": [ + 11, + 7, + 3 + ], + "translation": [ + 2.7939699442924854e-9, + -1.4156600514070309e-7, + 0.6860002279281616 + ], + "rotation": [ + 0.03792940452694893, + 0.002913428470492363, + -0.00011058452219003811, + -0.9992762207984924 + ], + "scale": [ + 1.0, + 1.0, + 1.0000001192092896 + ] + }, + { + "children": [ + 4 + ], + "translation": [ + -0.06845717132091522, + 0.004460853058844805, + -0.07147114723920822 + ], + "rotation": [ + -0.02339874766767025, + -0.6542636752128601, + 0.754464864730835, + 0.046630214899778369 + ], + "scale": [ + 1.0, + 1.000000238418579, + 0.9999999403953552 + ] + }, + { + "children": [ + 5 + ], + "translation": [ + 0.0, + 0.2661120891571045, + 1.4901200273698124e-8 + ], + "rotation": [ + 0.21606147289276124, + 0.08108008652925492, + -0.010079992935061457, + -0.9729552268981934 + ], + "scale": [ + 1.0000001192092896, + 1.0, + 1.0 + ] + }, + { + "children": [ + 6 + ], + "translation": [ + -7.450579708745408e-9, + 0.27582409977912905, + -3.725289854372704e-9 + ], + "rotation": [ + 0.8471670746803284, + -0.03204828128218651, + -0.024840382859110837, + -0.5297772288322449 + ], + "scale": [ + 0.9999999403953552, + 1.0, + 1.0 + ] + }, + { + "translation": [ + -0.0014585329918190837, + -0.06619873642921448, + 0.027856800705194478 + ], + "rotation": [ + -0.03414325416088104, + -0.3191778957843781, + 0.9461711049079896, + -0.04146831855177879 + ], + "scale": [ + 0.9999999403953552, + 0.9999997615814208, + 0.9999991655349731 + ] + }, + { + "children": [ + 8 + ], + "translation": [ + 0.06761927157640457, + 0.004461091011762619, + -0.07226461172103882 + ], + "rotation": [ + 0.21088078618049625, + -0.6243308186531067, + 0.724772036075592, + -0.2011117935180664 + ], + "scale": [ + 1.0000001192092896, + 1.000000238418579, + 1.0000001192092896 + ] + }, + { + "children": [ + 9 + ], + "translation": [ + 0.0, + 0.2661122083663941, + 0.0 + ], + "rotation": [ + 0.2111543715000153, + -0.29843246936798098, + -0.04688597097992897, + -0.92959862947464 + ], + "scale": [ + 1.0000001192092896, + 1.0000001192092896, + 0.9999999403953552 + ] + }, + { + "children": [ + 10 + ], + "translation": [ + 0.0, + 0.27582401037216189, + 0.0 + ], + "rotation": [ + 0.8477688431739807, + -0.002281580353155732, + -0.006338709034025669, + -0.530323326587677 + ], + "scale": [ + 1.0, + 1.0, + 1.0000001192092896 + ] + }, + { + "translation": [ + -0.0023464928381145, + -0.06617330759763718, + 0.02785675972700119 + ], + "rotation": [ + 0.024532083421945573, + -0.3199966549873352, + 0.9446004033088684, + 0.06878151744604111 + ], + "scale": [ + 1.0, + 1.0000007152557374, + 1.0000009536743165 + ] + }, + { + "children": [ + 12 + ], + "translation": [ + 0.0009999809553846717, + -4.842879874900064e-8, + 0.1714905947446823 + ], + "rotation": [ + -0.7380747199058533, + -0.001967150717973709, + 0.0021518853027373558, + -0.6747126579284668 + ], + "scale": [ + 1.0000001192092896, + 0.9999999403953552, + 1.0 + ] + }, + { + "children": [ + 19, + 16, + 13 + ], + "translation": [ + 0.0, + 0.2180176973342896, + 3.725289854372704e-9 + ], + "rotation": [ + 0.6378589272499085, + -4.2587172677244209e-10, + -3.5271871534625629e-10, + -0.770153284072876 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0 + ] + }, + { + "children": [ + 14 + ], + "translation": [ + -0.08800055086612702, + -0.0001992879988392815, + -0.0009773969650268557 + ], + "rotation": [ + 0.27643078565597536, + 0.05186379700899124, + -0.665187418460846, + -0.6916804909706116 + ], + "scale": [ + 1.0, + 0.9999999403953552, + 0.9999999403953552 + ] + }, + { + "children": [ + 15 + ], + "translation": [ + -7.450579708745408e-9, + 0.24452559649944304, + -5.96045985901128e-8 + ], + "rotation": [ + -0.2280062586069107, + 0.9096477627754213, + -0.1480233669281006, + -0.31407487392425539 + ], + "scale": [ + 0.9999999403953552, + 0.9999995827674866, + 0.9999998211860656 + ] + }, + { + "translation": [ + -5.96045985901128e-8, + 0.1855168044567108, + 0.0 + ], + "rotation": [ + -0.07854889333248139, + 0.14253509044647218, + -0.014102266170084477, + -0.9865672588348388 + ], + "scale": [ + 1.0000001192092896, + 1.0, + 0.9999999403953552 + ] + }, + { + "children": [ + 17 + ], + "translation": [ + 0.08800055086612702, + -0.0001992879988392815, + -0.0009773969650268557 + ], + "rotation": [ + 0.6789423823356628, + 0.6879449486732483, + -0.24067795276641849, + -0.08856399357318878 + ], + "scale": [ + 1.0000001192092896, + 1.0000004768371585, + 1.0 + ] + }, + { + "children": [ + 18 + ], + "translation": [ + 1.862650034212265e-9, + 0.24452590942382813, + -5.96045985901128e-8 + ], + "rotation": [ + 0.002400061814114452, + -0.13981154561042789, + -0.2718312442302704, + -0.9521317481994628 + ] + }, + { + "translation": [ + 0.0, + 0.1855167001485825, + 0.0 + ], + "rotation": [ + -0.05729063600301743, + -0.02822729200124741, + -0.0555599257349968, + -0.996410608291626 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0000001192092896 + ] + }, + { + "children": [ + 20 + ], + "translation": [ + 0.0, + 7.450579886381094e-8, + 0.05255972966551781 + ], + "rotation": [ + -0.635452151298523, + -1.0367853739773274e-15, + -8.512669473202695e-16, + -0.7721402645111084 + ] + }, + { + "translation": [ + 0.0, + 0.06650590896606446, + 0.0 + ], + "rotation": [ + 4.2157907720330458e-10, + 0.9999844431877136, + -0.005583992227911949, + -7.549667913053783e-8 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0 + ] + }, + { + "children": [ + 2 + ] + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "JOINTS_0": 1, + "NORMAL": 2, + "POSITION": 3, + "WEIGHTS_0": 4 + }, + "indices": 0, + "mode": 4, + "material": 0 + } + ], + "name": "Proxy" + } + ], + "animations": [ + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 2, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 2, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 2, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 5, + "interpolation": "LINEAR", + "output": 6 + }, + { + "input": 5, + "interpolation": "LINEAR", + "output": 7 + }, + { + "input": 5, + "interpolation": "LINEAR", + "output": 8 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 11, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 11, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 11, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 9, + "interpolation": "LINEAR", + "output": 10 + }, + { + "input": 9, + "interpolation": "LINEAR", + "output": 11 + }, + { + "input": 9, + "interpolation": "LINEAR", + "output": 12 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 12, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 12, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 12, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 13, + "interpolation": "LINEAR", + "output": 14 + }, + { + "input": 13, + "interpolation": "LINEAR", + "output": 15 + }, + { + "input": 13, + "interpolation": "LINEAR", + "output": 16 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 19, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 19, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 19, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 17, + "interpolation": "LINEAR", + "output": 18 + }, + { + "input": 17, + "interpolation": "LINEAR", + "output": 19 + }, + { + "input": 17, + "interpolation": "LINEAR", + "output": 20 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 20, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 20, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 20, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 21, + "interpolation": "LINEAR", + "output": 22 + }, + { + "input": 21, + "interpolation": "LINEAR", + "output": 23 + }, + { + "input": 21, + "interpolation": "LINEAR", + "output": 24 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 16, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 16, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 16, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 25, + "interpolation": "LINEAR", + "output": 26 + }, + { + "input": 25, + "interpolation": "LINEAR", + "output": 27 + }, + { + "input": 25, + "interpolation": "LINEAR", + "output": 28 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 17, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 17, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 17, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 29, + "interpolation": "LINEAR", + "output": 30 + }, + { + "input": 29, + "interpolation": "LINEAR", + "output": 31 + }, + { + "input": 29, + "interpolation": "LINEAR", + "output": 32 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 18, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 18, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 18, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 33, + "interpolation": "LINEAR", + "output": 34 + }, + { + "input": 33, + "interpolation": "LINEAR", + "output": 35 + }, + { + "input": 33, + "interpolation": "LINEAR", + "output": 36 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 13, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 13, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 13, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 37, + "interpolation": "LINEAR", + "output": 38 + }, + { + "input": 37, + "interpolation": "LINEAR", + "output": 39 + }, + { + "input": 37, + "interpolation": "LINEAR", + "output": 40 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 14, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 14, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 14, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 41, + "interpolation": "LINEAR", + "output": 42 + }, + { + "input": 41, + "interpolation": "LINEAR", + "output": 43 + }, + { + "input": 41, + "interpolation": "LINEAR", + "output": 44 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 15, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 15, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 15, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 45, + "interpolation": "LINEAR", + "output": 46 + }, + { + "input": 45, + "interpolation": "LINEAR", + "output": 47 + }, + { + "input": 45, + "interpolation": "LINEAR", + "output": 48 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 7, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 7, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 7, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 49, + "interpolation": "LINEAR", + "output": 50 + }, + { + "input": 49, + "interpolation": "LINEAR", + "output": 51 + }, + { + "input": 49, + "interpolation": "LINEAR", + "output": 52 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 8, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 8, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 8, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 53, + "interpolation": "LINEAR", + "output": 54 + }, + { + "input": 53, + "interpolation": "LINEAR", + "output": 55 + }, + { + "input": 53, + "interpolation": "LINEAR", + "output": 56 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 9, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 9, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 9, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 57, + "interpolation": "LINEAR", + "output": 58 + }, + { + "input": 57, + "interpolation": "LINEAR", + "output": 59 + }, + { + "input": 57, + "interpolation": "LINEAR", + "output": 60 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 10, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 10, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 10, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 61, + "interpolation": "LINEAR", + "output": 62 + }, + { + "input": 61, + "interpolation": "LINEAR", + "output": 63 + }, + { + "input": 61, + "interpolation": "LINEAR", + "output": 64 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 3, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 3, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 3, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 65, + "interpolation": "LINEAR", + "output": 66 + }, + { + "input": 65, + "interpolation": "LINEAR", + "output": 67 + }, + { + "input": 65, + "interpolation": "LINEAR", + "output": 68 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 4, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 4, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 4, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 69, + "interpolation": "LINEAR", + "output": 70 + }, + { + "input": 69, + "interpolation": "LINEAR", + "output": 71 + }, + { + "input": 69, + "interpolation": "LINEAR", + "output": 72 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 5, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 5, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 5, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 73, + "interpolation": "LINEAR", + "output": 74 + }, + { + "input": 73, + "interpolation": "LINEAR", + "output": 75 + }, + { + "input": 73, + "interpolation": "LINEAR", + "output": 76 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 6, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 6, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 6, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 77, + "interpolation": "LINEAR", + "output": 78 + }, + { + "input": 77, + "interpolation": "LINEAR", + "output": 79 + }, + { + "input": 77, + "interpolation": "LINEAR", + "output": 80 + } + ] + } + ], + "skins": [ + { + "inverseBindMatrices": 81, + "skeleton": 2, + "joints": [ + 2, + 11, + 12, + 19, + 20, + 16, + 13, + 17, + 14, + 18, + 15, + 7, + 3, + 8, + 4, + 9, + 5, + 10, + 6 + ], + "name": "Armature" + } + ], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5123, + "count": 768, + "max": [ + 369 + ], + "min": [ + 0 + ], + "type": "SCALAR" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5123, + "count": 370, + "max": [ + 18, + 18, + 18, + 18 + ], + "min": [ + 0, + 0, + 0, + 0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 370, + "max": [ + 1.0, + 1.0, + 1.0 + ], + "min": [ + -1.0, + -1.0, + -1.0 + ], + "type": "VEC3" + }, + { + "bufferView": 2, + "byteOffset": 4440, + "componentType": 5126, + "count": 370, + "max": [ + 0.5894609689712524, + 0.13091780245304109, + 1.4499199390411378 + ], + "min": [ + -0.5894609689712524, + -0.19497710466384889, + 0.0 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 370, + "max": [ + 1.0, + 0.9893189072608948, + 0.9037013053894044, + 0.6776750087738037 + ], + "min": [ + 0.010514849796891213, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 2, + "max": [ + 4.5896600409101037e-10, + -1.1506600117172641e-7, + 0.6860000491142273 + ], + "min": [ + 4.5896600409101037e-10, + -1.1506600117172641e-7, + 0.6860000491142273 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 2, + "max": [ + 0.03792992979288101, + 0.0029135500080883505, + -0.00011340532364556566, + -0.9992762804031372 + ], + "min": [ + 0.03792992979288101, + 0.0029135500080883505, + -0.00011340532364556566, + -0.9992762804031372 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 24, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000001192092896, + 1.000000238418579, + 1.0000004768371585 + ], + "min": [ + 1.0000001192092896, + 1.000000238418579, + 1.0000004768371585 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 8, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 48, + "componentType": 5126, + "count": 2, + "max": [ + 0.0009999829344451428, + -1.8626499453944239e-8, + 0.17149099707603458 + ], + "min": [ + 0.0009999829344451428, + -1.8626499453944239e-8, + 0.17149099707603458 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 32, + "componentType": 5126, + "count": 2, + "max": [ + -0.7380743026733398, + -0.001967150252312422, + 0.0021518832072615625, + -0.6747127175331116 + ], + "min": [ + -0.7380743026733398, + -0.001967150252312422, + 0.0021518832072615625, + -0.6747127175331116 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 72, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000001192092896, + 0.9999994039535524, + 0.999999463558197 + ], + "min": [ + 1.0000001192092896, + 0.9999994039535524, + 0.999999463558197 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 16, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 96, + "componentType": 5126, + "count": 2, + "max": [ + -7.105429898699844e-15, + 0.2180179059505463, + -1.862650034212265e-9 + ], + "min": [ + -7.105429898699844e-15, + 0.2180179059505463, + -1.862650034212265e-9 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 64, + "componentType": 5126, + "count": 2, + "max": [ + 0.6378593444824219, + -4.2613501616273199e-10, + -3.5284211663544337e-10, + -0.7701532244682312 + ], + "min": [ + 0.6378593444824219, + -4.2613501616273199e-10, + -3.5284211663544337e-10, + -0.7701532244682312 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 120, + "componentType": 5126, + "count": 2, + "max": [ + 1.0, + 1.0000005960464478, + 1.0000005960464478 + ], + "min": [ + 1.0, + 1.0000005960464478, + 1.0000005960464478 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 24, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 144, + "componentType": 5126, + "count": 2, + "max": [ + -8.881779961836516e-15, + -1.4901200273698124e-8, + 0.05255949124693871 + ], + "min": [ + -8.881779961836516e-15, + -4.470349779239769e-8, + 0.05255937948822975 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 96, + "componentType": 5126, + "count": 2, + "max": [ + -0.6354526877403259, + 6.392766871421429e-11, + 1.0194381688637123e-13, + -0.6865020394325256 + ], + "min": [ + -0.7271280288696289, + 1.2045594556531206e-13, + -1.964862994530137e-11, + -0.7721399664878845 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 168, + "componentType": 5126, + "count": 2, + "max": [ + 1.0, + 1.000000238418579, + 1.000000238418579 + ], + "min": [ + 1.0, + 1.000000238418579, + 1.000000238418579 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 32, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 192, + "componentType": 5126, + "count": 2, + "max": [ + -5.329069671167804e-15, + 0.06650590896606446, + 9.313230187046884e-10 + ], + "min": [ + -5.329069671167804e-15, + 0.06650590896606446, + 9.313230187046884e-10 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 128, + "componentType": 5126, + "count": 2, + "max": [ + 6.65661192833511e-10, + 0.999984323978424, + 0.03202660754323006, + -1.1911986064205849e-7 + ], + "min": [ + -5.476959996641995e-10, + 0.9994869232177734, + -0.005583993159234524, + -1.1920712950086455e-7 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 216, + "componentType": 5126, + "count": 2, + "max": [ + 1.0, + 0.9999995827674866, + 0.9999995827674866 + ], + "min": [ + 1.0, + 0.9999995231628418, + 0.9999995231628418 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 40, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 240, + "componentType": 5126, + "count": 2, + "max": [ + 0.08800006657838822, + -0.00019977999909315256, + -0.0009799000108614565 + ], + "min": [ + 0.08799991011619568, + -0.0001997949875658378, + -0.00098002003505826 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 160, + "componentType": 5126, + "count": 2, + "max": [ + 0.6789432764053345, + 0.6879453063011169, + -0.2406750321388245, + -0.08856184780597687 + ], + "min": [ + 0.6182979345321655, + 0.5380411744117737, + -0.4743711948394776, + -0.32123467326164248 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 264, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000004768371585, + 1.000000238418579, + 1.000000238418579 + ], + "min": [ + 1.0000001192092896, + 1.0000001192092896, + 1.0000001192092896 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 48, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 288, + "componentType": 5126, + "count": 2, + "max": [ + -2.328309989252375e-9, + 0.24452580511569978, + 0.0 + ], + "min": [ + -2.328309989252375e-9, + 0.24452580511569978, + 0.0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 192, + "componentType": 5126, + "count": 2, + "max": [ + 0.002399991732090712, + -0.13981157541275025, + -0.2718312740325928, + -0.9521315693855286 + ], + "min": [ + 0.002399991732090712, + -0.13981160521507264, + -0.2718312740325928, + -0.9521315693855286 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 312, + "componentType": 5126, + "count": 2, + "max": [ + 0.9999995231628418, + 0.9999997615814208, + 1.0000003576278689 + ], + "min": [ + 0.999999463558197, + 0.9999997615814208, + 1.0000003576278689 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 56, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 336, + "componentType": 5126, + "count": 2, + "max": [ + 0.0, + 0.1855167001485825, + 5.96045985901128e-8 + ], + "min": [ + 0.0, + 0.1855167001485825, + 5.96045985901128e-8 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 224, + "componentType": 5126, + "count": 2, + "max": [ + -0.05729068815708161, + -0.028227226808667184, + -0.055560123175382617, + -0.996410608291626 + ], + "min": [ + -0.05729068815708161, + -0.028227226808667184, + -0.055560123175382617, + -0.996410608291626 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 360, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000001192092896, + 1.0000001192092896, + 0.9999995827674866 + ], + "min": [ + 1.0000001192092896, + 1.0000001192092896, + 0.9999995827674866 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 64, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 384, + "componentType": 5126, + "count": 2, + "max": [ + -0.08799999207258225, + -0.0001997949875658378, + -0.00098002003505826 + ], + "min": [ + -0.08800006657838822, + -0.0001997949875658378, + -0.00098002003505826 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 256, + "componentType": 5126, + "count": 2, + "max": [ + 0.49575817584991457, + 0.3092453181743622, + -0.5336208343505859, + -0.6114243268966675 + ], + "min": [ + 0.2764261960983277, + 0.05186334997415543, + -0.6651891469955444, + -0.6916805505752564 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 408, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000001192092896, + 0.9999996423721314, + 0.9999999403953552 + ], + "min": [ + 1.0, + 0.9999995231628418, + 0.9999997615814208 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 72, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 432, + "componentType": 5126, + "count": 2, + "max": [ + -7.450579708745408e-9, + 0.24452559649944304, + 0.0 + ], + "min": [ + -7.450579708745408e-9, + 0.24452559649944304, + 0.0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 288, + "componentType": 5126, + "count": 2, + "max": [ + -0.22800640761852265, + 0.9096475839614868, + -0.1480235904455185, + -0.3140750825405121 + ], + "min": [ + -0.2280064970254898, + 0.909647524356842, + -0.14802362024784089, + -0.31407514214515688 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 456, + "componentType": 5126, + "count": 2, + "max": [ + 0.9999998807907105, + 0.9999995231628418, + 0.9999998807907105 + ], + "min": [ + 0.9999998211860656, + 0.9999993443489076, + 0.9999998211860656 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 80, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 480, + "componentType": 5126, + "count": 2, + "max": [ + 0.0, + 0.1855168044567108, + 0.0 + ], + "min": [ + 0.0, + 0.1855168044567108, + 0.0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 320, + "componentType": 5126, + "count": 2, + "max": [ + -0.07854896783828736, + 0.1425352245569229, + -0.014102344401180745, + -0.986567199230194 + ], + "min": [ + -0.07854896783828736, + 0.1425352245569229, + -0.014102344401180745, + -0.986567199230194 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 504, + "componentType": 5126, + "count": 2, + "max": [ + 0.9999998211860656, + 0.9999999403953552, + 1.0000001192092896 + ], + "min": [ + 0.9999998211860656, + 0.9999999403953552, + 1.0000001192092896 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 88, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 528, + "componentType": 5126, + "count": 2, + "max": [ + 0.06761901825666428, + 0.004460844676941633, + -0.07226424664258957 + ], + "min": [ + 0.06761901825666428, + 0.004460844676941633, + -0.07226424664258957 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 352, + "componentType": 5126, + "count": 2, + "max": [ + 0.21088102459907533, + -0.6243306398391724, + 0.7247719764709473, + -0.20111098885536198 + ], + "min": [ + 0.21088102459907533, + -0.6243306398391724, + 0.7247719764709473, + -0.20111098885536198 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 552, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000001192092896, + 0.9999995231628418, + 0.9999994039535524 + ], + "min": [ + 1.0000001192092896, + 0.9999995231628418, + 0.9999994039535524 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 96, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 576, + "componentType": 5126, + "count": 2, + "max": [ + 0.0, + 0.2661122083663941, + 1.4901200273698124e-8 + ], + "min": [ + 0.0, + 0.2661122083663941, + 1.4901200273698124e-8 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 384, + "componentType": 5126, + "count": 2, + "max": [ + 0.21115465462207798, + -0.298433005809784, + -0.04688597097992897, + -0.9295986890792848 + ], + "min": [ + 0.21115465462207798, + -0.298433005809784, + -0.04688597097992897, + -0.9295986890792848 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 600, + "componentType": 5126, + "count": 2, + "max": [ + 1.000000238418579, + 1.0000005960464478, + 1.000001072883606 + ], + "min": [ + 1.000000238418579, + 1.0000005960464478, + 1.000001072883606 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 104, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 624, + "componentType": 5126, + "count": 2, + "max": [ + 0.0, + 0.27582401037216189, + -1.862650034212265e-9 + ], + "min": [ + 0.0, + 0.27582401037216189, + -1.862650034212265e-9 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 416, + "componentType": 5126, + "count": 2, + "max": [ + 0.8477678298950195, + -0.002281581750139594, + -0.006338704377412796, + -0.5303238034248352 + ], + "min": [ + 0.8477678298950195, + -0.002281581750139594, + -0.006338704377412796, + -0.5303238034248352 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 648, + "componentType": 5126, + "count": 2, + "max": [ + 1.0, + 0.999999225139618, + 0.9999995231628418 + ], + "min": [ + 1.0, + 0.999999225139618, + 0.9999995231628418 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 112, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 672, + "componentType": 5126, + "count": 2, + "max": [ + -0.002346455818042159, + -0.06617335975170136, + 0.02785670943558216 + ], + "min": [ + -0.002346455818042159, + -0.06617335975170136, + 0.02785670943558216 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 448, + "componentType": 5126, + "count": 2, + "max": [ + 0.02453553676605225, + -0.3199966251850128, + 0.9446002840995788, + 0.06878269463777542 + ], + "min": [ + 0.02453553676605225, + -0.3199966251850128, + 0.9446002840995788, + 0.06878269463777542 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 696, + "componentType": 5126, + "count": 2, + "max": [ + 1.000000238418579, + 1.0000011920928956, + 1.0000007152557374 + ], + "min": [ + 1.000000238418579, + 1.0000011920928956, + 1.0000007152557374 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 120, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 720, + "componentType": 5126, + "count": 2, + "max": [ + -0.06845720112323761, + 0.0044607738964259628, + -0.07147085666656494 + ], + "min": [ + -0.06845720112323761, + 0.0044607738964259628, + -0.07147085666656494 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 480, + "componentType": 5126, + "count": 2, + "max": [ + -0.02340076118707657, + -0.6542634963989258, + 0.7544646263122559, + 0.04662882164120674 + ], + "min": [ + -0.02340076118707657, + -0.6542634963989258, + 0.7544646263122559, + 0.04662882164120674 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 744, + "componentType": 5126, + "count": 2, + "max": [ + 0.9999995827674866, + 0.999999463558197, + 0.9999994039535524 + ], + "min": [ + 0.9999995827674866, + 0.999999463558197, + 0.9999994039535524 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 128, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 768, + "componentType": 5126, + "count": 2, + "max": [ + 7.450579708745408e-9, + 0.2661122083663941, + 0.0 + ], + "min": [ + 7.450579708745408e-9, + 0.2661122083663941, + 0.0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 512, + "componentType": 5126, + "count": 2, + "max": [ + 0.2160616368055344, + 0.08108014613389969, + -0.010079950094223025, + -0.9729555249214172 + ], + "min": [ + 0.2160616368055344, + 0.08108014613389969, + -0.010079950094223025, + -0.9729555249214172 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 792, + "componentType": 5126, + "count": 2, + "max": [ + 1.0000009536743165, + 1.0000003576278689, + 1.0000008344650269 + ], + "min": [ + 1.0000009536743165, + 1.0000003576278689, + 1.0000008344650269 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 136, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 816, + "componentType": 5126, + "count": 2, + "max": [ + 7.450579708745408e-9, + 0.27582401037216189, + -7.450579708745408e-9 + ], + "min": [ + 7.450579708745408e-9, + 0.27582401037216189, + -7.450579708745408e-9 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 544, + "componentType": 5126, + "count": 2, + "max": [ + 0.8471664786338806, + -0.03204827755689621, + -0.02484037354588509, + -0.5297776460647583 + ], + "min": [ + 0.8471664786338806, + -0.03204827755689621, + -0.02484037354588509, + -0.5297776460647583 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 840, + "componentType": 5126, + "count": 2, + "max": [ + 0.9999998211860656, + 1.000000238418579, + 0.9999992847442628 + ], + "min": [ + 0.9999998211860656, + 1.000000238418579, + 0.9999992847442628 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 144, + "componentType": 5126, + "count": 2, + "max": [ + 1.25 + ], + "min": [ + 0.0 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 864, + "componentType": 5126, + "count": 2, + "max": [ + -0.001458517974242568, + -0.06619883328676224, + 0.027856720611453058 + ], + "min": [ + -0.001458517974242568, + -0.06619883328676224, + 0.027856720611453058 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 576, + "componentType": 5126, + "count": 2, + "max": [ + -0.03414175286889076, + -0.3191780745983124, + 0.9461711049079896, + -0.04146777093410492 + ], + "min": [ + -0.03414175286889076, + -0.3191780745983124, + 0.9461711049079896, + -0.04146777093410492 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 888, + "componentType": 5126, + "count": 2, + "max": [ + 0.9999997615814208, + 0.9999996423721314, + 0.999999225139618 + ], + "min": [ + 0.9999997615814208, + 0.9999996423721314, + 0.999999225139618 + ], + "type": "VEC3" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 19, + "max": [ + 1.0, + 0.8915184140205383, + 0.7523466944694519, + 0.0, + 0.9980356097221376, + 0.9971227049827576, + 0.99999338388443, + 0.0, + 0.7819650173187256, + 0.9999932050704956, + 0.9971057176589966, + 0.0, + 0.10768280178308489, + 0.5968672037124634, + 0.998986840248108, + 1.0 + ], + "min": [ + -1.0, + -0.8915209174156189, + -0.4486669003963471, + 0.0, + -0.7738311886787415, + -0.993836224079132, + -0.9999718070030212, + 0.0, + -0.10048440098762512, + -0.9762102365493774, + -0.9998233914375304, + 0.0, + -0.7611464262008667, + -1.1929899454116822, + -1.0513299703598025, + 1.0 + ], + "type": "MAT4" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.800000011920929, + 0.800000011920929, + 0.800000011920929, + 1.0 + ], + "metallicFactor": 0.0 + }, + "emissiveFactor": [ + 0.0, + 0.0, + 0.0 + ], + "name": "Default-effect" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 20648, + "byteLength": 1536, + "target": 34963 + }, + { + "buffer": 0, + "byteOffset": 17536, + "byteLength": 2960, + "byteStride": 8, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 8656, + "byteLength": 8880, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 1824, + "byteLength": 5920, + "byteStride": 16, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 20496, + "byteLength": 152 + }, + { + "buffer": 0, + "byteOffset": 7744, + "byteLength": 912 + }, + { + "buffer": 0, + "byteOffset": 1216, + "byteLength": 608 + }, + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 1216 + } + ], + "buffers": [ + { + "byteLength": 22184, + "uri": "RiggedFigure0.bin" + } + ] +} diff --git a/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedFigure/RiggedFigure0.bin b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedFigure/RiggedFigure0.bin Binary files differnew file mode 100644 index 000000000..121c6aa72 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedFigure/RiggedFigure0.bin diff --git a/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedSimple/RiggedSimple.gltf b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedSimple/RiggedSimple.gltf new file mode 100644 index 000000000..ea3a4cb64 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedSimple/RiggedSimple.gltf @@ -0,0 +1,539 @@ +{ + "asset": { + "generator": "COLLADA2GLTF", + "version": "2.0" + }, + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "nodes": [ + { + "children": [ + 4, + 1 + ], + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + -1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ] + }, + { + "mesh": 0, + "skin": 0 + }, + { + "children": [ + 3 + ], + "translation": [ + 0.0, + -3.156060017772689e-7, + -4.1803297996521 + ], + "rotation": [ + -0.7047404050827026, + -0.0, + -0.0, + -0.7094652056694031 + ], + "scale": [ + 1.0, + 0.9999998807907105, + 0.9999998807907105 + ] + }, + { + "translation": [ + 0.0, + 4.18717098236084, + 0.0 + ], + "rotation": [ + -0.0020521103870123626, + -9.94789530750495e-8, + -0.00029137087403796613, + -0.999997854232788 + ], + "scale": [ + 1.0, + 1.0, + 1.0000001192092896 + ] + }, + { + "children": [ + 2 + ] + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "JOINTS_0": 1, + "NORMAL": 2, + "POSITION": 3, + "WEIGHTS_0": 4 + }, + "indices": 0, + "mode": 4, + "material": 0 + } + ], + "name": "Cylinder" + } + ], + "animations": [ + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 2, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 2, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 2, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 5, + "interpolation": "LINEAR", + "output": 6 + }, + { + "input": 5, + "interpolation": "LINEAR", + "output": 7 + }, + { + "input": 5, + "interpolation": "LINEAR", + "output": 8 + } + ] + }, + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 3, + "path": "translation" + } + }, + { + "sampler": 1, + "target": { + "node": 3, + "path": "rotation" + } + }, + { + "sampler": 2, + "target": { + "node": 3, + "path": "scale" + } + } + ], + "samplers": [ + { + "input": 9, + "interpolation": "LINEAR", + "output": 10 + }, + { + "input": 9, + "interpolation": "LINEAR", + "output": 11 + }, + { + "input": 9, + "interpolation": "LINEAR", + "output": 12 + } + ] + } + ], + "skins": [ + { + "inverseBindMatrices": 13, + "skeleton": 2, + "joints": [ + 2, + 3 + ], + "name": "Armature" + } + ], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5123, + "count": 564, + "max": [ + 95 + ], + "min": [ + 0 + ], + "type": "SCALAR" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5123, + "count": 96, + "max": [ + 1, + 1, + 0, + 0 + ], + "min": [ + 0, + 0, + 0, + 0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 96, + "max": [ + 0.998198390007019, + 0.998198390007019, + 0.6888381242752075 + ], + "min": [ + -0.998198390007019, + -0.998198390007019, + -0.644473135471344 + ], + "type": "VEC3" + }, + { + "bufferView": 2, + "byteOffset": 1152, + "componentType": 5126, + "count": 96, + "max": [ + 1.0, + 1.0, + 4.575077056884766 + ], + "min": [ + -1.0, + -0.9999995827674866, + -4.575077056884766 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 96, + "max": [ + 1.0, + 0.261398196220398, + 0.0, + 0.0 + ], + "min": [ + 0.738601803779602, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5126, + "count": 3, + "max": [ + 2.083333015441895 + ], + "min": [ + 0.04166661947965622 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 3, + "max": [ + 0.0, + -3.156060017772689e-7, + -4.1803297996521 + ], + "min": [ + 0.0, + -3.156060017772689e-7, + -4.1803297996521 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 3, + "max": [ + -0.7047404050827026, + -0.0, + -0.0, + -0.7094652056694031 + ], + "min": [ + -0.7047404050827026, + -0.0, + -0.0, + -0.7094652056694031 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 36, + "componentType": 5126, + "count": 3, + "max": [ + 1.0, + 0.9999998807907105, + 0.9999998807907105 + ], + "min": [ + 1.0, + 0.9999998807907105, + 0.9999998807907105 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 12, + "componentType": 5126, + "count": 3, + "max": [ + 2.083333015441895 + ], + "min": [ + 0.04166661947965622 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 72, + "componentType": 5126, + "count": 3, + "max": [ + 0.0, + 4.18717098236084, + 0.0 + ], + "min": [ + 0.0, + 4.18717098236084, + 0.0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 48, + "componentType": 5126, + "count": 3, + "max": [ + 0.2933785021305084, + -9.94789530750495e-8, + -0.0002783441450446844, + -0.9559963345527648 + ], + "min": [ + -0.0020521103870123626, + -0.00008614854596089572, + -0.00029137087403796613, + -0.999997854232788 + ], + "type": "VEC4" + }, + { + "bufferView": 5, + "byteOffset": 108, + "componentType": 5126, + "count": 3, + "max": [ + 1.0, + 1.0, + 1.0000001192092896 + ], + "min": [ + 1.0, + 1.0, + 1.0000001192092896 + ], + "type": "VEC3" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 2, + "max": [ + 1.0, + 0.0, + 0.000001394809942212305, + 0.0, + 0.000002896920022976701, + 0.006681859027594328, + -0.9999778270721436, + 0.0, + 0.0005827349959872663, + 0.9999966025352478, + 0.006681739818304777, + 0.0, + 0.0, + 4.18023681640625, + 0.02795993909239769, + 1.0 + ], + "min": [ + 0.9999999403953552, + -0.0005827400018461049, + 0.0, + 0.0, + 0.0, + 0.002577662002295256, + -0.9999967217445374, + 0.0, + 0.0, + 0.999977707862854, + 0.002577601931989193, + 0.0, + -0.000004012620138382772, + -0.006818830035626888, + 0.027931740507483484, + 1.0 + ], + "type": "MAT4" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.27963539958000185, + 0.6399999856948853, + 0.21094390749931336, + 1.0 + ], + "metallicFactor": 0.0 + }, + "emissiveFactor": [ + 0.0, + 0.0, + 0.0 + ], + "name": "Material_001-effect" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 5000, + "byteLength": 1128, + "target": 34963 + }, + { + "buffer": 0, + "byteOffset": 4208, + "byteLength": 768, + "byteStride": 8, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 1904, + "byteLength": 2304, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 224, + "byteLength": 1536, + "byteStride": 16, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 4976, + "byteLength": 24 + }, + { + "buffer": 0, + "byteOffset": 1760, + "byteLength": 144 + }, + { + "buffer": 0, + "byteOffset": 128, + "byteLength": 96 + }, + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 128 + } + ], + "buffers": [ + { + "byteLength": 6128, + "uri": "RiggedSimple0.bin" + } + ] +} diff --git a/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedSimple/RiggedSimple0.bin b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedSimple/RiggedSimple0.bin Binary files differnew file mode 100644 index 000000000..ed24826b7 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/gltf/2.0/RiggedSimple/RiggedSimple0.bin diff --git a/examples/qt3d/exampleresources/envmaps.qrc b/examples/qt3d/exampleresources/envmaps.qrc new file mode 100644 index 000000000..25bcea569 --- /dev/null +++ b/examples/qt3d/exampleresources/envmaps.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>assets/envmaps/cedar-bridge/cedar_bridge_irradiance.dds</file> + <file>assets/envmaps/cedar-bridge/cedar_bridge_specular.dds</file> + </qresource> +</RCC> diff --git a/examples/qt3d/exampleresources/gltf.qrc b/examples/qt3d/exampleresources/gltf.qrc index 869fb16dc..aa9a994a1 100644 --- a/examples/qt3d/exampleresources/gltf.qrc +++ b/examples/qt3d/exampleresources/gltf.qrc @@ -14,5 +14,9 @@ <file>assets/gltf/wine/wine1VS.glsl</file> <file>assets/gltf/wine/wine3FS.glsl</file> <file>assets/gltf/wine/wine3VS.glsl</file> + <file>assets/gltf/2.0/RiggedFigure/RiggedFigure.gltf</file> + <file>assets/gltf/2.0/RiggedFigure/RiggedFigure0.bin</file> + <file>assets/gltf/2.0/RiggedSimple/RiggedSimple.gltf</file> + <file>assets/gltf/2.0/RiggedSimple/RiggedSimple0.bin</file> </qresource> </RCC> diff --git a/examples/qt3d/phong-cubes/CubeEntity.qml b/examples/qt3d/phong-cubes/CubeEntity.qml new file mode 100644 index 000000000..558f53327 --- /dev/null +++ b/examples/qt3d/phong-cubes/CubeEntity.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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.0 as Quick +import Qt3D.Core 2.0 +import Qt3D.Render 2.0 +import Qt3D.Extras 2.0 + +Entity { + id: root + property vector3d position: Qt.vector3d() + property Material material + + components: [mesh, material, transform] + + CuboidMesh { + id: mesh + xExtent: 0.5 + yExtent: xExtent + zExtent: xExtent + } + + Transform { + id: transform + translation: root.position + rotationZ: 45 + + Quick.NumberAnimation on rotationY { + from: 0; to: 360 + loops: Quick.Animation.Infinite + duration: 5000 + } + } +} diff --git a/examples/qt3d/phong-cubes/main.cpp b/examples/qt3d/phong-cubes/main.cpp new file mode 100644 index 000000000..dba6e0bff --- /dev/null +++ b/examples/qt3d/phong-cubes/main.cpp @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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 <QGuiApplication> + +int main(int argc, char* argv[]) +{ + QGuiApplication app(argc, argv); + Qt3DExtras::Quick::Qt3DQuickWindow view; + + view.setSource(QUrl("qrc:/main.qml")); + view.show(); + + return app.exec(); +} diff --git a/examples/qt3d/phong-cubes/main.qml b/examples/qt3d/phong-cubes/main.qml new file mode 100644 index 000000000..0e067fdad --- /dev/null +++ b/examples/qt3d/phong-cubes/main.qml @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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.Input 2.0 +import Qt3D.Extras 2.0 + +Entity { + components: [ + RenderSettings { + activeFrameGraph: ForwardRenderer { + clearColor: "white" + camera: mainCamera + } + }, + InputSettings { } + ] + + Camera { + id: mainCamera + position: Qt.vector3d(0.0, 0.0, 7.0) + upVector: Qt.vector3d(0.0, 1.0, 0.0) + viewCenter: Qt.vector3d(0.0, 0.0, 0.0) + } + + FirstPersonCameraController { + camera: mainCamera + } + + Entity { + components: [ + PointLight {}, + Transform { translation: mainCamera.position } + ] + } + + CubeEntity { + position: Qt.vector3d(-1, 1, 0) + material: PhongMaterial {} + } + + CubeEntity { + position: Qt.vector3d(0, 1, 0) + material: DiffuseMapMaterial { + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + } + } + + CubeEntity { + position: Qt.vector3d(1, 1, 0) + material: DiffuseSpecularMapMaterial { + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" } + } + } + + CubeEntity { + position: Qt.vector3d(-1, 0, 0) + material: PhongAlphaMaterial {} + } + + CubeEntity { + position: Qt.vector3d(0, 0, 0) + material: NormalDiffuseMapMaterial { + normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" } + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + } + } + + CubeEntity { + position: Qt.vector3d(1, 0, 0) + material: NormalDiffuseMapAlphaMaterial { + normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" } + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + } + } + + CubeEntity { + position: Qt.vector3d(-1, -1, 0) + material: NormalDiffuseSpecularMapMaterial { + normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" } + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" } + } + } + + CubeEntity { + position: Qt.vector3d(0, -1, 0) + material: NormalDiffuseSpecularMapMaterial { + normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" } + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" } + } + } + + CubeEntity { + position: Qt.vector3d(1, -1, 0) + material: NormalDiffuseSpecularMapMaterial { + normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" } + diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" } + specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" } + } + } +} diff --git a/examples/qt3d/phong-cubes/phong-cubes.pro b/examples/qt3d/phong-cubes/phong-cubes.pro new file mode 100644 index 000000000..e099b336d --- /dev/null +++ b/examples/qt3d/phong-cubes/phong-cubes.pro @@ -0,0 +1,18 @@ +!include( ../examples.pri ) { + error( "Couldn't find the examples.pri file!" ) +} + +SOURCE += main.cpp + +QT += qml quick 3dcore 3drender 3dinput 3dquick 3dquickextras + +OTHER_FILES += \ + main.qml \ + CubeEntity.qml + +SOURCES += \ + main.cpp + +RESOURCES += \ + phong-cubes.qrc \ + ../exampleresources/textures.qrc diff --git a/examples/qt3d/phong-cubes/phong-cubes.qrc b/examples/qt3d/phong-cubes/phong-cubes.qrc new file mode 100644 index 000000000..84cec1121 --- /dev/null +++ b/examples/qt3d/phong-cubes/phong-cubes.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>CubeEntity.qml</file> + </qresource> +</RCC> diff --git a/examples/qt3d/planets-qml/PlanetMaterial.qml b/examples/qt3d/planets-qml/PlanetMaterial.qml index 4d50aee8d..309acf24d 100644 --- a/examples/qt3d/planets-qml/PlanetMaterial.qml +++ b/examples/qt3d/planets-qml/PlanetMaterial.qml @@ -115,7 +115,8 @@ Material { TextureImage { id: specularTextureImage // Get rid of runtime warnings. It's safe, as the texture just isn't used - source: specularMap !== "" ? specularMap : "qrc:/images/uranusmap.jpg" + source: specularMap !== "" ? specularMap + : "qrc:/images/solarsystemscope/uranusmap.jpg" } } }, @@ -133,7 +134,8 @@ Material { TextureImage { id: normalTextureImage // Get rid of runtime warnings. It's safe, as the texture just isn't used - source: normalMap !== "" ? normalMap : "qrc:/images/uranusmap.jpg" + source: normalMap !== "" ? normalMap + : "qrc:/images/solarsystemscope/uranusmap.jpg" } } }, diff --git a/examples/qt3d/planets-qml/SolarSystem.qml b/examples/qt3d/planets-qml/SolarSystem.qml index f9353d6dc..8c0cfccd4 100644 --- a/examples/qt3d/planets-qml/SolarSystem.qml +++ b/examples/qt3d/planets-qml/SolarSystem.qml @@ -395,7 +395,10 @@ Entity { var v = Math.atan2(yv, xv) // Calculate the distance (radius) - var r = Math.sqrt(xv * xv + yv * yv) + // TODO: Math.hypot() is ES6 and QML JS is only ES5 currently. A patch to QtQml is + // required to get Math.hypot() to work. + //var r = Math.hypot(xv, yv) + var r = Math.sqrt(Math.pow(xv, 2) + Math.pow(yv, 2)) // From http://www.davidcolarusso.com/astro/ // Modified to compensate for the right handed coordinate system of OpenGL diff --git a/examples/qt3d/planets-qml/images/solarsystemscope/qt_attribution.json b/examples/qt3d/planets-qml/images/solarsystemscope/qt_attribution.json index 35e9afe39..9d32e541d 100644 --- a/examples/qt3d/planets-qml/images/solarsystemscope/qt_attribution.json +++ b/examples/qt3d/planets-qml/images/solarsystemscope/qt_attribution.json @@ -6,7 +6,7 @@ "Description": "Solar System Scope provides high quality, free to use textures for objects in the solar system.", "QtUsage": "Used in Qt 3D planets-qml example.", - "Homepage": "www.solarsystemscope.com/textures", + "Homepage": "https://www.solarsystemscope.com/textures", "License": "Creative Commons Attribution 4.0", "LicenseId": "CC-BY-4.0", "LicenseFile": "license.txt", diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro index 7ac55bfd2..74049b129 100644 --- a/examples/qt3d/qt3d.pro +++ b/examples/qt3d/qt3d.pro @@ -20,7 +20,8 @@ SUBDIRS += \ qardboard \ advancedcustommaterial \ simplecustommaterial \ - scene2d + scene2d \ + phong-cubes qtHaveModule(multimedia): SUBDIRS += audio-visualizer-qml diff --git a/examples/qt3d/scene2d/main.qml b/examples/qt3d/scene2d/main.qml index 35b8f3eb6..ceaac3b34 100644 --- a/examples/qt3d/scene2d/main.qml +++ b/examples/qt3d/scene2d/main.qml @@ -97,10 +97,10 @@ Entity { PhongMaterial { id: logoMaterial - ambient: Qt.rgba( logoControls.colorR/255, + diffuse: Qt.rgba( logoControls.colorR/255, logoControls.colorG/255, logoControls.colorB/255, 1.0 ) - diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 ) + ambient: Qt.rgba( 0.1, 0.1, 0.1, 1.0 ) shininess: logoControls.shininess } diff --git a/examples/qt3d/wave/shaders/ribbon.vert b/examples/qt3d/wave/shaders/ribbon.vert index e099d53c8..2ff9d2729 100644 --- a/examples/qt3d/wave/shaders/ribbon.vert +++ b/examples/qt3d/wave/shaders/ribbon.vert @@ -111,7 +111,7 @@ float snoise(vec3 v) float height( const in vec3 pos ) { // Perturb the y position by a wave function in (x, t) - const float twoPi = 2.0 * 3.14159; + const float twoPi = 2.0 * 3.14159265358979323846; float k = twoPi / lambda; float omega = twoPi / period; |