Przeglądaj źródła

Merge pull request #10921 from gero3/AddExtrudeMaterial

Add extrude material
Mr.doob 8 lat temu
rodzic
commit
73cfa0f680
1 zmienionych plików z 6 dodań i 2 usunięć
  1. 6 2
      src/geometries/ExtrudeGeometry.js

+ 6 - 2
src/geometries/ExtrudeGeometry.js

@@ -618,7 +618,7 @@ ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) {
 
 		}
 		
-		scope.addGroup( start, verticesArray.length/3 -start, 0);
+		scope.addGroup( start, verticesArray.length/3 -start, options.material !== undefined ? options.material : 0);
 
 	}
 
@@ -641,7 +641,11 @@ ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) {
 
 		}
 		
-		scope.addGroup( start, verticesArray.length/3 -start, 1);
+		if (options.extrudeMaterial !== undefined){
+			
+			scope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);
+			
+		}
 
 	}