所以我使用的是THREE.BufferGeometry
,我可以通过color
属性很好地控制Line的各个段的颜色。
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
绑定,这样我就可以更改该行各个段的厚度了吗?
答案 0 :(得分:0)
您可以创建着色器来构建线条并控制每个线段的厚度。查看本文https://processing.org/tutorials/pshader/(第10章。点和线着色器)