Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Render qml into canvas3d?
Forum Updated to NodeBB v4.3 + New Features

Render qml into canvas3d?

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 2.1k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    Tasslord
    wrote on last edited by
    #1

    Hi all,

    I am fascinated from the new qml canvas3d element :)
    I would like to know if I could put qml elements into the canvas3d.
    My app contains a 3d object rendered with WebGL and I try to add fly outs to the 3d object.
    The Fly outs shall be made with qml. First I wanted to create images out of the qml element and use them as textures on a simple 3d plain. But this solution wont work because I want them interactive (e.g. click-able ).
    Or is there another way to put my 2d qml elements into a 3d space... attached to a 3d object?

    Thanks in advance :)

    1 Reply Last reply
    0
    • O Offline
      O Offline
      onek24
      wrote on last edited by
      #2

      Hello and welcome to devnet,

      bq. The Fly outs shall be made with qml. First I wanted to create images out of the qml element and use them as textures on a simple 3d plain. But this solution wont work because I want them interactive (e.g. click-able ).

      You can make it clickable;

      @Image {
      ...
      MouseArea {
      anchors.fill: parent
      onClicked: console.log("Clicked the Image =)")
      }
      }@

      In this example the MouseArea will overlay the Image and will react on everything you want the MouseArea to react to.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tasslord
        wrote on last edited by
        #3

        Hey :) Thx for the welcome.

        Wouldn't I loose the MouseArea after putting the image into the canvas3d?

        1 Reply Last reply
        0
        • O Offline
          O Offline
          onek24
          wrote on last edited by
          #4

          [quote author="Tasslord" date="1422281719"]Hey :) Thx for the welcome.

          Wouldn't I loose the MouseArea after putting the image into the canvas3d?
          [/quote]

          You're welcome. I haven't tried it, sorry. It was just an idea :). I would appreciate if you could try it out. If it won't work i'll seach for another approach.

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

            QtQuick elements as texture will not be supported in Canvas3D 1.0. But it seems to be popping up quite often as a request so I'm considering supporting rendering of QtQuick elements to texture in later versions. Unfortunately it is rather involved rewrite of the Canvas3D rendering meaning serialization of all context calls, passing them to render thread etc. So probably it will take some time to implement it.

            You could try to mix the 2D QtQuick elements in to the scene by placing them on top of the Canvas3D element and using the "2.5D" transforms offered by QtQuick to make them appear more 3D.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rectalogic
              wrote on last edited by
              #6

              What about setting layer.enabled on the element to turn it into a QSGTextureProvider and supporting QSGTexture in Canvas3D? All the QSG stuff lives on the render thread - is the issue that Canvas3D does not live on the render thread and so to use QSG it would need to serialize everything onto that thread?

              I'm hoping to eventually be able to use a VideoOutput with layer.enabled as a streaming video texture provider into Canvas3D.

              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