summaryrefslogtreecommitdiffstats
path: root/tests/manual/animation-keyframe-simple/main.qml
blob: 37f5eba2f5f4f159ee6790865d69cd19e33fbe1b (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
/*************************************************************************
 *
 * Copyright (c) 2016, Klaralvdalens Datakonsult AB (KDAB)
 * All rights reserved.
 *
 * See the LICENSE.txt file shipped along with this file for the license.
 *
 *************************************************************************/

import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Input 2.0
import Qt3D.Animation 2.2
import Qt3D.Extras 2.0

DefaultSceneEntity {
    id: scene

    Entity {
        id: cube

        components: [
            CuboidMesh {
            },
            PhongMaterial {
                ambient: Qt.rgba(0.02, 0.02, 0.02, 1.0)
                diffuse: "blue"
                shininess: 50
            },
            Transform {
                id: cubeTransform
            },
            ClipAnimator {
                running: true
                clip: AnimationClip {
                    source: "cubeanimation.json"
                }
            }

        ]
    }

    camera: Camera {
        position: Qt.vector3d(10, 10, 10)
        viewCenter: Qt.vector3d(0, 0, 0)
    }

    OrbitCameraController {
        camera: scene.camera
        linearSpeed: 8
        lookSpeed: 180
    }
}