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