The TRIANGLE_STRIP is suppose look like the one in the document (https://p5js.org/reference/#/p5/beginShape 2).

But, when I tried it in WEBGL it looks different, some points are not connected to each other. (https://alpha.editor.p5js.org/binkpitch/sketches/HJkNCBEBQ).

Hey @mlarghydracept correct me if I'm wrong but shouldn't this be fixed by using this :
if (this.immediateMode.shapeMode === constants.TRIANGLE_STRIP) {
var i
for (i = 0; i < this.immediateMode.vertices.length - 2; i++) {
this.immediateMode.edges.push([i, i + 1]);
this.immediateMode.edges.push([i, i + 2]);
}
this.immediateMode.edges.push([
i,
i + 1
]);
}
else {
for (var i = 0; i < this.immediateMode.vertices.length - 1; i++) {
this.immediateMode.edges.push([i, i + 1]);
}
for pushing edges in p5.RendererGL.prototype.endShape.
Still seeing this issue in version 0.7.2 any news on a fix? Works just fine with 2d, but switching to WEBGL renders a line loop instead it seems.

Renders this with 2d

but as soon as I add WEBGL to createCanvas. It becomes this:

Doesnt seem to be fixed in 0.7.2. Below is an image using WEBGL and using P2D side-to-side:


I'm still getting this issue in the p5 web editor
beginShape(TRIANGLE_STRIP);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();
outputs:

I believe the p5 web editor is not updated with the latest version. I am getting correct results for the above example when building from the master branch.
function setup()
{
createCanvas(200, 200, WEBGL);
stroke(0);
fill(255);
background(200);
strokeWeight(2);
}
function draw()
{
beginShape(TRIANGLE_STRIP);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();
}
Outputs:
Also getting correct results for Version 0.7.3 from the official website.
Thanks for checking @AdilRabbani!
Most helpful comment
I believe the p5 web editor is not updated with the latest version. I am getting correct results for the above example when building from the master branch.
Outputs: