Skip to content

Commit a7cafb4

Browse files
author
David Cormack
committed
Fixed issue with relative texture paths.
1 parent 9c8b72a commit a7cafb4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/js/loaders/BOMLoader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ THREE.BOMLoader.prototype = {
239239
// Absolute URL
240240
if ( /^https?:\/\//i.test( url ) ) return url;
241241

242-
return ( scope.texturePath || scope.path || '' ) + url;
242+
var absoluteUrl = new URL(( scope.texturePath || scope.path || '' ) + url, location.href.substring( 0, location.href.lastIndexOf( '/' ) + 1 ));
243+
return absoluteUrl.toString();
243244

244245
}
245246

examples/js/loaders/BOMLoader.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)