소스 검색

OBJLoader: Fix color attribute.

Mugen87 5 년 전
부모
커밋
9b9b6877d3
2개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 6 6
      examples/js/loaders/OBJLoader.js
  2. 6 6
      examples/jsm/loaders/OBJLoader.js

+ 6 - 6
examples/js/loaders/OBJLoader.js

@@ -286,6 +286,12 @@ THREE.OBJLoader = ( function () {
 
 				this.addVertex( ia, ib, ic );
 
+				if ( this.colors.length > 0 ) {
+
+					this.addColor( ia, ib, ic );
+
+				}
+
 				if ( ua !== undefined && ua !== '' ) {
 
 					var uvLen = this.uvs.length;
@@ -309,12 +315,6 @@ THREE.OBJLoader = ( function () {
 
 				}
 
-				if ( this.colors.length > 0 ) {
-
-					this.addColor( ia, ib, ic );
-
-				}
-
 			},
 
 			addPointGeometry: function ( vertices ) {

+ 6 - 6
examples/jsm/loaders/OBJLoader.js

@@ -303,6 +303,12 @@ var OBJLoader = ( function () {
 
 				this.addVertex( ia, ib, ic );
 
+				if ( this.colors.length > 0 ) {
+
+					this.addColor( ia, ib, ic );
+
+				}
+
 				if ( ua !== undefined && ua !== '' ) {
 
 					var uvLen = this.uvs.length;
@@ -326,12 +332,6 @@ var OBJLoader = ( function () {
 
 				}
 
-				if ( this.colors.length > 0 ) {
-
-					this.addColor( ia, ib, ic );
-
-				}
-
 			},
 
 			addPointGeometry: function ( vertices ) {