Problem with lines/curves in P3D

Hi,
I started using processing a few days ago and encountered a problem. In order to use Spout, I had to change renderer to P3D, but P3D lines/curves work a bit differently than in default renderer. There happens a bug in bend points. There seems to be no round strokeCap, I guess? Is there a way to prevent it and draw round line?

I’ve made a simple sketch showing the problem:

float x1, x2, x3;
float y1, y2;
float x = 0.0;
float amplitude = 200.0;

void setup(){
  size(500, 400, P3D); 
  textureMode(NORMAL);
  x2 = width/2;
  y1 = height/2 + 100;
  y2 = height/2 - 100;
}

void draw(){
  background(0);
  drawCurves(150, 30);
  drawCurves(255, 10);
  x += 0.01;
}

void drawCurves(float col, int size){
  x1 = x2 + sin(x)*amplitude;
  x3 = x2 - sin(x)*amplitude;
  stroke(col);
  strokeWeight(size);
  strokeCap(ROUND);
  noFill();
  beginShape();
  curveVertex(x1, y1);
  curveVertex(x1, y1);
  
  curveVertex(x2, y2);
  
  curveVertex(x3, y1);
  curveVertex(x3, y1);
  
  endShape();
}

Bug:

Hi @arTwirr,

That is what processing 3 code says …
Don’t know why the doc generator not includes the info.

Cheers
— mnse

The P3D renderer doesn’t support strokeCap()
or strokeJoin(), which can lead to ugly results
when using strokeWeight()

1 Like

Hello,

Related topic:
https://discourse.processing.org/t/strokecap-in-p3d-not-working/23633

@mnse,

Please post a link to the source of this. Thanks.

:)

Hi @glv,

Permalink: Commented on PApplet.size description

Few lines below is also an issue link but it isn’t accessable anymore…

Cheers
— mnse

PS:
Now also found the related discussion on github issues:

Most interresting part imo is this comment

Have you tried P2D instead?

Yes, the same result