Qt3D Entity Transform depend on Camera

  • 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.

  • Qt Champions 2017

    @RSteffen said in Qt3D Entity Transform depend on Camera:

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

  • 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?

  • Qt Champions 2017

    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).

  • 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?

  • Qt Champions 2017

    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.

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

  • 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?


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.