小编Dai*_*isy的帖子

如何在使用 Three.js、使用 LineBasicMaterial 绘制线条时设置不透明度?

我想改变线条的宽度和不透明度,我的代码如下:

 var geometry_link = new THREE.Geometry();
 geometry_link.vertices.push(
 new THREE.Vector3(item[0].x *1,item[0].y *1,item[0].z),
 new THREE.Vector3(item[1].x *1,item[1].y *1,item[1].z)
 );
 geometry_link.colors.push(
 new THREE.Color(0x000000),
 new THREE.Color(0xffffff)
 );
 var line = new THREE.Line(geometry_link, new THREE.LineBasicMaterial({
     vertexColors: true,
     linewidth: 8,
     transparent: true,
     opacity: 0.1
})
Run Code Online (Sandbox Code Playgroud)

但它不起作用,无论是线宽还是不透明度。我发现了类似的问题,说linewidth在windows上不起作用,那是5年前的事了,现在怎么样?谢谢你的想法

three.js

5
推荐指数
1
解决办法
2153
查看次数

标签 统计

three.js ×1