Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt3D Entity Transform depend on Camera

Qt3D Entity Transform depend on Camera

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 2.3k 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.
  • R Offline
    R Offline
    RSteffen
    wrote on last edited by
    #1

    Hi,
    I like to realize an Entities QTransformation depends on the current QCamera orientation using Qt5.9 Beta. I am new to Qt3D, any hints how to solve this are welcome.

    kshegunovK 1 Reply Last reply
    0
    • R RSteffen

      Hi,
      I like to realize an Entities QTransformation depends on the current QCamera orientation using Qt5.9 Beta. I am new to Qt3D, any hints how to solve this are welcome.

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @RSteffen said in Qt3D Entity Transform depend on Camera:

      It shouldn't unless the camera is a parent for other entities.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RSteffen
        wrote on last edited by
        #3

        Sure, I can bind an entity to the camera entity, but i dont want the object move with the camera. I like to solve the problem to rotate the object (3DText) only to face to the camera.
        Any ideas?

        1 Reply Last reply
        0
        • kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          The point was that if the camera is the parent of your entity, then the camera transformations will be applied to your object as well. If the entity is not a child of the camera entity then they will not. If you need only the rotations to be applied, then I think you need your own solution (e.g. raising a signal from the camera that your entity will catch).

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            RSteffen
            wrote on last edited by
            #5

            Yes I can do this in the FrontEnd, but I believe it would be more general to make that in the BackEnd.
            For a Trackball I tested to attach an Entity (Sphere) to the camera Entity. It seams that its not working. The Entity will not move with the camera. Does I have to set a flag set Transformations will be aggregated?

            kshegunovK 1 Reply Last reply
            0
            • R RSteffen

              Yes I can do this in the FrontEnd, but I believe it would be more general to make that in the BackEnd.
              For a Trackball I tested to attach an Entity (Sphere) to the camera Entity. It seams that its not working. The Entity will not move with the camera. Does I have to set a flag set Transformations will be aggregated?

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #6

              I don't know. You can get the camera's transform through the QCamera::transform method, but I'm unsure whether you can autoapply the transformations. Try doing it manually and see how that works.

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              0
              • G Offline
                G Offline
                guy incognito
                wrote on last edited by
                #7

                You could connect the camera's viewCenterChanged signal to a slot that sets the translation of the entity to camera.viewCenter()

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  RSteffen
                  wrote on last edited by
                  #8

                  Hi.
                  I solved facing an Entity to the camera by inherit a QTransform and calculate the new orientation in the Frontend. But this is not what the best way is. My goal is to extend now the QRenderAspect and register a new type of QCameraFaceTransform. Unlikely I absolutely have no idea how to make it and the calculation should be made in backend Jobs to be calculated in parallel. The documentation is still bad. Maybe it is better to create an own custom Aspect?
                  Any recommendations?

                  Richard

                  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