Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.8.0
-
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)
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.