using multiple arcs but the result looks

So I'm trying to basically draw an ellipse with gaps in between the arcs, but the results I'm getting look very ugly. Is this a bug or am I doing something wrong? I get these results in p5 but in processing as well, especially the smaller it is, the uglier. I thought smooth() would fix it, but it sometimes makes it worse.

these are some of the results:

Screen Shot 2016-06-06 at 01.04.33 Screen Shot 2016-06-06 at 01.04.52

code:

void setup() {
  size(600,600);
}

void draw() {
  noFill();
  translate(width/2, height/2);
  drawEyeArcs(0,0, 50, 12);
}

void drawEyeArcs(int x, int y, int size, int segments) {

    // we draw double the segments, because we want to skip each odd one
    segments *= 2;

    for (int i = 0; i < segments; i++) {
        if (i % 2 == 1) {
            float start = TWO_PI / segments * i;
            float end = TWO_PI / segments * (i + 1);
            arc(0, 0, size, size, start, end);
        }
    }
}
Tagged:

Answers

  • edited June 2016

    Just guessing, but if you make size a float not an integer, does that help?

  • edited June 2016

    No it doesn't. Maybe it's just the lack of resolution at small circle sizes? It looks fine when the circle is big.

  • Does smooth() help? What about noLoop()?

  • @koogs smooth seems to make it worse. noLoop looks a lot better (although still jaggy) but I need to loop :D

    @fuzzySi yea I noticed that big circles are fine. But I can't be the first to notice this, right? I wonder if there's a fix :)

  • Answer ✓

    Why do you have0,0 as center? Do you use pishMatrix()? Or translate()?

    Canyou post the entire code?

    Does it look better with a bigger radius?

    You need background at start of draw()

  • Answer ✓

    smooth seems to make it worse. noLoop looks a lot better

    see, my thinking is that this is due to the buildup of semi-transparent pixels. i think smooth might be on by default. noLoop() means that draw() only runs once, so there is no chance of the buildup occurring, but is only useful if there's no animation or interaction.

    the buildup also won't happen if you call background() at the start of every draw() (as chrisir correctly points out)

    there's a FAQ for this very thing:
    https://forum.processing.org/two/discussion/8075/why-are-text-and-graphics-so-ugly-and-blocky

  • ahhhh of course! That makes total sense. As a noob I thought the anti-aliased pixels would be a full color, not transparent. Thanks!

Sign In or Register to comment.