Hi community
I am currently experimenting with UpdateBufferPoints.cpp. I have modified the code slightly so that my AXIS_COUNT = 2.
Instead of using the default code as given in the example which creates two arrays namely positions and times I am using my own method to create two arrays. The difference is in my method the number of elements in the positions array is twice the number of elements in the time array because it is a 2 axis system.
//Original:
// populate the positions and times std::vector<double> positions, times; for (int i = 0; i < TOTAL_POINTS; i += AXIS_COUNT) { positions.push_back(i * TIME_SLICE * RPS); times.push_back(TIME_SLICE); }
//Modified for 2 Axis
// Filling the arrays with some data (for illustration purposes) for (int i = 0; i < TOTAL_POINTS; i++) { arrayAxisX[i] = i * 0.01; // Example X-axis values arrayAxisY[i] = i * 1; // Example Y-axis values arrayTime[i] = TIME_SLICE; // Example time values } // Interleave the position data for both axes into positions array for (int i = 0; i < arrayAxisX.size(); ++i) { positions.push_back(arrayAxisX[i]); positions.push_back(arrayAxisY[i]); }
Everything else in the code is pretty much the same. Now when I run the code, it gives me the following error:
However if I am debugging the code using F5 with some breakpoints to see what is triggering the error, it does not give me an error and runs all the way through. Could someone please be able to tell why that would happen?
TIA !