Closed stringnotfound1 closed 5 years ago
Could you please share the code about this continuous line?thank you
I only changed one line inside the drawLines
method that can be found inside the Vertices class :
public static void drawLines(GL10 gl, FloatBuffer vertices, Color color, float width) {
vertices.mark();
color.apply(gl);
gl.glLineWidth(width);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertices);
// GL_LINE_STRIP instead of GL_LINES
gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, countVertices(vertices, 3));
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
vertices.reset();
}
Does that answer your question?
absolutely bro.. thanks a lot.
Thanks @stringnotfound1, closed in #307.
I think it would make sense to use
GL_LINE_STRIP
as the draw mode inside the drawLines() method of Vertices. Short explanation:GL_LINES
only draws a line between every two vertices whileGL_LINE_STRIP
draws a line between every specified vertex. Link to documentation.I've attached two pictures to show a comparison:
GL_LINES:![lines](https://user-images.githubusercontent.com/32774990/58479369-74e85880-8158-11e9-94e4-3d70126820ba.png)
GL_LINE_STRIP:![line_strip](https://user-images.githubusercontent.com/32774990/58479389-82054780-8158-11e9-8461-9dc9ef38ef99.png)