| 1 |
// Copyright (C) 2015 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 |
import QtQuick 2.2 as QQ2 |
| 9 |
|
| 10 |
Entity { |
| 11 |
id: sceneRoot |
| 12 |
|
| 13 |
FirstPersonCameraController { camera: mainCamera } |
| 14 |
|
| 15 |
components: [ |
| 16 |
RenderSettings { |
| 17 |
ForwardRenderer { |
| 18 |
camera: mainCamera |
| 19 |
} |
| 20 |
}, |
| 21 |
// Event Source will be set by the Qt3DQuickWindow |
| 22 |
InputSettings { } |
| 23 |
] |
| 24 |
|
| 25 |
Camera { |
| 26 |
id: mainCamera |
| 27 |
projectionType: CameraLens.PerspectiveProjection |
| 28 |
fieldOfView: 22.5 |
| 29 |
aspectRatio: _window.width / _window.height |
| 30 |
nearPlane: 0.01 |
| 31 |
farPlane: 1000.0 |
| 32 |
position: Qt.vector3d( 0.0, 0.0, 15.0 ) |
| 33 |
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) |
| 34 |
upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) |
| 35 |
} |
| 36 |
|
| 37 |
MyEntity { |
| 38 |
id: myEntity |
| 39 |
|
| 40 |
source: "assets/obj/trefoil.obj" |
| 41 |
scale: 1.0 |
| 42 |
material.diffuse: Qt.rgba( 1.0, 0.75, 1.0, 1.0 ) |
| 43 |
material.specular: Qt.rgba( 0.2, 0.2, 0.2, 1.0 ) |
| 44 |
material.alpha: 0.2 |
| 45 |
material.beta: 0.6 |
| 46 |
} |
| 47 |
} |