File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -10,24 +10,16 @@ THREE.ImageUtils = {
10
10
11
11
loadTexture : function ( url , mapping , onLoad , onError ) {
12
12
13
- var loader = new THREE . ImageLoader ( ) ;
14
- loader . crossOrigin = this . crossOrigin ;
15
-
16
- var texture = new THREE . Texture ( undefined , mapping ) ;
13
+ var loader = new THREE . TextureLoader ( ) ;
14
+ loader . setCrossOrigin ( this . crossOrigin ) ;
17
15
18
- loader . load ( url , function ( image ) {
19
-
20
- texture . image = image ;
21
- texture . needsUpdate = true ;
16
+ var texture = loader . load ( url , function ( texture ) {
22
17
23
18
if ( onLoad ) onLoad ( texture ) ;
24
19
25
- } , undefined , function ( event ) {
26
-
27
- if ( onError ) onError ( event ) ;
28
-
29
- } ) ;
20
+ } , undefined , onError ) ;
30
21
22
+ texture . mapping = mapping ;
31
23
texture . sourceFile = url ;
32
24
33
25
return texture ;
You can’t perform that action at this time.
0 commit comments