title: How to draw grid lines in OpenGL ES Android?
body: <p>I want to draw 10 by 10 grid that defines ground plane such that the center is the origin of the world coordinates. 
  This is the code that is called for each line defined in the grid.</p>
  
  <pre><code>gl.glMatrixMode(GL10.GL_MODELVIEW);
  gl.glLoadIdentity();
  
  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
  
  gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVerticesBuffer);
  
  gl.glTranslatef(x, y, z);
  gl.glRotatef(rz, 0, 0, 1);
  gl.glRotatef(rx, 1, 0, 0);
  gl.glRotatef(ry, 0, 1, 0);
  
  gl.glDrawArrays(GL10.GL_LINES, 0, 2);
  
  gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
  </code></pre>
  
  <p>The problem is I only see one horizontal line. So I think something is wrong. </p>
  
  <p>This is the code that defines the lines:</p>
  
  <pre><code>Line line;
  
  for (int i = 0; i &lt;= 10; i++) {
      // horizontal lines
      line =  new Line(-50, 0, 0, 50, 0, 0, 0, 0, 1, 1);  // blue line
      line.z = (i * 100) - 50;
      lines.add(line);
  
      // draw perspective lines
      line =  new Line(-50, 0, 0, 50, 0, 0, 0, 0, 1, 1);  // blue line
      line.x = (i * 100) - 50;
      line.ry = 90; 
      lines.add(line);
  }
  </code></pre>
  
  <p>For each line in the lines collection I call the drawing code in onDrawFrame.</p>