How to draw a continuous line from a set of consecutive points?
in
Contributed Library Questions
•
2 years ago
Hi,
I have a grid of points[m x n] and need to draw a series of horizontal lines, but all I get is a dash line pattern,
I am using the GLGraphics library, here is a code snippet
- points = new GLModel(this, totalPoints, LINES, GLModel.DYNAMIC);
- points.initColors();
- points.beginUpdateVertices();
- // for (int i = 0; i < totalPoints; i++) points.updateVertex( i, pointsPos[i].x, pointsPos[i].y, pointsPos[i].z );
- for (int i = 0; i < GRID_ROWS; i++) {
- for (int j = 0; j < GRID_COLUMS; j++) {
- int n = i + j * GRID_ROWS;
- System.out.println("n(" + n + "): " + n % 2);
- points.updateVertex(n, pointsPos[n].x, pointsPos[n].y, pointsPos[n].z);
- }
- }
- points.endUpdateVertices();
I try to use LINE_STRIP or LINE_LOOP but these constants are not valid parameters to the GLModel constructor, and I have no idea how to set this up.
Any help will be much appreciated
- rS
1