Debian Codegraph @

tests/manual/clip-planes-qml/main.qml

raw
1 // Copyright (C) 2015 Paul Lemire
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import QtQuick 2.4 as QQ2
5 import Qt3D.Core 2.0
6 import Qt3D.Render 2.0
7 import Qt3D.Input 2.0
8 import Qt3D.Extras 2.0
9
10 Entity {
11 id: root
12
13 Camera {
14 id: camera
15 projectionType: CameraLens.PerspectiveProjection
16 fieldOfView: 45
17 aspectRatio: 800/600
18 nearPlane : 0.1
19 farPlane : 1000.0
20 position: Qt.vector3d( 0.0, 0.0, 40.0 )
21 upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
22 viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
23 }
24
25 FirstPersonCameraController { camera: camera }
26
27 components: [
28 RenderSettings {
29 ClipCappingFrameGraph {
30 id: frameGraph
31 camera: camera;
32 clearColor: Qt.rgba(0.0, 0.5, 1, 1)
33 }
34 },
35 // Event Source will be set by the Qt3DQuickWindow
36 InputSettings { }
37 ]
38
39 ClipMaterialEffect {
40 id: clipMaterialEffect
41 sectionsData: clippingPlanes.sectionData
42 }
43
44 ClippingPlanes {
45 id: clippingPlanes
46 visualizationLayer: frameGraph.visualizationLayer
47 capsLayer: frameGraph.capsLayer
48 }
49
50 // Entity being clipped
51 Entity {
52
53 property Material material: Material {
54 effect: clipMaterialEffect
55 parameters: [
56 Parameter { name: "ka"; value: "black" },
57 Parameter { name: "kd"; value: "blue" },
58 Parameter { name: "ks"; value: "white" }
59 ]
60 }
61
62 property Mesh mesh: Mesh {
63 source: "qrc:/assets/obj/trefoil.obj"
64 }
65
66 property Transform transform: Transform {
67 translation: Qt.vector3d( 0.0, 0.0, 0.0 )
68 scale: 3
69 }
70
71 components: [material, transform, mesh, frameGraph.contentLayer]
72 }
73 }