Procházet zdrojové kódy

replace ImageUtils with TextureLoader in VRMLLoader

does not work in r72, but allows to delay manager's onLoad after textures were loaded
makc před 9 roky
rodič
revize
86ef89a3ec
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      examples/js/loaders/VRMLLoader.js

+ 4 - 3
examples/js/loaders/VRMLLoader.js

@@ -44,14 +44,15 @@ THREE.VRMLLoader.prototype = {
 
 
 		this.crossOrigin = value;
 		this.crossOrigin = value;
 
 
-		THREE.ImageUtils.crossOrigin = value;
-
 	},
 	},
 
 
 	parse: function ( data ) {
 	parse: function ( data ) {
 
 
 		var texturePath = this.texturePath || '';
 		var texturePath = this.texturePath || '';
 
 
+		var textureLoader = new THREE.TextureLoader( this.manager );
+		textureLoader.setCrossOrigin( this.crossOrigin );
+
 		var parseV1 = function ( lines, scene ) {
 		var parseV1 = function ( lines, scene ) {
 
 
 			console.warn( 'VRML V1.0 not supported yet' );
 			console.warn( 'VRML V1.0 not supported yet' );
@@ -929,7 +930,7 @@ THREE.VRMLLoader.prototype = {
 
 
 								parent.material.name = textureName[ 1 ];
 								parent.material.name = textureName[ 1 ];
 
 
-								parent.material.map = THREE.ImageUtils.loadTexture (texturePath + textureName[ 1 ]);
+								parent.material.map = textureLoader.load( texturePath + textureName[ 1 ] );
 
 
 							}
 							}