Zooming OrthogonalCamera in QtQuick 3D
Unsolved
QML and Qt Quick
-
Hi
I'm creating a scene in with QtQuick 3D and I need to show as several orthogonal projections.
The scene can have various size, but I cannot find how to scale the camera image: it is mapped to a View3D in 1:1 scale.as a solution, I managed to increase View3D's size basing on the scene size and then to scale the View3D, but there is a limitation that an Item cannot be greater than 16383 pixels. So, if I have the 3D scene bigger than this number, I cannot pu it in my View3D.
Zooming out the camera to scale the initial image could help, but I can't find such option. What could be a solution for the poblem?
This is the code how I instantiate the View3D:
Item { id: root property real zoom: Math.min(root.width / view.width, root.height / view.height) View3D { id: view anchors.centerIn: parent importScene: MyScene camera: MyScene.cameraFront // Here I can reach values, too big for be processed width: MyScene.xmax - MyScene.xmin height: MyScene.ymax - MyScene.ymin environment: SceneEnvironment { backgroundMode: SceneEnvironment.Color clearColor: Theme.gray } transform: Scale { origin.x: view.width / 2 origin.y: view.height / 2 xScale: root.zoom yScale: xScale } } }