2
0
Эх сурвалжийг харах

Merge pull request #13400 from fernandojsg/fixobj

Fix OBJ loader with empty uvs or normals
Mr.doob 7 жил өмнө
parent
commit
a97575ebfd

+ 2 - 4
examples/js/loaders/OBJLoader.js

@@ -286,19 +286,17 @@ THREE.OBJLoader = ( function () {
 
 
 				this.addVertex( ia, ib, ic );
 				this.addVertex( ia, ib, ic );
 
 
-				if ( ua !== undefined ) {
+				if ( ua !== undefined && ua !== '' ) {
 
 
 					var uvLen = this.uvs.length;
 					var uvLen = this.uvs.length;
-
 					ia = this.parseUVIndex( ua, uvLen );
 					ia = this.parseUVIndex( ua, uvLen );
 					ib = this.parseUVIndex( ub, uvLen );
 					ib = this.parseUVIndex( ub, uvLen );
 					ic = this.parseUVIndex( uc, uvLen );
 					ic = this.parseUVIndex( uc, uvLen );
-
 					this.addUV( ia, ib, ic );
 					this.addUV( ia, ib, ic );
 
 
 				}
 				}
 
 
-				if ( na !== undefined ) {
+				if ( na !== undefined && na !== '' ) {
 
 
 					// Normals are many times the same. If so, skip function call and parseInt.
 					// Normals are many times the same. If so, skip function call and parseInt.
 					var nLen = this.normals.length;
 					var nLen = this.normals.length;