I need to create software for displaying a huge number of geometrical objects.
It can be more than 2000000 primitives.
OpenGL begin to fail if the number of primitives is about 800000.
I wrote a simple program that generates a number of GL_QUADS.
Here is the part of the code:
//***************
GLuint list;
list = glGenLists( 1 );
glNewList( list, GL_COMPILE );
glBegin(GL_QUADS);
GLdouble x,dx;
long i=0;
qglColor( green );
long numOfFaces=700000;
dx=2./numOfFaces;
for (i=0;i<numOfFaces;i++)
{
x=double(i2.)/numOfFaces -1.;
glVertex3d(x, 0.2,1.0);
glVertex3d(x+dx,0.2, 1.0);
glVertex3d(x+dx,- 0.2, 1.0);
glVertex3d(x, -0.2, 1.0);
}
glEnd();
glEndList();
//***********
If numOfFaces is up to 600000 it works.
It should not be any problem with precision, if OpenGL store the data with double precision. (glVertex3d function is used)
Unfortunately I need to be able to draw a huge number of geometrical primitives.
Are there any ideas why the problem occurs and how it can be solved?
Thank you in advance.
My Computer:
Windows XP (problem also exists at least on Windows 2000, 95 )
Intel Pentium 4 CPU 2,00 GHz
512 MB RAM
64 MB NVIDIA GeForce2MX