|
@@ -191,11 +191,15 @@
|
|
|
|
|
|
function processGeometry( bufGeometry ) {
|
|
|
|
|
|
+ // Ony consider the position values when merging the vertices
|
|
|
var posOnlyBufGeometry = new THREE.BufferGeometry();
|
|
|
posOnlyBufGeometry.addAttribute( 'position', bufGeometry.getAttribute( 'position' ) );
|
|
|
posOnlyBufGeometry.setIndex( bufGeometry.getIndex() );
|
|
|
|
|
|
+ // Merge the vertices so the triangle soup is converted to indexed triangles
|
|
|
var indexedBufferGeom = THREE.BufferGeometryUtils.mergeVertices( posOnlyBufGeometry );
|
|
|
+
|
|
|
+ // Create index arrays mapping the indexed vertices to bufGeometry vertices
|
|
|
mapIndices( bufGeometry, indexedBufferGeom );
|
|
|
|
|
|
}
|