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

QQuick3DCamera::mapToViewport() return value Z should indicate if point is behind camera or not

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 5.14.0 Beta2
    • Fix Version/s: 5.14.0
    • Component/s: Quick: 3D
    • Labels:
      None
    • Commits:
      9fbc19d564d63832a326d64fe6ebe1224c1d94b9

      Description

      The Z value of vec3 returned by QQuick3DCamera::mapToViewport() indicates the distance to camera clipNear plane. However, this value is always positive, even if the point is behind the camera.

      There are use cases where knowing if the point is in front of or behind the camera is valuable, such as displaying an icon for non-visual item such as light. The icon should be hidden if the light is behind camera, but that is difficult to determine currently without doing the math yourself.

      I suggest QQuick3DCamera::mapToViewport() should return a negative Z value if point is behind camera.

        Attachments

        For Gerrit Dashboard: QTBUG-79578
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              e0348803 Miikka Heikkinen
              Reporter:
              e0348803 Miikka Heikkinen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes