Skip to content

Conversation

@unjust
Copy link
Contributor

@unjust unjust commented Nov 19, 2018

Found the docs a little confusing when trying to create a quad with z coordinates.
Clarify the ordering of arguments for quad.

If I'm not posting this correctly - to the correct repo or into the correct branch, let me know. (I just followed the links at the bottom of the docs)

clarify the ordering of arguments for quad
@Spongman
Copy link
Contributor

i'm afraid this isn't going to work. the ordering of the parameters in the docs must match the ordering in the code.

@unjust
Copy link
Contributor Author

unjust commented Nov 19, 2018

ok I must be doing something wrong then because the params don't work as expected for me.

@unjust unjust closed this Nov 19, 2018
@Spongman
Copy link
Contributor

Can you post an example here?

@meiamsome
Copy link
Member

Looks like the 3D renderer only has a 2D implementation of quad:

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;
};
This should be opened as an issue, I suspect

@unjust
Copy link
Contributor Author

unjust commented Nov 19, 2018

Right, any additional args past 8 just get ignored. At first I thought it was an ordering problem.

@unjust unjust reopened this Nov 19, 2018
@lmccart
Copy link
Member

lmccart commented Nov 20, 2018

ok great. closing this and we can follow up with the issue you've posted. linking here for documentation #3328

@lmccart lmccart closed this Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants