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. Surface3D and CustomItems
Forum Updated to NodeBB v4.3 + New Features

Surface3D and CustomItems

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 876 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.
  • M Offline
    M Offline
    MrDaniel
    wrote on last edited by MrDaniel
    #1

    Hello,

    I am working with Qml Types for a UI as a front end to a C++ application.

    QT is really neat! I got a 3D surface with a texture, and i can also super-impose a heat map! It's awesome!

    Now. I am interested in marking specific points. There could be a lot of them so am unsure how to handle this.

    If we take the example of the QML Type example it creates a cool output.

    https://doc.qt.io/qt-5/qtdatavisualization-qmlsurface-example.html

    Now. How to add points. Let's say we want a label on each of the highest peaks of the terrain. Assume the calculation is done, and we want to place 4 markers inside of the Surface3D.

    Simplest example would be to put a "O" at each location. This does not appear in the Surface3D displayed when it is run.

            Custom3DLabel
            {
                visible: true
                position: vector3d(3, 3, 3)
                scaling: 10
                text: "O"
                textColor: "black"
            }
    

    I think the vector3d is an issue, but not sure what to replace it with.

    So if i can get a label at each point i desire on the terrain. Could this be made to use a sphere? If there's 100s of points i don't want performance to be a BIG issue. ;)

    Please let me know you're thoughts. I'm stuck with this for now.

    UPDATE:

    Also, i would like to add these dynamically during an onClicked event for a button. And removed by another onClicked event. Any thoughts on managing this?

    Update:
    customItemList: [
    Custom3DLabel
    {
    visible: true
    position: "0,0,0"
    scaling: 1
    text: "O"
    textColor: "black"
    }
    ]

    Now i'm adding it to the customItemList of the Surface3D but still can't see the text.

    Regards

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MrDaniel
      wrote on last edited by
      #2

      This was too computationally expensive.

      customItemList should be define in the qml and then you can add to it!

      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