We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I was learning about using PShapes for a project I'm working on and I found a strange issue. I was looking at the PShape examples specifically this one with a triangle strip:
PShape s;
void setup() {
size(100, 100, P2D);
s = createShape();
s.beginShape(TRIANGLE_STRIP);
s.vertex(30, 75);
s.vertex(40, 20);
s.vertex(50, 75);
s.vertex(60, 20);
s.vertex(70, 75);
s.vertex(80, 20);
s.vertex(90, 75);
s.endShape();
}
void draw() {
shape(s, 0, 0);
}
It seems fairly straightforward so I implemented some similar code into my program. The triangle strip shape I made did not behave properly as the lines did not connect to the vertices correctly. I puzzled over this for a half hour as I was doing nearly the exact same thing as the above example. I realized the only difference was my rendering mode was default while the example's was P2D. This difference is obvious if you run the above code with and without the P2D specification.
Why is this the case? Is this an intentional difference between the renders? It seems totally bizarre.
Answers
Interesting. I see what you mean; running the sketch above with
size(100, 100, P2D)
and withsize(100, 100)
creates two different renders:My guess is that if nobody else has suggestions you should report this as a bug here.
Ok, thanks, I'll do that! Also, I tested it with other PShape styles like QUAD, QUAD_STRIP, and such and there is the same inconsistency with all of them.
This was reported as issue 4678.