Details
Description
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 } } }
Attachments
Issue Links
- duplicates
-
QTBUG-129253 OrbitCameraController has clipNear and clipFar hardcoded values
-
- Closed
-
For Gerrit Dashboard: QTBUG-129230 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
595186,6 | OrbitCameraController: Add automaticClipping | dev | qt/qtquick3d | Status: MERGED | +2 | 0 |