-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Trying to pass z coordinates to quad for 3d rendering doesn't work, there is no implementation for 12 args (which would contain z)
p5.js/src/webgl/3d_primitives.js
Lines 1027 to 1064 in 9851414
| p5.RendererGL.prototype.quad = function(x1, y1, x2, y2, x3, y3, x4, y4) { | |
| var gId = | |
| 'quad|' + | |
| x1 + | |
| '|' + | |
| y1 + | |
| '|' + | |
| x2 + | |
| '|' + | |
| y2 + | |
| '|' + | |
| x3 + | |
| '|' + | |
| y3 + | |
| '|' + | |
| x4 + | |
| '|' + | |
| y4; | |
| if (!this.geometryInHash(gId)) { | |
| var _quad = function() { | |
| this.vertices.push(new p5.Vector(x1, y1, 0)); | |
| this.vertices.push(new p5.Vector(x2, y2, 0)); | |
| this.vertices.push(new p5.Vector(x3, y3, 0)); | |
| this.vertices.push(new p5.Vector(x4, y4, 0)); | |
| this.uvs.push(0, 0, 1, 0, 1, 1, 0, 1); | |
| this.strokeIndices = [[0, 1], [1, 2], [2, 3], [3, 0]]; | |
| }; | |
| var quadGeom = new p5.Geometry(2, 2, _quad); | |
| quadGeom | |
| .computeNormals() | |
| ._makeTriangleEdges() | |
| ._edgesToVertices(); | |
| quadGeom.faces = [[0, 1, 2], [2, 3, 0]]; | |
| this.createBuffers(gId, quadGeom); | |
| } | |
| this.drawBuffers(gId); | |
| return this; | |
| }; |
Originally posted by @meiamsome in https://github.com/_render_node/MDExOlB1bGxSZXF1ZXN0MjMyMDgxNzM4/pull_requests/unread_timeline#issuecomment-440012991
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels