Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-129230

OrbitCameraController does not respect the camera clipFar distance

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.9.0 FF
    • 6.7.2
    • Quick: 3D
    • None
    • MS Windows 11 Home
    • Windows
    • 7c18923ee (dev)

      When the OrbitCameraController is used, the clipFar distance of the camera makes no difference to the clipping distance of the scene. In the example below, with MouseArea commented in, the clipFar distance if the Perspective camera can be varied and has the desired effect. With MouseArea commented out, and OrbitCameraController commented in, the clipFar distance makes no difference to the object clipping - it is fixed at 10000.

       

      import QtQuick
      import QtQuick3D
      import QtQuick3D.Helpers
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          View3D {
              anchors.fill: parent
              camera: cameraNode
              environment: ExtendedSceneEnvironment {
                  backgroundMode: SceneEnvironment.SkyBox
                  lightProbe: Texture {
                      textureData: ProceduralSkyTextureData{}
                  } 
      
                  InfiniteGrid {
                      gridInterval: 100
                  }
              }
      
              Node {
                  id: originNode
                  //eulerRotation.x: -60
                  PerspectiveCamera {
                      id: cameraNode
                      y: 100
                      z: 3000
                      clipNear: 1
                      clipFar: 20000
                      onPositionChanged: console.log("camera position: ", position)
                  }       
      
              Model {
                      source: "#Sphere"
                      materials: [
                          PrincipledMaterial {
                              baseColor: "red"
                          }
                      ]
      
                      scale: Qt.vector3d(10.0, 20.0, 20.0)
                      //position:  Qt.vector3d(-100.0, 200.0, 0.0)
                      //eulerRotation.y: 30
                  }   
           
              }//originNode
      
              /*OrbitCameraController {
                  anchors.fill: parent
                  origin: originNode
                  camera: cameraNode
              }*/
      
          }//View3D
      
      
          MouseArea {
              anchors.fill: parent
              onWheel: {
                  console.log("angleDelta: ", wheel.angleDelta.y)
                  if (wheel.angleDelta.y > 0)
                      cameraNode.position.z += 100
                  else
                      cameraNode.position.z -= 100
              }
          }
      }
       

       

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.graphics.and.multimedia Qt Graphics Team
            bluezoo Ranbir Shoker
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes