Commit 18b94310 authored by Thomas Hartmann's avatar Thomas Hartmann

Removing robotarm demo

parent 178446f2
<?xml version='1.0' encoding='utf-8'?>
<application xmlns="http://qt.io/qt3dstudio/uia">
<assets initial="RobotArm3D">
<presentation id="RobotArm3D" src="presentations/RobotArm3D.uip"/>
<presentation id="Background" src="presentations/Background.uip"/>
<dataInput name="arm1Rot" type="Ranged Number" min="0" max="120"/>
<dataInput name="arm2Rot" type="Ranged Number" min="0" max="156"/>
<dataInput name="arm3Rot" type="Ranged Number" min="0" max="156"/>
<dataInput name="baseRot" type="Ranged Number" min="0" max="360"/>
<dataInput name="handRot" type="Ranged Number" min="0" max="360"/>
</assets>
<statemachine ref="#logic">
<visual-states>
<state ref="Initial">
<enter>
<goto-slide rel="next" element="main:Scene"/>
</enter>
</state>
</visual-states>
</statemachine>
</application>
<MaterialData version="1.0">
<Property name="shaderlighting">Pixel</Property>
<Property name="blendmode">Normal</Property>
<Property name="diffuse">0.988235 0.741176 0</Property>
<Property name="specularreflection"><![CDATA[./maps/Specular-ceiling_lights-1.png]]></Property>
<Property name="specularamount">0</Property>
<Property name="specularroughness">1</Property>
<Property name="opacity">100</Property>
<Property name="emissivecolor">1 1 1</Property>
<Property name="emissivepower">0</Property>
<Property name="bumpamount">0</Property>
<Property name="displaceamount">0</Property>
<Property name="translucentfalloff">1</Property>
<Property name="diffuselightwrap">0</Property>
<Property name="specularmodel">Default</Property>
<Property name="speculartint">1 1 1</Property>
<Property name="ior">0.58</Property>
<Property name="fresnelPower">140</Property>
<Property name="vertexcolors">False</Property>
<Property name="sourcepath"></Property>
<Property name="importid">orange metal_0007</Property>
<Property name="importfile">../models/robot_dual/robot_dual.import</Property>
<Property name="type">Material</Property>
<Property name="name"><![CDATA[materials/orange metal]]></Property>
<Property name="path"><![CDATA[C:/workspace/3ddemo/Robot2/RobotArm3D/materials/orange metal.materialdef]]></Property>
<TextureData name="specularreflection">
<Property name="scaleu">1</Property>
<Property name="scalev">1</Property>
<Property name="mappingmode">Environmental Mapping</Property>
<Property name="tilingmodehorz">No Tiling</Property>
<Property name="tilingmodevert">No Tiling</Property>
<Property name="rotationuv">0</Property>
<Property name="positionu">0</Property>
<Property name="positionv">0</Property>
<Property name="pivotu">0</Property>
<Property name="pivotv">0</Property>
<Property name="subpresentation"></Property>
<Property name="sourcepath"><![CDATA[./maps/Specular-ceiling_lights-1.png]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">Image</Property>
<Property name="name"><![CDATA[Image]]></Property>
</TextureData>
</MaterialData>
\ No newline at end of file
<Material name="simple_glass" version="1.0">
<MetaData >
<Property formalName="Environment Map" name="uEnvironmentTexture" description="Environment texture for the material" type="Texture" filter="linear" minfilter="linearMipmapLinear" clamp="repeat" usage="environment" default="./maps/materials/spherical_checker.png" category="Material"/>
<Property formalName="Enable Environment" name="uEnvironmentMappingEnabled" description="Enable environment mapping" type="Boolean" default="True" category="Material"/>
<Property formalName="Baked Shadow Map" name="uBakedShadowTexture" description="Baked shadow texture for the material" type="Texture" filter="linear" minfilter="linearMipmapLinear" clamp="repeat" usage="shadow" default="./maps/materials/shadow.png" category="Material"/>
<Property formalName="Shadow Mapping" name="uShadowMappingEnabled" description="Enable shadow mapping" type="Boolean" default="False" category="Material"/>
<Property formalName="Fresnel Power" name="uFresnelPower" description="Fresnel power of the material" type="Float" default="1.0" category="Material"/>
<Property formalName="Minimum Opacity" name="uMinOpacity" description="Minimum opacity of the material" type="Float" default="0.5" category="Material"/>
<Property formalName="Reflectivity" name="reflectivity_amount" type="Float" min="0.000000" max="1.000000" default="1.000000" description="Reflectivity factor" category="Material"/>
<Property formalName="Glass ior" name="glass_ior" hidden="True" type="Float" default="1.100000" description="Index of refraction of the material" category="Material"/>
<Property formalName="Glass Color" name="glass_color" type="Color" default="0.9 0.9 0.9" description="Color of the material" category="Material"/>
</MetaData>
<Shaders type="GLSL" version="330">
<Shader>
<Shared> </Shared>
<VertexShader>
</VertexShader>
<FragmentShader>
// add enum defines
#define scatter_reflect 0
#define scatter_transmit 1
#define scatter_reflect_transmit 2
#define QT3DS_ENABLE_UV0 1
#define QT3DS_ENABLE_WORLD_POSITION 1
#define QT3DS_ENABLE_TEXTAN 1
#define QT3DS_ENABLE_BINORMAL 0
#include "vertexFragmentBase.glsllib"
// set shader output
out vec4 fragColor;
// add structure defines
struct layer_result
{
vec4 base;
vec4 layer;
mat3 tanFrame;
};
// temporary declarations
vec3 ftmp0;
vec4 tmpShadowTerm;
layer_result layers[1];
#include "SSAOCustomMaterial.glsllib"
#include "sampleLight.glsllib"
#include "sampleProbe.glsllib"
#include "sampleArea.glsllib"
#include "square.glsllib"
#include "calculateRoughness.glsllib"
#include "evalBakedShadowMap.glsllib"
#include "evalEnvironmentMap.glsllib"
#include "luminance.glsllib"
#include "microfacetBSDF.glsllib"
#include "physGlossyBSDF.glsllib"
#include "simpleGlossyBSDF.glsllib"
#include "abbeNumberIOR.glsllib"
#include "fresnelLayer.glsllib"
#include "refraction.glsllib"
bool evalTwoSided()
{
return( true );
}
vec3 computeFrontMaterialEmissive()
{
return( vec3( 0, 0, 0 ) );
}
void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor )
{
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].base += tmpShadowTerm * microfacetBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, 0.000000, 0.000000, scatter_reflect_transmit );
#endif
}
void computeFrontAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 lightSpecular )
{
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].base += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[0].tanFrame, varWorldPos, lightIdx, viewDir, 0.000000, 0.000000 );
#endif
}
void computeFrontLayerEnvironment( in vec3 normal, in vec3 viewDir, float aoFactor )
{
#if !QT3DS_ENABLE_LIGHT_PROBE
layers[0].base += tmpShadowTerm * microfacetSampledBSDF( layers[0].tanFrame, viewDir, 0.000000, 0.000000, scatter_reflect_transmit );
#else
layers[0].base += tmpShadowTerm * sampleGlossyAniso( layers[0].tanFrame, viewDir, 0.000000, 0.000000 );
#endif
}
vec3 computeBackMaterialEmissive()
{
return( vec3(0, 0, 0) );
}
void computeBackLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor )
{
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
#endif
}
void computeBackAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 lightSpecular )
{
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
#endif
}
void computeBackLayerEnvironment( in vec3 normal, in vec3 viewDir, float aoFactor )
{
#if !QT3DS_ENABLE_LIGHT_PROBE
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
#else
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
#endif
}
float computeIOR()
{
return( true ? 1.0 : luminance( vec3( abbeNumberIOR(glass_ior, 0.000000 ) ) ) );
}
float evalCutout()
{
return( 1.000000 );
}
vec3 computeNormal()
{
return( normal );
}
void computeTemporaries()
{
ftmp0 = vec3( reflectivity_amount );
tmpShadowTerm = evalBakedShadowMap( texCoord0 );
}
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
color = layers[0].base * vec4( ftmp0, 1.0);
return color;
}
void initializeLayerVariables(void)
{
// clear layers
layers[0].base = vec4(0.0, 0.0, 0.0, 1.0);
layers[0].layer = vec4(0.0, 0.0, 0.0, 1.0);
layers[0].tanFrame = orthoNormalize( tangentFrame( normal, varWorldPos ) );
}
vec4 computeGlass(in vec3 normal, in float materialIOR, in float alpha, in vec4 color)
{
vec4 rgba = color;
float ratio = simpleFresnel( normal, materialIOR, uFresnelPower );
vec3 absorb_color = ( log( glass_color )/-1.000000 );
// prevent log(0) -> inf number issue
if ( isinf(absorb_color.r) ) absorb_color.r = 1.0;
if ( isinf(absorb_color.g) ) absorb_color.g = 1.0;
if ( isinf(absorb_color.b) ) absorb_color.b = 1.0;
rgba.rgb = mix(vec3(1.0) - absorb_color, rgba.rgb * (vec3(1.0) - absorb_color), ratio);
rgba.a = mix(uMinOpacity, alpha, ratio);
return rgba;
}
</FragmentShader>
</Shader>
</Shaders>
<Passes >
<ShaderKey value="36"/>
<LayerKey count="1"/>
<Pass >
<Blending source="SrcAlpha" dest="OneMinusSrcAlpha"/>
<RenderState name="CullFace"/>
</Pass>
</Passes>
</Material>
<?xml version="1.0" encoding="UTF-8" ?>
<UIP Version="1" >
<Project Revision="1" >
<Graph >
<Group id="__import__root__" >
<Group id="Group_Robot" name="Group_Robot" orientation="Right Handed" position="-401.817 187.336 -119.311" rotation="-90 -0 0" rotationorder="XYZr" scale="100 100 100" >
<Model id="arm1" name="arm1" orientation="Right Handed" position="0 0 -0" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/arm1.mesh" >
<Material id="orange metal" name="orange metal" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="links" name="links" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="arm2" name="arm2" orientation="Right Handed" position="0.00395393 -0.00122833 0.0112138" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/arm2.mesh" >
<Material id="motor body" name="motor body" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="orange metal_0003" name="orange metal" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="links_0002" name="links" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="arm3" name="arm3" orientation="Right Handed" position="0 0 -0" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/arm3.mesh" >
<Material id="orange metal_0005" name="orange metal" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="links_0003" name="links" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="base" name="base" orientation="Right Handed" position="0 0 -0" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/base.mesh" >
<Material id="base sides" name="base sides" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="orange metal_0007" name="orange metal" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="hand" name="hand" orientation="Right Handed" position="0 0 -0" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/hand.mesh" >
<Material id="links_0004" name="links" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="orange metal_0009" name="orange metal" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="pincer1" name="pincer1" orientation="Right Handed" position="-0.0102706 0.0185977 0.00016284" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/pincer1.mesh" >
<Material id="grabbers" name="grabbers" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="pads" name="pads" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="pincer2" name="pincer2" orientation="Right Handed" position="0 0 -0" rotation="-0.0191525 0.0104704 -0.699569" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/pincer2.mesh" >
<Material id="grabbers_0007" name="grabbers" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="pads_0006" name="pads" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="turret" name="turret" orientation="Right Handed" position="0 0 -0" rotation="-1.51661e-21 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath="meshes/turret.mesh" >
<Material id="motor body_0001" name="motor body" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="orange metal_0010" name="orange metal" blendmode="Normal" diffuse="0.8 0.8 0.8" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
</Group>
</Group>
</Graph>
<Import SrcFile="../../../../3D_Models/robot_dual.fbx" ImageDir="Images" MeshDir="Meshes" >
<Mesh >
<Source >turret</Source>
<Dest >meshes/turret.mesh</Dest>
</Mesh>
<Mesh >
<Source >pincer1</Source>
<Dest >meshes/pincer1.mesh</Dest>
</Mesh>
<Mesh >
<Source >arm3</Source>
<Dest >meshes/arm3.mesh</Dest>
</Mesh>
<Mesh >
<Source >pincer2</Source>
<Dest >meshes/pincer2.mesh</Dest>
</Mesh>
<Mesh >
<Source >arm2</Source>
<Dest >meshes/arm2.mesh</Dest>
</Mesh>
<Mesh >
<Source >arm1</Source>
<Dest >meshes/arm1.mesh</Dest>
</Mesh>
<Mesh >
<Source >base</Source>
<Dest >meshes/base.mesh</Dest>
</Mesh>
<Mesh >
<Source >hand</Source>
<Dest >meshes/hand.mesh</Dest>
</Mesh>
</Import>
</Project>
</UIP>
<?xml version="1.0" encoding="UTF-8" ?>
<UIP version="5" >
<Project >
<ProjectSettings author="" company="" presentationWidth="1920" presentationHeight="540" maintainAspect="False" preferKtx="False" >
<CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors>
</ProjectSettings>
<Graph >
<Scene id="Scene" backgroundcolor="1 1 1" bgcolorenable="False" >
<Layer id="Layer" variants="" >
<Camera id="Camera" />
<Light id="Light" />
<Model id="Cube" >
<Material id="Default" name="Default" />
</Model>
</Layer>
</Scene>
</Graph>
<Logic >
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" multisampleaa="4x" progressiveaa="None" />
<Add ref="#Camera" fov="25" />
<Add ref="#Light" lighttype="Point" position="-270.963 35.6404 0" />
<State id="Scene-Slide1" name="Slide1" >
<Add ref="#Cube" name="Cube" position="-364.082 -120.384 288.306" rotation="0 43.5 0" sourcepath="#Cube" >
<AnimationTrack property="position.x" type="EaseInOut" >0 -481.865 100 100 8 418.284 100 100</AnimationTrack>
<AnimationTrack property="position.y" type="EaseInOut" >0 -120.384 100 100 8 -120.384 100 100</AnimationTrack>
<AnimationTrack property="position.z" type="EaseInOut" >0 288.306 100 100 8 288.306 100 100</AnimationTrack>
<AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 8 0 100 100</AnimationTrack>
<AnimationTrack property="rotation.y" type="EaseInOut" >0 43.5 100 100 8 -161 100 100</AnimationTrack>
<AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 8 0 100 100</AnimationTrack>
</Add>
<Add ref="#Default" diffuse="1 1 1" />
</State>
</State>
</Logic>
</Project>
</UIP>
<?xml version="1.0" encoding="UTF-8" ?>
<UIP version="5" >
<Project >
<ProjectSettings author="" company="" presentationWidth="1920" presentationHeight="540" maintainAspect="False" preferKtx="False" >
<CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors>
</ProjectSettings>
<Graph >
<Scene id="Scene" backgroundcolor="1 1 1" bgcolorenable="False" >
<Layer id="Layer" variants="" >
<Camera id="Camera" />
<Light id="Light" />
<Model id="Cube" >
<Material id="Default" name="Default" />
</Model>
</Layer>
</Scene>
</Graph>
<Logic >
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" multisampleaa="4x" progressiveaa="None" />
<Add ref="#Camera" fov="25" />
<Add ref="#Light" lighttype="Point" position="-270.963 35.6404 0" />
<State id="Scene-Slide1" name="Slide1" >
<Add ref="#Cube" name="Cube" position="-364.082 -120.384 288.306" rotation="0 43.5 0" sourcepath="#Cube" >
<AnimationTrack property="position.x" type="EaseInOut" >0 -481.865 100 100 8 418.284 100 100</AnimationTrack>
<AnimationTrack property="position.y" type="EaseInOut" >0 -120.384 100 100 8 -120.384 100 100</AnimationTrack>
<AnimationTrack property="position.z" type="EaseInOut" >0 288.306 100 100 8 288.306 100 100</AnimationTrack>
<AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 8 0 100 100</AnimationTrack>
<AnimationTrack property="rotation.y" type="EaseInOut" >0 43.5 100 100 8 -161 100 100</AnimationTrack>
<AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 8 0 100 100</AnimationTrack>
</Add>
<Add ref="#Default" diffuse="1 1 1" />
</State>
</State>
</Logic>
</Project>
</UIP>
import QtQuick 2.12
import Robot2 1.0
import QtStudio3D.OpenGL 2.4
import QtQuick.Controls 2.3
import QtQuick.Timeline 1.0
Rectangle {
id: rectangle2
width: Constants.width
height: Constants.height
color: Constants.backgroundColor
Studio3D {
id: studio3D
anchors.bottomMargin: 0
anchors.topMargin: 0
anchors.rightMargin: 90
anchors.fill: parent
ViewerSettings {
scaleMode: ViewerSettings.ScaleModeFit
//showRenderStats: true
}
Presentation {
id: scene
source: "./3ddata/RobotArm3D.uia"
property real arm1RotVal: armRot1Dial.value
property real arm2RotVal: armRot2Dial.value //rotSlider2.value
property real arm3RotVal: armRot3Dial.value //rotSlider3.value
property real handRotVal: handRotDial.value //rotSlider4.value
property real baseRotVal: baseRotDial.value //rotSlider5.value
DataInput {
name: "arm1Rot"
value: scene.arm1RotVal
}
DataInput {
name: "arm2Rot"
value: scene.arm2RotVal
}
DataInput {
name: "arm3Rot"
value: scene.arm3RotVal
}
DataInput {
name: "handRot"
value: scene.handRotVal
}
DataInput {
name: "baseRot"
value: scene.baseRotVal
}
DataInput {
name: "objectColor"
value: Qt.vector3d(1, 0, 0)
}
}
}
Connections {
target: armRot1Dial
onMoved: scene.arm1RotVal = armRot1Dial.value
}
Timeline {
id: timeline
animations: [
TimelineAnimation {
id: timelineAnimation
duration: 1000
to: 1000
loops: 1
running: true
from: 0
}
]
endFrame: 1000
startFrame: 0
enabled: true
KeyframeGroup {
target: studio3D
property: "opacity"
Keyframe {
value: 0
frame: 0
}
Keyframe {
value: 1
frame: 1000
}
}
}
Rectangle {
id: rectangle
x: 1191
width: 60
color: "#9b9b9b"
anchors.bottom: parent.bottom
anchors.top: parent.top
anchors.right: parent.right
}
Rectangle {
id: rectangle1
width: 616
color: Constants.backgroundColor
anchors.bottom: parent.bottom
anchors.top: parent.top
anchors.left: parent.left
Dial {
id: baseRotDial
x: 162
y: 517
width: 60
height: 60
stepSize: 1
to: 360
}
Dial {
id: handRotDial
x: 12
y: 44
width: 60
height: 60
to: 100
stepSize: 1
}
Dial {
id: armRot3Dial
x: 128
y: 182
width: 60
height: 60
stepSize: 1
to: 100
}
Dial {
id: armRot2Dial
x: 343
y: 263
width: 60
height: 60
to: 100
stepSize: 1
}
Dial {
id: armRot1Dial
x: 292
y: 402
width: 60
height: 60
stepSize: 1
to: 100
}
Text {
id: element
x: 213
y: 8
text: qsTr("Robot Arm")
font.capitalization: Font.AllUppercase