Commit c85fb56a authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Some tiny adjustments

parent 9e95d001
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
......@@ -26,26 +28,26 @@
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick
import QtQuick3D
Node {
id: scene
rotation: Qt.quaternion(0.707107, -0.707107, 0, 0)
Model {
id: cube
x: -0.025618
y: -0.000536585
z: -4.53368e-05
scale: Qt.vector3d(2, 2, 2)
source: "meshes/cube.mesh"
Node {
id: scene
rotation: Qt.quaternion(0.707107, -0.707107, 0, 0)
Model {
id: cube
x: -0.025618
y: -0.000536585
z: -4.53368e-05
scale: Qt.vector3d(2, 2, 2)
source: "meshes/cube.mesh"
DefaultMaterial {
id: material_001_material
diffuseColor: "#ffcccccc"
DefaultMaterial {
id: material_001_material
diffuseColor: "#01bd09"
}
materials: [material_001_material]
}
materials: [
material_001_material
]
}
}
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
......@@ -26,7 +27,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick
import QtQuick.Controls
import QtQuick3D
......@@ -40,21 +40,22 @@ Rectangle {
color: Constants.backgroundColor
MouseArea {
property real mouseXprev: -1;
id: mouseArea
property real mouseXprev: 0
property real rotationY: 45
anchors.fill: parent
anchors.rightMargin: 42
anchors.bottomMargin: 42
anchors.leftMargin: -42
anchors.topMargin: -42
hoverEnabled: true
onMouseXChanged: {
if (pressed) {
example.eulerRotation.y += (mouseX - mouseXprev) / 5;
Connections {
target: mouseArea
onMouseXChanged: {
if (mouseArea.pressed) {
mouseArea.rotationY += (mouseArea.mouseX - mouseArea.mouseXprev) / 5
}
mouseArea.mouseXprev = mouseArea.mouseX
}
mouseXprev = mouseX;
}
}
View3D {
......@@ -79,7 +80,7 @@ Rectangle {
PointLight {
id: pointLight
position: Qt.vector3d(120,50,00)
position: Qt.vector3d(120, 50, 00)
brightness: 3
}
......@@ -90,8 +91,17 @@ Rectangle {
Example {
id: example
eulerRotation.y: mouseArea.rotationY
}
}
Text {
id: text1
x: 19
y: 18
color: "#ffffff"
text: qsTr("Drag Me")
font.pixelSize: 104
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment