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

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.14.0
    • 5.14.0 Beta2
    • Quick: 3D
    • None
    • 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

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

        Activity

          People

            e0348803 Miikka Heikkinen
            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