Reputation: 11
Is it possible to show 3D scene with two viewports who will be drawn over each other and to display different meshes appropriate with different cameras using QtWidgets/C++ ?
Can someone share some code example how to make that.
Thanks
Upvotes: 1
Views: 520
Reputation: 3345
Using framegraphs:
Essentially, you need to add two QViewPorts
to your framegraph where e.g. one covers the left half and the other the right half of the screen. Along the branches, you can use two different QCameraSelectors
. I guess by drawn over each other you mean next to each other, I don't think you can actually draw them over each other.
There's the Qt3D Multiviewport example. It's in QML but should be easily translatable to QML.
Then you can point one camera at the first object and another camera at the second object and simply place them somewhere differently in 3D space.
Using two Qt3DWindows:
Simply use two Qt3DWindows next to each other and embed them.
Upvotes: 1