a = new THREE.PlaneBufferGeometry( 1, 1, 2 )
b = new THREE.PlaneBufferGeometry( 1, 1, 2 )
console.log( a.attributes.position.array.length )
a.merge( b )
console.log( a.attributes.position.array.length )
Output:
18
18 (should be 36)
r79
Author: Fantashit
1 thought on “BufferGeometry.prototype.merge not working”
Yes. The method does not support indexed buffer geometries. Also buffer geometries can’t be resized. Have a look at the source code so you understand what the method’s limitations are.
Quite frankly, I can see a compelling argument for removing the method altogether — or perhaps substituting a utility like:
THREE.BufferGeometryUtils.mergeGeometries( ... )
which would merge multiple geometries at once, rather than incrementally. But even that method would have significant limitations.
Yes. The method does not support indexed buffer geometries. Also buffer geometries can’t be resized. Have a look at the source code so you understand what the method’s limitations are.
Quite frankly, I can see a compelling argument for removing the method altogether — or perhaps substituting a utility like:
which would merge multiple geometries at once, rather than incrementally. But even that method would have significant limitations.