2022-06-08 12:47:24 +00:00
|
|
|
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2014-09-24 10:13:37 +00:00
|
|
|
|
2015-10-15 14:05:37 +00:00
|
|
|
import Qt3D.Core 2.0
|
2015-10-18 08:58:19 +00:00
|
|
|
import Qt3D.Render 2.0
|
2016-01-21 08:55:07 +00:00
|
|
|
import Qt3D.Input 2.0
|
2016-04-11 12:58:17 +00:00
|
|
|
import Qt3D.Extras 2.0
|
2014-09-24 10:13:37 +00:00
|
|
|
|
|
|
|
Entity {
|
|
|
|
id: sceneRoot
|
|
|
|
|
|
|
|
Camera {
|
|
|
|
id: camera
|
2014-10-27 14:11:36 +00:00
|
|
|
projectionType: CameraLens.PerspectiveProjection
|
|
|
|
fieldOfView: 45
|
|
|
|
aspectRatio: 16/9
|
|
|
|
nearPlane : 0.1
|
|
|
|
farPlane : 1000.0
|
2016-01-05 09:08:00 +00:00
|
|
|
position: Qt.vector3d( 0.0, 0.0, 20.0 )
|
2014-10-27 14:11:36 +00:00
|
|
|
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
|
|
|
|
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
|
2014-09-24 10:13:37 +00:00
|
|
|
}
|
|
|
|
|
2016-05-03 11:35:35 +00:00
|
|
|
OrbitCameraController { camera: camera }
|
2014-09-24 10:13:37 +00:00
|
|
|
|
2016-02-26 17:21:20 +00:00
|
|
|
RenderSettings {
|
2014-09-24 10:13:37 +00:00
|
|
|
id : external_forward_renderer
|
|
|
|
activeFrameGraph : ForwardRenderer {
|
|
|
|
camera: camera
|
2015-01-16 11:55:46 +00:00
|
|
|
clearColor: "black"
|
2014-09-24 10:13:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-21 08:55:07 +00:00
|
|
|
// Event Source will be set by the Qt3DQuickWindow
|
|
|
|
InputSettings { id: inputSettings }
|
|
|
|
|
|
|
|
components: [external_forward_renderer, inputSettings]
|
2014-09-24 10:13:37 +00:00
|
|
|
|
2020-07-30 11:03:46 +00:00
|
|
|
CylinderMesh {
|
2014-09-24 10:13:37 +00:00
|
|
|
id: mesh
|
2020-07-30 11:03:46 +00:00
|
|
|
radius: 1
|
|
|
|
length: 3
|
|
|
|
rings: 100
|
|
|
|
slices: 20
|
2014-09-24 10:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Transform {
|
|
|
|
id: transform
|
2015-11-11 12:18:26 +00:00
|
|
|
scale: 1.5
|
|
|
|
rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
|
2014-09-24 10:13:37 +00:00
|
|
|
}
|
|
|
|
|
2016-01-18 10:08:41 +00:00
|
|
|
PhongMaterial {
|
2014-09-24 10:13:37 +00:00
|
|
|
id: material
|
2016-01-18 10:08:41 +00:00
|
|
|
diffuse: "green"
|
2014-09-24 10:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Entity {
|
|
|
|
id: mainEntity
|
|
|
|
objectName: "mainEntity"
|
|
|
|
components: [ mesh, material, transform ]
|
|
|
|
}
|
|
|
|
}
|