visionforge
visionforge copied to clipboard
Update 3d line width on appropriate parameter change
It looks like the lines are always displayed as width 1 - "Due to limitations of the OpenGL Core Profile with the WebGL renderer on most platforms linewidth will always be 1 regardless of the set value." (https://threejs.org/docs/#api/en/materials/LineBasicMaterial.linewidth).
So shall we draw cylinders instead of lines?
There are several existing solutions like this one: https://github.com/spite/THREE.MeshLine/blob/master/README.md. The problem with cylinder is that unlike the line it will scale when moving camera, and it is not the behavior we want.
Implemented separate ThreeMeshLineFactory and ThreeSmartLineFactory. The later chooses which implementation to use depending on the line thickness.