blob: 9379b949afdb770134a3832c79793ee890653b01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import Qt3D.Core 2.0
import Qt3D.Render 2.0
Viewport {
property alias leftCamera: leftCameraSelector.camera
property alias rightCamera: rightCameraSelector.camera
property alias window: surfaceSelector.surface
RenderSurfaceSelector {
id: surfaceSelector
// ColorMask is reset by default
// By default reset to the default if not specified
ClearBuffers {
clearColor: "white"
buffers: ClearBuffers.ColorDepthBuffer
NoDraw {} // We just want to clear the buffers
}
// Draw with left eye
Viewport {
id: leftViewport
normalizedRect: Qt.rect(0, 0, .5, 1)
CameraSelector {
id: leftCameraSelector
}
}
// Draw with right eye
Viewport {
id: rightViewport
normalizedRect: Qt.rect(.5, 0, .5, 1)
CameraSelector {
id: rightCameraSelector
}
}
}
}
|