Closed Glusk closed 5 years ago
libGDX
renders lines using OpenGL
.
One of the sad things about using the OpenGL rendering option in Processing is the lack of control over line weights, caps and joins.
http://www.tom-carden.co.uk/2008/02/09/new-processing-hack-line-caps-and-joins-in-opengl
Unfortunately, drawing lines is a weak point of OpenGL. The GL_LINES drawing mode is limited: it does not support line joins, line caps, non-integer line widths, widths greater than 10px, or varying widths in a single pass.
https://blog.mapbox.com/drawing-antialiased-lines-with-opengl-8766f34192dc
Maybe the simple solution is still good enough: Draw a circle centered at the common vertex with radius half the line width.
libGDX
provides no line joining utilities/settings.http://www.bluevoid.com/opengl/sig00/advanced00/notes/node290.html
The following SO answer shows how to compute Milter join points (in general terms, although the question was about
libGDX
in specific).An easy round join solution:
http://artgrammer.blogspot.com/search/label/opengl
If drawing a curve, a texture can be applied to triangle strips. Example:
https://badlogicgames.com/forum/viewtopic.php?f=11&t=18940(The forum was shut down).