Przeglądaj źródła

Merge pull request #13409 from fernandojsg/fixobj2

Fix OBJExporter without normals
Mr.doob 7 lat temu
rodzic
commit
21e0dfa0f3
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      examples/js/exporters/OBJExporter.js

+ 2 - 2
examples/js/exporters/OBJExporter.js

@@ -124,7 +124,7 @@ THREE.OBJExporter.prototype = {
 
 							j = indices.getX( i + m ) + 1;
 
-							face[ m ] = ( indexVertex + j ) + '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + '/' + ( indexNormals + j );
+							face[ m ] = ( indexVertex + j ) + ( normals || uvs ? '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + ( normals ? '/' + ( indexNormals + j ) : '' ) : '' );
 
 						}
 
@@ -141,7 +141,7 @@ THREE.OBJExporter.prototype = {
 
 							j = i + m + 1;
 
-							face[ m ] = ( indexVertex + j ) + '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + '/' + ( indexNormals + j );
+							face[ m ] = ( indexVertex + j ) + ( normals || uvs ? '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + ( normals ? '/' + ( indexNormals + j ) : '' ) : '' );
 
 						}