Vishwanath Deshmukh
Vishwanath Deshmukh

Reputation: 649

How to draw grid lines in opengl android

I've drawn multiple 3d cubes objects using following function:

gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertexCount);

Now, I have to draw gridline too on it.So can you please tell me how to draw these gridlines(boxes) on it using opengl.

Thanks.

Upvotes: 1

Views: 1703

Answers (1)

Jave
Jave

Reputation: 31846

If I understand you correctly you want to draw lines? If so, all you have to do is create vertices as usual and draw them using GL10.GL_LINES instead of GL10.GL_TRIANGLES (or triangle_strip).
You can change the width of the lines by calling glLineWidth()

Upvotes: 1

Related Questions