| 1 |
// Copyright (C) 2017 The Qt Company Ltd. |
| 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.Extras 2.0 |
| 7 |
import Qt3D.Input 2.0 |
| 8 |
import QtQuick 2.0 as QQ2 |
| 9 |
|
| 10 |
|
| 11 |
Entity { |
| 12 |
id: sceneRoot |
| 13 |
|
| 14 |
Camera { |
| 15 |
id: camera |
| 16 |
projectionType: CameraLens.PerspectiveProjection |
| 17 |
fieldOfView: 45 |
| 18 |
nearPlane: 0.1 |
| 19 |
farPlane: 1000.0 |
| 20 |
position: Qt.vector3d(0.0, 4.0, 15.0) |
| 21 |
upVector: Qt.vector3d(0.0, 1.0, 0.0) |
| 22 |
viewCenter: Qt.vector3d(0.0, -2.0, 0.0) |
| 23 |
} |
| 24 |
|
| 25 |
FirstPersonCameraController { |
| 26 |
camera: camera |
| 27 |
} |
| 28 |
|
| 29 |
Entity { |
| 30 |
DirectionalLight { |
| 31 |
id: directional |
| 32 |
worldDirection: Qt.vector3d(0.3, -1.0, 5.0).normalized(); |
| 33 |
color: "#fff2a3" |
| 34 |
intensity: 0.01 |
| 35 |
} |
| 36 |
Transform { |
| 37 |
id: lightpostransform |
| 38 |
translation: Qt.vector3d(0.0, 50.0, 60.0) |
| 39 |
} |
| 40 |
components: [lightpostransform, directional] |
| 41 |
} |
| 42 |
|
| 43 |
Entity { |
| 44 |
PointLight { |
| 45 |
id: pointL |
| 46 |
color: "#fff2a3" |
| 47 |
} |
| 48 |
Transform{ |
| 49 |
id: plightpostransform |
| 50 |
translation: Qt.vector3d(0.0, 4.0, 15.0) |
| 51 |
} |
| 52 |
components: [plightpostransform, pointL] |
| 53 |
} |
| 54 |
|
| 55 |
components: [ |
| 56 |
RenderSettings { |
| 57 |
activeFrameGraph: ForwardRenderer { |
| 58 |
id: renderer |
| 59 |
clearColor: "black" |
| 60 |
camera: camera |
| 61 |
} |
| 62 |
}, |
| 63 |
InputSettings { } |
| 64 |
] |
| 65 |
|
| 66 |
Water { } |
| 67 |
} |