Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Zooming OrthogonalCamera in QtQuick 3D
Forum Updated to NodeBB v4.3 + New Features

Zooming OrthogonalCamera in QtQuick 3D

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 254 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ser_pl
    wrote on last edited by
    #1

    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
            }
        }
    }
    
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved