Problems drawing points using glDrawArrays

Hi,

I got an field of 3D-Coordinates with the dimensions 620x512. I am trying to display the points using JOGL. It worked fine with display lists, but now I want to use the glDrawArrays-funktion.
First I create an FloatBuffer:

this.coordBuffer = BufferUtil.newFloatBuffer( 150000 );

After that I fill the buffer and set it as VertexPointer:


for (...)
{
   this.coordBuffer.put( (float) coord.x );
   this.coordBuffer.put( (float) coord.y );
   this.coordBuffer.put( (float) coord.z );
}
this.coordBuffer.rewind();
gl.glVertexPointer( 3, GL.GL_FLOAT, 0, this.pointCloud.coordBuffer );

Now wenn I try to draw the Array:


gl.glDrawArrays( GL.GL_POINTS, 0, 620*512 );

the Display stays blank.
Now the interessting thing is, if I use only 5000 Points it works fine, but if I create the Buffer for 50000 or more Points nothing appears on the screen even if I try to paint just 50 coordinates


gl.glDrawArrays( GL.GL_POINTS, 0, 50 );

Is there any maximum size for the FloatBuffer? Or do I miss something else?

Thanks in advance for any help.

Hi!

Yes there is a maximum size:

IntBuffer buffer=BufferUtil.newIntBuffer(1);	
GLU.getCurrentGL().glGetIntegerv(GL.GL_MAX_ELEMENTS_VERTICES,buffer);
buffer.position(0);
int internalGlMaxElementsVertices=buffer.get();

(from the source code of TUER)

Thanks a lot, that was exactly what I was looking for. ;D

You’re welcome. Take care, this constant has disappeared in JOGL-ES and I am not sure it will still exist in future versions of OpenGL unfortunately.