Prechádzať zdrojové kódy

fix texture path bug

Lewy Blue 6 rokov pred
rodič
commit
7b53ebb2f0
1 zmenil súbory, kde vykonal 5 pridanie a 4 odobranie
  1. 5 4
      examples/js/loaders/LWOLoader.js

+ 5 - 4
examples/js/loaders/LWOLoader.js

@@ -650,12 +650,13 @@ THREE.LWOLoader = ( function () {
 
 		},
 
-		// if texture files are contained in the standard "../Images"
-		// directory, then LW stores the path as relative.
-		// Otherwise it stores the full drive path, on windows "C:/dir/subdir/texture.jpg"
+		// Lightwave expects textures to be in folder called Images relative
+		// to the model
+		// Otherwise, the full absolute path is stored: D://some_directory/textures/bumpMap.png
+		// In this case, we'll strip out everything and load 'bumpMap.png' from the same directory as the model
 		cleanPath( path ) {
 
-			if ( path.indexOf( 'Images' ) === 0 ) return '../' + path;
+			if ( path.indexOf( 'Images' ) === 0 ) return './' + path;
 			return path.split( '/' ).pop().split( '\\' ).pop();
 
 		},