Just for a background, I’m currently using P3D for 2D animations instead of the default, P2D, and FX2D because of performance issues that I get with the customization of strokes. I assume this probably has something to do with AMD graphics drivers and the fact that I have a relatively old laptop so I had no choice.
The downside that I got however is that I can only have a square strokeCap in P3D. The following is a sample demonstrating the strokeCaps:
void setup() {
...
strokeWeight(10);
stroke(255);
}
void draw() {
background(0);
strokeCap(PROJECT); line(50, 50, 200, 50);
strokeCap(SQUARE); line(50, 100, 200, 100);
strokeCap(ROUND); line(50, 150, 200, 150);
}
Is this behaviour by default or is this a bug? The documentation however doesn’t mention anything that strokeCaps don’t work in P3D
Further researching in google led me to discussions from the previous processing forum where it explains about this issue but I honestly do not understand the conclusion from these:
- Trying to drawn lines with round ends [using strokeCap(ROUND)] in P3D mode, but they stay square
- strokeCap(ROUND) failure
- Lines in P3D only in rectangular mode
Apparently, the discussions are also relatively old so I’m not sure if this has been fixed already.