Hi,
I have a problem in drawing line.
vertices = vertices.concat([0, 0, 0]);
vertices = vertices.concat([0, 0, 2]);
vertices = vertices.concat([2, 0, 0]);
vertices = vertices.concat([3, 0, 1]);
vertices = vertices.concat([1, 2, 1]);
geometryVertexIndices = geometryVertexIndices.concat([0, 1, 1, 2, 2, 0, 1, 2, 2, 3, 3, 1]);
unpackedColors = unpackedColors.concat(color);
unpackedColors = unpackedColors.concat(color);
unpackedColors = unpackedColors.concat(color);
unpackedColors = unpackedColors.concat(color);
unpackedColors = unpackedColors.concat(color);
In this coding, I can draw two triangles successfully in Chrome (use the first four vertices). However, when I change the Index to the following (add one more line [1, 4]):
geometryVertexIndices = geometryVertexIndices.concat([0, 1, 1, 2, 2, 0, 1, 2, 2, 3, 3, 1, 1, 4]);
It cannot draw triangles and shows nothing in the Chrome. If I change to the following (using the last vertice):
geometryVertexIndices = geometryVertexIndices.concat([0, 1, 1, 2, 2, 0, 1, 2, 2, 3, 3, 4]);
It also shows nothing in the Chrome. I think WebGL cannot draw anything because I use the fifth vertice. May I know how to solve this problem?