Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/3dview/SceneEntity.qml
Show All 25 Lines | |||||
26 | import Qt3D.Input 2.0 | 26 | import Qt3D.Input 2.0 | ||
27 | import Qt3D.Extras 2.0 | 27 | import Qt3D.Extras 2.0 | ||
28 | import Atelier 1.0 | 28 | import Atelier 1.0 | ||
29 | 29 | | |||
30 | Entity { | 30 | Entity { | ||
31 | id: sceneRoot | 31 | id: sceneRoot | ||
32 | property string currentFile | 32 | property string currentFile | ||
33 | 33 | | |||
34 | BedProperties { | ||||
35 | id: bedProperties | ||||
36 | } | ||||
37 | | ||||
34 | Camera { | 38 | Camera { | ||
35 | id: camera | 39 | id: camera | ||
36 | fieldOfView: 45 | 40 | fieldOfView: 45 | ||
37 | position: Qt.vector3d( 10.0, -10.0, 35.0 ) | 41 | position: Qt.vector3d( 10.0, -10.0, 35.0 ) | ||
38 | upVector: Qt.vector3d( 0.0, 0.85, 0.75 ) | 42 | upVector: Qt.vector3d( 0.0, 0.85, 0.75 ) | ||
39 | viewCenter: Qt.vector3d( 10.0, 10.0, 0.0 ) | 43 | viewCenter: Qt.vector3d( 10.0, 10.0, 0.0 ) | ||
40 | } | 44 | } | ||
41 | 45 | | |||
42 | CameraController { camera: camera } | 46 | CameraController { camera: camera } | ||
43 | 47 | | |||
44 | components: [ | 48 | components: [ | ||
45 | RenderSettings { | 49 | RenderSettings { | ||
46 | activeFrameGraph: ForwardRenderer { | 50 | activeFrameGraph: ForwardRenderer { | ||
47 | camera: camera | 51 | camera: camera | ||
48 | frustumCulling: false | 52 | frustumCulling: false | ||
49 | } | 53 | } | ||
50 | }, | 54 | }, | ||
51 | InputSettings { } | 55 | InputSettings { } | ||
52 | ] | 56 | ] | ||
53 | 57 | | |||
54 | Entity { | 58 | Entity { | ||
55 | id: gridEntity | 59 | id: gridEntity | ||
56 | components: [ | 60 | components: [ | ||
57 | PhongMaterial { ambient: "darkBlue" }, | 61 | PhongMaterial { ambient: "darkBlue" }, | ||
58 | GridMesh {} | 62 | GridMesh { | ||
63 | meshResolution: Qt.size(Math.floor(bedProperties.width / 10), | ||||
64 | Math.floor(bedProperties.depth / 10)) | ||||
65 | }, | ||||
66 | Transform { | ||||
67 | scale3D: Qt.vector3d(bedProperties.width / 10, | ||||
68 | bedProperties.depth / 10, | ||||
69 | 1) | ||||
70 | } | ||||
59 | ] | 71 | ] | ||
60 | } | 72 | } | ||
61 | 73 | | |||
62 | Entity { | 74 | Entity { | ||
63 | id: lineEntity | 75 | id: lineEntity | ||
64 | components: [ | 76 | components: [ | ||
65 | PhongMaterial { ambient: "darkGreen" }, | 77 | PhongMaterial { ambient: "darkGreen" }, | ||
66 | LineMesh { | 78 | LineMesh { | ||
Show All 11 Lines |