Debian Codegraph @

tests/manual/torus-qml/main.qml

raw
1 // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import Qt3D.Core 2.0
5 import Qt3D.Render 2.0
6 import Qt3D.Input 2.0
7 import Qt3D.Extras 2.0
8
9 Entity {
10 id: sceneRoot
11
12 Camera {
13 id: camera
14 projectionType: CameraLens.PerspectiveProjection
15 fieldOfView: 45
16 aspectRatio: 16/9
17 nearPlane : 0.1
18 farPlane : 1000.0
19 position: Qt.vector3d( 0.0, 0.0, 20.0 )
20 upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
21 viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
22 }
23
24 FirstPersonCameraController { camera: camera }
25
26 RenderSettings {
27 id : renderSettings
28 activeFrameGraph : ForwardRenderer {
29 camera: camera
30 clearColor: "lightsteelblue"
31 }
32 }
33
34 // Event Source will be set by the Qt3DQuickWindow
35 InputSettings { id: inputSettings }
36
37 components: [renderSettings, inputSettings]
38
39 TorusMesh {
40 id: mesh
41 radius: 5
42 minorRadius: 1
43 rings: 100
44 slices: 20
45 }
46
47 Transform {
48 id: transform
49 scale3D: Qt.vector3d(1.5, 1, 0.5)
50 rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
51 }
52
53 Material {
54 id: material
55 effect : Effect {
56 }
57 }
58
59 Entity {
60 id: mainEntity
61 objectName: "mainEntity"
62 components: [ mesh, material, transform ]
63 }
64 }