this._geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( tup[0], 3 ) )
this._geometry.setAttribute( 'color', new THREE.Float32BufferAttribute( tup[1], 4 )
this._geometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( tup[2], 3 ) )
var material1 = new THREE.RawShaderMaterial( {
uniforms: {
lightPos: { value: this._camera.Camera.position },
lightColor:{value: new THREE.Vector3(1.0, 1.0, 1.0)}
},
vertexShader: modelVertexShader,
fragmentShader: modelFragmentShader,
side:THREE.DoubleSide,
} )
var mesh = new THREE.Points(this._geometry,material1)
this._scene.add(mesh)
Above code:All points can be seen
If index is used,Like this:this._geometry.setIndex( tup[3] ):There’s no point
Another way:this._geometry.index = new THREE.BufferAttribute(tup[3], 1,):Only part of the point can be seen
Why not render all the points?tup[3] is the index of all points. I’ve confirmed it.Its type is uint16array.Do I use it incorrectly?