Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58884

QSurfaceDataProxy resetArray reads only half of data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.8.0
    • Data Visualization
    • None
    • Win10, Qt 5.8.0.

    Description

      I'm trying to watch some data as a 3d surface. I took a qmloscilloscope example (Qt5.8.0\Examples\Qt-5.8\datavisualization\qmloscilloscope), copied it and replaced a data model generation function (datasource.cpp: Datasource::generateData) body with a call to a following simulateData function:

      bool DataSource::simulateData()
      {
      clearData();
      int nPoints=20;
      float step=1.0f/nPoints;
      QSurfaceDataArray retval;
      for (float x=-1;x<=1;x+=step)

      { QSurfaceDataRow * row=new QSurfaceDataRow(); for (float y=-1;y<=1;y+=step) // x,y,z row->append(QSurfaceDataItem(QVector3D(x,1-sin(x*x+y*y),y))); retval.append(row); }

      m_data.append(retval);
      return true;
      }

      I also replaced limits in main.qml file:
      axisX.min: -1
      axisX.max: 1
      axisZ.min: -1
      axisZ.max: 1
      axisY.min: 0
      axisY.max: 2

      Expected output is shown on a fist screenshot. Real output is shown on a second screenshot. To get a picture as shown on a first screenshot I had to change the code above this way:

      for (float x=-1;x<=3;x+=step)

      { QSurfaceDataRow * row=new QSurfaceDataRow(); for (float y=-1;y<=3;y+=step) // x,y,z row->append(QSurfaceDataItem(QVector3D(x,1-sin(x*x+y*y),y))); retval.append(row); }

      It's easy to see that only half of each dimension of QSurfaceDataArray is drawn. I watched this data under debugger throughout DataSource::update function, and found no errors: an m_resetArray SurfaceDataArray contains exactly the same data as the source array I feed into it. Then this array gets fed into dataProxy()->resetArray function and only half it is drawn.

      I'm using an obvious workaround (feeding data twice over each dimension) but it would be good to know if there's something I'm missing, or is it really a bug in QSurfaceDataProxy.

      Attachments

        1. 2017-02-14_17-03-50.png
          156 kB
          Kirill V. Didkovsky
        2. 2017-02-14_17-07-30.png
          114 kB
          Kirill V. Didkovsky
        3. image-2024-06-03-11-38-01-922.png
          233 kB
          Ryan Thornton
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tokorpip Tomi Korpipää
            kdidkovsky Kirill V. Didkovsky
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes