Skip to content

Commit

Permalink
Fixed issue with relative texture paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Cormack committed Jan 29, 2017
1 parent 9c8b72a commit a7cafb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/js/loaders/BOMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ THREE.BOMLoader.prototype = {
// Absolute URL
if ( /^https?:\/\//i.test( url ) ) return url;

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

}

Expand Down
2 changes: 1 addition & 1 deletion examples/js/loaders/BOMLoader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7cafb4

Please # to comment.