Javascript 如何绘制自定义BufferGeometry对象?
我有以下代码:Javascript 如何绘制自定义BufferGeometry对象?,javascript,three.js,Javascript,Three.js,我有以下代码: geometry = new THREE.BufferGeometry(); geometry.addAttribute( 'position', new THREE.BufferAttribute( position, 3 ) ); geometry.addAttribute( 'color', new THREE.BufferAttribute( color, 4 ) ); geometry.addAttribute('size', new THREE.BufferAt
geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.BufferAttribute( position, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( color, 4 ) );
geometry.addAttribute('size', new THREE.BufferAttribute(size, 1));
var shape = THREE.ImageUtils.loadTexture('star.png');
var material = new THREE.PointCloudMaterial( {size: 55, map: shape , transparent: true} );
particleSystem = new THREE.PointCloud( geometry, material );
scene.add( particleSystem );
我有一个没有正方形边界的纯恒星的图像。
但画完之后,我看到一个正方形,里面插着一颗星星。
我没有足够的评分发布图片。
-这是一个结果。
-这是一个原始的明星与突出。
原始恒星没有任何边界,它是白色的,所以我高亮显示它使它可见
问题:如何绘制没有正方形的星形?尝试添加材质。alphaTest=0.5;。这能解决你的问题吗?@WestLangley,是的。太棒了,非常感谢!