Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new PR for issue #6383(Problem for diagonal) #6488

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/webgl/3d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -1573,10 +1573,15 @@ p5.RendererGL.prototype.quad = function(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4,
quadGeom.faces.push([pt0, pt2, pt3]);
}
}
quadGeom
.computeNormals()
._makeTriangleEdges()
._edgesToVertices();
quadGeom.computeNormals()
davepagurek marked this conversation as resolved.
Show resolved Hide resolved
quadGeom.edges.length = 0;
const vertexOrder = [0, 2, 3, 1];
for (let i = 0; i < vertexOrder.length; i++) {
const startVertex = vertexOrder[i];
const endVertex = vertexOrder[(i + 1) % vertexOrder.length];
quadGeom.edges.push([startVertex, endVertex]);
}
quadGeom._edgesToVertices();
this.createBuffers(gId, quadGeom);
}
this.drawBuffers(gId);
Expand Down
Loading