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

Fix vertex ordering for beginShape(QUADS) in WebGL mode #5771

Merged
merged 1 commit into from
Aug 28, 2022

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

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