aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/shadowCasting/main.qml
blob: 468558d3ce756d49203291227ef697c7ebc71fdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import QtQuick
import QtQuick.Window
import QtQuick3D
import QtQuick3D.Helpers

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Shadow Casting Test")

    View3D {
        id: view
        anchors.fill: parent
        camera: camera1

        DirectionalLight {
            castsShadow: true
            shadowFactor: 25
            eulerRotation: Qt.vector3d(-60, -20, 0)
        }

        Model {
            id: ground
            source: "#Cube"
            scale: Qt.vector3d(10, 0.01, 10)
            materials: DefaultMaterial {
                diffuseColor: Qt.rgba(1.0, 1.0, 0.0, 1.0)
            }
            castsShadows: false
        }

        Model {
            source: "#Sphere"
            y: 50
            materials: DefaultMaterial {
            }
            castsShadows: false
        }

        Model {
            source: "#Cylinder"
            y: 200
            x: -250
            scale: Qt.vector3d(1, 5, 1)
            materials: DefaultMaterial {
            }
            castsShadows: true
        }

        Model {
            source: "#Cube"
            x: -250
            z: 250
            y: 50
            materials: DefaultMaterial {
            }
            receivesShadows: false
        }

        PerspectiveCamera {
            id: camera1
            z: 600
            y: 300
            clipFar: 1000
            eulerRotation: Qt.vector3d(-20, 0, 0)
        }
    }

    WasdController {
        controlledObject: view.camera
    }

}