threejs 通过bufferGeometry处理每一个点的位置和颜色


let positions = new Float32Array(points.length * 3);
let colors = new Float32Array(points.length * 3);
*/
处理positions和colors
/*
let bufferGeometry=new THREE.BufferGeometry()
bufferGeometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); bufferGeometry.addAttribute('color', new THREE.BufferAttribute(colors, 3));
bufferGeometry.computeBoundingBox();
let material = new THREE.PointsMaterial({
  size: 2,
  vertexColors: THREE.VertexColors,
  transparent: true,
  opacity: 1,
  sizeAttenuation: false
});
let mesh=new THREE.Points(bufferGeometry,material)

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM