Garrett Johnson 6 роки тому
батько
коміт
ae9bc8ced6
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      examples/webgl_physics_volume.html

+ 4 - 0
examples/webgl_physics_volume.html

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