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)

 

 
posted @ 2018-03-28 10:12  善未易明  阅读(10965)  评论(1编辑  收藏  举报