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

Fill function is not working for certain orientations in WEBGL #4789

Closed
2 of 13 tasks
isaacvr opened this issue Sep 1, 2020 · 6 comments
Closed
2 of 13 tasks

Fill function is not working for certain orientations in WEBGL #4789

isaacvr opened this issue Sep 1, 2020 · 6 comments
Assignees

Comments

@isaacvr
Copy link

isaacvr commented Sep 1, 2020

When I combine lines and curves, there are certain orientations where the fill function doesn't work properly. In the example below, I draw that shape (that is one of the stickers of the Ivy cube) horizontally and it doesn't fill the shape, but vertically it does. What is happening here?

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Color
  • Core/Environment/Rendering
  • Data
  • Dom
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

  • p5.js version: 1.1.9
  • Web browser and version: Firefox 80.0 and Chrome 84.0.4147.135
  • Operating System: Windows 10
  • Steps to reproduce this:
function setup() {
  createCanvas(500, 500, WEBGL);
}

function draw() {
  background(255);

  translate(width / 2, height / 2);
  rotateX(PI / 6);

  stroke(0, 0, 0);
  strokeWeight(2);
  fill(255, 0, 0);

  beginShape();
  vertex(100, 0, 0);
  vertex(0, 0, 0);
  vertex(0, 0, 100);
  quadraticVertex(0, 0, 0, 100, 0, 0);
  endShape(CLOSE);
}

If we change the last vertex to (0, 100, 0), it works.

@isaacvr isaacvr added the Bug label Sep 1, 2020
@welcome
Copy link

welcome bot commented Sep 1, 2020

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@blechdavier
Copy link

blechdavier commented Oct 27, 2020

What do you mean by changing the last vertex to (0, 100, 0)? Like the last vertex(), or something in the quadraticVertex(), or...

@blechdavier
Copy link

Ohhhh... You just have to comment out the translate() on line 8, and change the quadraticVertex() on line 19 to quadraticVertex(0, 100, 0, 100, 0, 0);

@vulongphan
Copy link
Contributor

I would like to work on this issue

@Qianqianye
Copy link
Contributor

Thanks @vulongphan I just assigned you.

@davepagurek
Copy link
Contributor

Hi! This should be fixed as of #5914, so I'm going to close this for organizational purposes. This is not yet released, but once the next p5 version is out (greater than 1.5.0), feel free to open this again if you notice any further issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants