Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt3D - [c++] QExtrudedTextMesh gets overlayed by lower QCuboidMesh
Forum Updated to NodeBB v4.3 + New Features

Qt3D - [c++] QExtrudedTextMesh gets overlayed by lower QCuboidMesh

Scheduled Pinned Locked Moved Solved Game Development
3 Posts 1 Posters 472 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.
  • K Offline
    K Offline
    kevin_d
    wrote on last edited by
    #1

    HI!

    I have a QCuboidMesh with a certain z-extend.
    Also, i transform it for test reason to a factor of 0.001.
    Additionally, i place a QExtrudedTestMesh vertically significant above the cuboid.

    Unfortunately, the TextMesh gets randomly replaced by the pixel-contents of the cuboid, although its z-position is lower than the text's.

    I have tried layers, layerfilters and raycasters, but the text gets cropped by the cuboid screen values, obviously clipping after the text.

    1. Is there an advice of how to render the entities according to their world coordinates?
    2. Is there the usage of QLayers, to stack objects visually above each others? or ...
    3. Can i trigger the order in which the entities are drawn? So to draw the "lower" entities first?

    best regards

    Code:

    EntityClassA : QEntity(root)
    {
        auto* tile = Qt3DExtras::QCuboidMesh(root);
        tile->setXExtend(1);
        tile->setYExtend(1);
        tile->setZExtend(0.01);
    
        Qt3DCore::QTransform scale = new Qt3DCore::QTransform;
        scale->setScale3D(QVector(1, 1, 0.001);
        addComponent(scale);
        addComponet(tile);
    }
    
    EntityClassB : QEntity(root)
    {
        auto* text = new Qt3DExtras::QExtrudedTextMesh(root);
        text->setText("A1");
        Qt3DCore::QTransform scaleText = new Qt3DCore::QTransform;
        scaleText->setTranslation(x,y, properZValue);
        addComponent(scaleText);
        addComponent(text);
    }
    
    1 Reply Last reply
    0
    • K Offline
      K Offline
      kevin_d
      wrote on last edited by
      #2

      Significally, if i set an opaque material onto the cuboid, i observe, that some texts are treated as if they were "inside" the cuboid, which is physically not the case.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kevin_d
        wrote on last edited by
        #3

        Finally the scene gets properly rendered by explicietely setting the QSortPolicy on the frameGraph:

        Qt3DRender::QFrameGraphNode *framegraph = view.activeFrameGraph();
        Qt3DRender::QSortPolicy *sortPolicy = new Qt3DRender::QSortPolicy(scene);
        framegraph->setParent(sortPolicy);
        QVector<Qt3DRender::QSortPolicy::SortType> sortTypes = 
              QVector<Qt3DRender::QSortPolicy::SortType>() << Qt3DRender::QSortPolicy::BackToFront;
        sortPolicy->setSortTypes(sortTypes);
        view.setActiveFrameGraph(framegraph);
        
        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