Dario3d Dario3d - 24 days ago 18
C++ Question

OpenGL large data 3d plot

I'm trying to make a 3d plot of large data sets (for example 1000 x 500 points) in which x,y is uniformly spread (for example 0, 8, 16, 24 so on), and z describes a value. I were trying to do this with Qt and OpenGL as in here. The problem is that i don't know how many points i will need (it varies), but their amount will be large, and on initialization of VBO i need to specify the amount:

#define N 256
GLbyte graph[N][N];

... /* fill graph here */

/* Upload the texture with our datapoints */
glActiveTexture(GL_TEXTURE0);
glGenTextures(1, &texture_id);
glBindTexture(GL_TEXTURE_2D, texture_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, N, N, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, graph);


So as in this example, in my case N value would be much higher to hold all the points, but i get stack overflow error.
What is the best way to cope with this problem? How can i specify not known amount, other than specifying max amount available? Is there another way to optimize generation of 3dplots of large datasets?

Answer

Of course a vector was a reliable answer to my question, thanks to all who commented on my post :)

Comments