Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I turn on wide-line endpoint capping or mitering?

capping endpoint turn
0
Posted

How do I turn on wide-line endpoint capping or mitering?

0

OpenGL draws wide lines by rendering multiple width-1 component lines adjacent to each other. If the wide line is Y major, the component lines are offset in X; if the wide line is X major, the component lines are offset in Y. This can produce ugly gaps at the junction of line segments and differences in apparent width depending on the line segment’s slope. OpenGL doesn’t provide a mechanism to cleanly join lines that share common vertices nor to cleanly cap the endpoints. One possible solution is to render smooth (antialiased) lines instead of normal aliased lines. To produce a clean junction, you need to draw lines with depth test disabled or the depth function set to GL_ALWAYS. See the question on rendering antialiased lines for more info. Another solution is for the application to handle the capping and mitering. Instead of rendering lines, the application needs to render face-on polygons. The application will need to perform the necessary math to calculate the vertex locations to p

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.