netjsongraph.js icon indicating copy to clipboard operation
netjsongraph.js copied to clipboard

Using triangles to replace line.

Open geekplux opened this issue 6 years ago • 1 comments

gl.lineWidth() has no effect in common modern browsers. The corresponding Chromium bug and Firefox bug are closed as Won't Fix and the WebGL specification now defines that gl.lineWidth() does not change the line width anymore. If you need lines of any width other than 1px, consider drawing a narrow strip of triangles.

so, we have to simulating the line width by creating triangles.

geekplux avatar Aug 13 '17 09:08 geekplux

reference:

  • https://blog.artzub.com/webgl-width-of-line-into-the-windows-browsers-f199d7252fc
  • https://mattdesl.svbtle.com/drawing-lines-is-hard
  • https://stackoverflow.com/questions/28009734/webgl-line-strip-width/28046235#28046235
  • https://github.com/Jam3/three-path-geometry

geekplux avatar Aug 16 '17 14:08 geekplux