Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Surface3D and CustomItems



  • 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



  • This was too computationally expensive.

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


Log in to reply