speckle-server
speckle-server copied to clipboard
Viewer: Emulate lines with triangles
In order to be able to unniversally control lineWidth
(lineweight) in th viewer we will need to drop drawing them using the GL_LINES primitive since the line width is not unniversally configurable on all platforms. See here for more information.
Hopefully there should be some libraries out there that would offer good implementations for this. Even if the general idea behind emulating lines with triangles is easy, getting all the edge cases to work corretly and generate good looking correct lines is difficult.
List of libraries/helpers
- https://github.com/spite/THREE.MeshLine
- https://github.com/mrdoob/three.js/blob/master/examples/webgl_lines_fat.html