Skip to content

Conversation

@davepagurek
Copy link
Contributor

Resolves #5770

In my last PR adding QUADS support, I misread the example code in the p5 reference and thought that the vertex ordering for QUADS and QUAD_STRIP were the same, but they are actually supposed to be different. This fixes it and makes QUADS consistent with 2D mode.

Changes:

  • Updated the code for adding a QUADS vertex() to use a CCW vertex ordering, consistent with 2D mode
  • Updated manual and unit tests to also use that ordering

Screenshots of the change:
Using the example code for QUADS from the p5 reference, but in WebGL mode:

beginShape(QUADS);
vertex(30, 20);
vertex(30, 75);
vertex(50, 75);
vertex(50, 20);
vertex(65, 20);
vertex(65, 75);
vertex(85, 75);
vertex(85, 20);
endShape();
Before: After:
image image

PR Checklist

  • npm run lint passes
  • [Unit tests] are included / updated

@davepagurek davepagurek requested a review from stalgiag August 28, 2022 13:07
Copy link
Contributor

@stalgiag stalgiag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@davepagurek
Copy link
Contributor Author

Thanks for reviewing this so quickly! Have a great rest of your weekend 🙂

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.

Vertex ordering for beginShape(QUADS) is different in WebGL from 2D mode

2 participants