今天在做Threejs绘制线条时,绘制了一个圆,但是由于线条太细,为了给线条加粗,在LineBasicMaterial中添加了linewidth属性,但是发现并没有效果,代码如下:
const curve = new THREE.EllipseCurve(
0, 0, // 椭圆中心x,y坐标
5, 5, // 椭圆长半轴和短半轴
0, 2 * Math.PI // 起始角度和结束角度,设置为0到2π使曲线闭合
);
const points = curve.getPoints(50); // 获取50个点
const geometry = new THREE.BufferGeometry().setFromPoints(points);
const material = new THREE.LineBasicMaterial({
color: '#FF0000',
linewidth: 8,
});
const line = new THREE.Line(geometry, material);
this.scene.add(line);
但是查找了官方文档后确实是有这个属性的。但是紧接着下一行,由于OpenGL Core Profil