Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QtDataVisualization - semi-transparent QSurface3DSeries

QtDataVisualization - semi-transparent QSurface3DSeries

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
1 Posts 1 Posters 598 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.
  • J Offline
    J Offline
    jarex
    wrote on last edited by
    #1

    Hello dear community! I need render two figures (ellipsoids) which can cross, so it must be semi-transparent. To solve my problem I tried to use Q3DSurface and QSurface3DSerier with setting baseColor property for the QSurface3DSeries with alpha value. But It doesn't work for me.
    I made some test (low-cost) project, with drawing "roof", to try accepting alpha values, but that doesn't work either.

    Test code:

    // Init memory
      Q3DSurface *poSurface = new Q3DSurface();
      QSurface3DSeries *poSeries = new QSurface3DSeries();
      QSurfaceDataArray *poDataArray = new QSurfaceDataArray();
    
      // Generating test surface series
      for ( int i = 0, k = 0; i < 10; ++i)
      {
        QSurfaceDataRow *poRow = new QSurfaceDataRow();
    
        for ( int j = 0; j < 10; ++j )
        {
          float x = j;
          float y = i;
          float z = k;
          poRow->append( QSurfaceDataItem( QVector3D( x, y, z ) ) );
        }
        poDataArray->append( poRow );
    
        if ( i % 2 == 0 )
        {
          ++k;
        }
      }
    
      //
      poSeries->dataProxy()->resetArray( poDataArray );
      poSurface->addSeries( poSeries );
    
      // Setting color with alpha value
      poSeries->setBaseColor( QColor( 100, 100, 100, 100 ));
    
      // Show surface widget
      QWidget *poWidget = QWidget::createWindowContainer( poSurface );
      poWidget->setWindowTitle( "test ");
      poWidget->show();
    

    I expected to see semi-transparent gray surface, but...
    alt text

    What I have to do, to make my surfaces semi-transparent? Thanks!

    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