소스 검색

Merge pull request #10921 from gero3/AddExtrudeMaterial

Add extrude material
Mr.doob 8 년 전
부모
커밋
73cfa0f680
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  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);
+			
+		}
 
 	}