1

所以我使用 a并且我能够通过属性THREE.BufferGeometry很好地控制 Line 的各个部分的颜色。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以便更改线条的各个部分的粗细?

4

1 回答 1

0

您可以创建一个着色器来构建线条并控制每个段的粗细。查看这篇文章https://processing.org/tutorials/pshader/(第 10 章。点和线着色器)

于 2015-09-15T09:48:29.797 回答