Skip to content

Commit d8ff4ff

Browse files
committed
new PR for issue #6383
1 parent 186553b commit d8ff4ff

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/webgl/3d_primitives.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,10 +1573,15 @@ p5.RendererGL.prototype.quad = function(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4,
15731573
quadGeom.faces.push([pt0, pt2, pt3]);
15741574
}
15751575
}
1576-
quadGeom
1577-
.computeNormals()
1578-
._makeTriangleEdges()
1579-
._edgesToVertices();
1576+
quadGeom.computeNormals()
1577+
quadGeom.edges.length = 0;
1578+
const vertexOrder = [0, 2, 3, 1];
1579+
for (let i = 0; i < vertexOrder.length; i++) {
1580+
const startVertex = vertexOrder[i];
1581+
const endVertex = vertexOrder[(i + 1) % vertexOrder.length];
1582+
quadGeom.edges.push([startVertex, endVertex]);
1583+
}
1584+
quadGeom._edgesToVertices();
15801585
this.createBuffers(gId, quadGeom);
15811586
}
15821587
this.drawBuffers(gId);

0 commit comments

Comments
 (0)