| 1 |
// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
import Qt3D.Core 2.9 |
| 5 |
import Qt3D.Render 2.9 |
| 6 |
import Qt3D.Extras 2.9 |
| 7 |
import QtQuick.Window 2.0 |
| 8 |
|
| 9 |
Entity { |
| 10 |
id: sceneRoot |
| 11 |
|
| 12 |
Window { |
| 13 |
id: win |
| 14 |
width: 800 |
| 15 |
height: 800 |
| 16 |
visible: true |
| 17 |
} |
| 18 |
|
| 19 |
Camera { |
| 20 |
id: camera |
| 21 |
projectionType: CameraLens.PerspectiveProjection |
| 22 |
fieldOfView: 45 |
| 23 |
nearPlane : 0.1 |
| 24 |
farPlane : 1000.0 |
| 25 |
position: Qt.vector3d( 0.0, 0.0, -40.0 ) |
| 26 |
upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) |
| 27 |
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) |
| 28 |
} |
| 29 |
|
| 30 |
components: [ |
| 31 |
RenderSettings { |
| 32 |
Viewport { |
| 33 |
normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0) |
| 34 |
|
| 35 |
RenderSurfaceSelector { |
| 36 |
|
| 37 |
surface: win |
| 38 |
|
| 39 |
ClearBuffers { |
| 40 |
buffers : ClearBuffers.ColorDepthBuffer |
| 41 |
NoDraw {} |
| 42 |
} |
| 43 |
|
| 44 |
CameraSelector { |
| 45 |
camera: camera |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
] |
| 51 |
|
| 52 |
Entity { |
| 53 |
components: [ |
| 54 |
ShaderData { |
| 55 |
property vector3d eyePosition: Qt.vector3d(1.0, 1.0, 1.0); |
| 56 |
property int eyePositionTransformed: 0 // ModelToEye (enum aren't publicly exposed yet) |
| 57 |
}, |
| 58 |
Transform { |
| 59 |
translation: Qt.vector3d(0.0, 5.0, 0.0) |
| 60 |
} |
| 61 |
] |
| 62 |
} |
| 63 |
} |