因此,我使用了 THREE.BufferGeometry
,并且我能够通过 color
属性很好地控制线条各个段的颜色。
geometry = new THREE.BufferGeometry();
var material = new THREE.LineBasicMaterial({
vertexColors: THREE.VertexColors
});
geometry.addAttribute('position', new THREE.BufferAttribute(points, 3));
geometry.addAttribute('color', new THREE.BufferAttribute(colors, 3));
scene.add(new THREE.Line(geometry, material, THREE.LinePieces));
有什么方法可以添加自定义属性并将其与 LineBasicMaterial.linewidth 绑定(bind),以便我可以更改线条各个段的粗细?
最佳答案
您可以创建一个着色器来构建线条并控制每个线段的粗细。查看这篇文章https://processing.org/tutorials/pshader/ (第 10 章。点和线着色器)
关于javascript - BufferGeometry 和 LineBasicMaterial : segments thickness,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32544413/