Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
a1c6a3d2
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1c6a3d2
编写于
5月 12, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
9c7f2ee1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
85 addition
and
40 deletion
+85
-40
build/three.js
build/three.js
+78
-33
build/three.min.js
build/three.min.js
+7
-7
未找到文件。
build/three.js
浏览文件 @
a1c6a3d2
...
@@ -11128,21 +11128,58 @@ THREE.Loader.prototype = {
...
@@ -11128,21 +11128,58 @@ THREE.Loader.prototype = {
var fullPath = texturePath + sourceFile;
var fullPath = texturePath + sourceFile;
where[ name ] = new THREE.Texture( document.createElement( 'canvas' ) );
var texture;
where[ name ].sourceFile = sourceFile;
var loader = THREE.Loader.Handlers.get( fullPath );
if ( loader !== null ) {
texture = loader.load( fullPath );
} else {
texture = new THREE.Texture( document.createElement( 'canvas' ) );
loader = scope.imageLoader;
loader.crossOrigin = scope.crossOrigin;
loader.load( fullPath, function ( image ) {
if ( THREE.Math.isPowerOfTwo( image.width ) === false ||
THREE.Math.isPowerOfTwo( image.height ) === false ) {
var width = nearest_pow2( image.width );
var height = nearest_pow2( image.height );
texture.image.width = width;
texture.image.height = height;
texture.image.getContext( '2d' ).drawImage( image, 0, 0, width, height );
} else {
texture.image = image;
}
texture.needsUpdate = true;
} );
}
texture.sourceFile = sourceFile;
if ( repeat ) {
if ( repeat ) {
where[ name ]
.repeat.set( repeat[ 0 ], repeat[ 1 ] );
texture
.repeat.set( repeat[ 0 ], repeat[ 1 ] );
if ( repeat[ 0 ] !== 1 )
where[ name ]
.wrapS = THREE.RepeatWrapping;
if ( repeat[ 0 ] !== 1 )
texture
.wrapS = THREE.RepeatWrapping;
if ( repeat[ 1 ] !== 1 )
where[ name ]
.wrapT = THREE.RepeatWrapping;
if ( repeat[ 1 ] !== 1 )
texture
.wrapT = THREE.RepeatWrapping;
}
}
if ( offset ) {
if ( offset ) {
where[ name ]
.offset.set( offset[ 0 ], offset[ 1 ] );
texture
.offset.set( offset[ 0 ], offset[ 1 ] );
}
}
...
@@ -11153,41 +11190,18 @@ THREE.Loader.prototype = {
...
@@ -11153,41 +11190,18 @@ THREE.Loader.prototype = {
"mirror": THREE.MirroredRepeatWrapping
"mirror": THREE.MirroredRepeatWrapping
}
}
if ( wrapMap[ wrap[ 0 ] ] !== undefined )
where[ name ]
.wrapS = wrapMap[ wrap[ 0 ] ];
if ( wrapMap[ wrap[ 0 ] ] !== undefined )
texture
.wrapS = wrapMap[ wrap[ 0 ] ];
if ( wrapMap[ wrap[ 1 ] ] !== undefined )
where[ name ]
.wrapT = wrapMap[ wrap[ 1 ] ];
if ( wrapMap[ wrap[ 1 ] ] !== undefined )
texture
.wrapT = wrapMap[ wrap[ 1 ] ];
}
}
if ( anisotropy ) {
if ( anisotropy ) {
where[ name ]
.anisotropy = anisotropy;
texture
.anisotropy = anisotropy;
}
}
var texture = where[ name ];
where[ name ] = texture;
scope.imageLoader.crossOrigin = scope.crossOrigin;
scope.imageLoader.load( fullPath, function ( image ) {
if ( THREE.Math.isPowerOfTwo( image.width ) === false ||
THREE.Math.isPowerOfTwo( image.height ) === false ) {
var width = nearest_pow2( image.width );
var height = nearest_pow2( image.height );
texture.image.width = width;
texture.image.height = height;
texture.image.getContext( '2d' ).drawImage( image, 0, 0, width, height );
} else {
texture.image = image;
}
texture.needsUpdate = true;
} );
}
}
...
@@ -11431,6 +11445,37 @@ THREE.Loader.prototype = {
...
@@ -11431,6 +11445,37 @@ THREE.Loader.prototype = {
}
}
};
};
THREE.Loader.Handlers = {
handlers: [],
add: function ( regex, loader ) {
this.handlers.push( regex, loader );
},
get: function ( file ) {
for ( var i = 0, l = this.handlers.length; i < l; i += 2 ) {
var regex = this.handlers[ i ];
var loader = this.handlers[ i + 1 ];
if ( regex.test( file ) ) {
return loader;
}
}
return null;
}
};
/**
/**
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
...
...
build/three.min.js
浏览文件 @
a1c6a3d2
...
@@ -226,13 +226,13 @@ THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light
...
@@ -226,13 +226,13 @@ THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light
this
.
shadowDarkness
;
a
.
shadowMapWidth
=
this
.
shadowMapWidth
;
a
.
shadowMapHeight
=
this
.
shadowMapHeight
;
return
a
};
THREE
.
Cache
=
function
(){
this
.
files
=
{}};
THREE
.
Cache
.
prototype
=
{
constructor
:
THREE
.
Cache
,
add
:
function
(
a
,
b
){
this
.
files
[
a
]
=
b
},
get
:
function
(
a
){
return
this
.
files
[
a
]},
remove
:
function
(
a
){
delete
this
.
files
[
a
]},
clear
:
function
(){
this
.
files
=
{}}};
THREE
.
Loader
=
function
(
a
){
this
.
statusDomElement
=
(
this
.
showStatus
=
a
)?
THREE
.
Loader
.
prototype
.
addStatusElement
():
null
;
this
.
imageLoader
=
new
THREE
.
ImageLoader
;
this
.
onLoadStart
=
function
(){};
this
.
onLoadProgress
=
function
(){};
this
.
onLoadComplete
=
function
(){}};
this
.
shadowDarkness
;
a
.
shadowMapWidth
=
this
.
shadowMapWidth
;
a
.
shadowMapHeight
=
this
.
shadowMapHeight
;
return
a
};
THREE
.
Cache
=
function
(){
this
.
files
=
{}};
THREE
.
Cache
.
prototype
=
{
constructor
:
THREE
.
Cache
,
add
:
function
(
a
,
b
){
this
.
files
[
a
]
=
b
},
get
:
function
(
a
){
return
this
.
files
[
a
]},
remove
:
function
(
a
){
delete
this
.
files
[
a
]},
clear
:
function
(){
this
.
files
=
{}}};
THREE
.
Loader
=
function
(
a
){
this
.
statusDomElement
=
(
this
.
showStatus
=
a
)?
THREE
.
Loader
.
prototype
.
addStatusElement
():
null
;
this
.
imageLoader
=
new
THREE
.
ImageLoader
;
this
.
onLoadStart
=
function
(){};
this
.
onLoadProgress
=
function
(){};
this
.
onLoadComplete
=
function
(){}};
THREE
.
Loader
.
prototype
=
{
constructor
:
THREE
.
Loader
,
crossOrigin
:
void
0
,
addStatusElement
:
function
(){
var
a
=
document
.
createElement
(
"
div
"
);
a
.
style
.
position
=
"
absolute
"
;
a
.
style
.
right
=
"
0px
"
;
a
.
style
.
top
=
"
0px
"
;
a
.
style
.
fontSize
=
"
0.8em
"
;
a
.
style
.
textAlign
=
"
left
"
;
a
.
style
.
background
=
"
rgba(0,0,0,0.25)
"
;
a
.
style
.
color
=
"
#fff
"
;
a
.
style
.
width
=
"
120px
"
;
a
.
style
.
padding
=
"
0.5em 0.5em 0.5em 0.5em
"
;
a
.
style
.
zIndex
=
1
E3
;
a
.
innerHTML
=
"
Loading ...
"
;
return
a
},
updateProgress
:
function
(
a
){
var
b
=
"
Loaded
"
,
b
=
a
.
total
?
b
+
((
100
*
a
.
loaded
/
a
.
total
).
toFixed
(
0
)
+
THREE
.
Loader
.
prototype
=
{
constructor
:
THREE
.
Loader
,
crossOrigin
:
void
0
,
addStatusElement
:
function
(){
var
a
=
document
.
createElement
(
"
div
"
);
a
.
style
.
position
=
"
absolute
"
;
a
.
style
.
right
=
"
0px
"
;
a
.
style
.
top
=
"
0px
"
;
a
.
style
.
fontSize
=
"
0.8em
"
;
a
.
style
.
textAlign
=
"
left
"
;
a
.
style
.
background
=
"
rgba(0,0,0,0.25)
"
;
a
.
style
.
color
=
"
#fff
"
;
a
.
style
.
width
=
"
120px
"
;
a
.
style
.
padding
=
"
0.5em 0.5em 0.5em 0.5em
"
;
a
.
style
.
zIndex
=
1
E3
;
a
.
innerHTML
=
"
Loading ...
"
;
return
a
},
updateProgress
:
function
(
a
){
var
b
=
"
Loaded
"
,
b
=
a
.
total
?
b
+
((
100
*
a
.
loaded
/
a
.
total
).
toFixed
(
0
)
+
"
%
"
):
b
+
((
a
.
loaded
/
1024
).
toFixed
(
2
)
+
"
KB
"
);
this
.
statusDomElement
.
innerHTML
=
b
},
extractUrlBase
:
function
(
a
){
a
=
a
.
split
(
"
/
"
);
if
(
1
===
a
.
length
)
return
"
./
"
;
a
.
pop
();
return
a
.
join
(
"
/
"
)
+
"
/
"
},
initMaterials
:
function
(
a
,
b
){
for
(
var
c
=
[],
d
=
0
;
d
<
a
.
length
;
++
d
)
c
[
d
]
=
this
.
createMaterial
(
a
[
d
],
b
);
return
c
},
needsTangents
:
function
(
a
){
for
(
var
b
=
0
,
c
=
a
.
length
;
b
<
c
;
b
++
)
if
(
a
[
b
]
instanceof
THREE
.
ShaderMaterial
)
return
!
0
;
return
!
1
},
createMaterial
:
function
(
a
,
b
){
function
c
(
a
){
a
=
Math
.
log
(
a
)
/
Math
.
LN2
;
return
Math
.
pow
(
2
,
Math
.
round
(
a
))}
function
d
(
a
,
"
%
"
):
b
+
((
a
.
loaded
/
1024
).
toFixed
(
2
)
+
"
KB
"
);
this
.
statusDomElement
.
innerHTML
=
b
},
extractUrlBase
:
function
(
a
){
a
=
a
.
split
(
"
/
"
);
if
(
1
===
a
.
length
)
return
"
./
"
;
a
.
pop
();
return
a
.
join
(
"
/
"
)
+
"
/
"
},
initMaterials
:
function
(
a
,
b
){
for
(
var
c
=
[],
d
=
0
;
d
<
a
.
length
;
++
d
)
c
[
d
]
=
this
.
createMaterial
(
a
[
d
],
b
);
return
c
},
needsTangents
:
function
(
a
){
for
(
var
b
=
0
,
c
=
a
.
length
;
b
<
c
;
b
++
)
if
(
a
[
b
]
instanceof
THREE
.
ShaderMaterial
)
return
!
0
;
return
!
1
},
createMaterial
:
function
(
a
,
b
){
function
c
(
a
){
a
=
Math
.
log
(
a
)
/
Math
.
LN2
;
return
Math
.
pow
(
2
,
Math
.
round
(
a
))}
function
d
(
a
,
d
,
e
,
g
,
h
,
k
,
p
){
var
v
=
b
+
e
;
a
[
d
]
=
new
THREE
.
Texture
(
document
.
createElement
(
"
canvas
"
));
a
[
d
].
sourceFile
=
e
;
g
&&
(
a
[
d
].
repeat
.
set
(
g
[
0
],
g
[
1
]),
1
!==
g
[
0
]
&&
(
a
[
d
].
wrapS
=
THREE
.
RepeatWrapping
),
1
!==
g
[
1
]
&&
(
a
[
d
].
wrapT
=
THREE
.
RepeatWrapping
));
h
&&
a
[
d
].
offset
.
set
(
h
[
0
],
h
[
1
]);
k
&&
(
e
=
{
repeat
:
THREE
.
RepeatWrapping
,
mirror
:
THREE
.
MirroredRepeatWrapping
},
void
0
!==
e
[
k
[
0
]]
&&
(
a
[
d
].
wrapS
=
e
[
k
[
0
]]),
void
0
!==
e
[
k
[
1
]]
&&
(
a
[
d
].
wrapT
=
e
[
k
[
1
]]));
p
&&
(
a
[
d
].
anisotropy
=
p
);
var
w
=
a
[
d
];
f
.
imageLoader
.
crossOrigin
=
f
.
crossOrigin
;
f
.
imageLoader
.
load
(
v
,
function
(
a
){
if
(
!
1
===
d
,
e
,
g
,
h
,
k
,
p
){
var
v
=
b
+
e
,
w
,
u
=
THREE
.
Loader
.
Handlers
.
get
(
v
);
null
!==
u
?
w
=
u
.
load
(
v
):(
w
=
new
THREE
.
Texture
(
document
.
createElement
(
"
canvas
"
)),
u
=
f
.
imageLoader
,
u
.
crossOrigin
=
f
.
crossOrigin
,
u
.
load
(
v
,
function
(
a
){
if
(
!
1
===
THREE
.
Math
.
isPowerOfTwo
(
a
.
width
)
||!
1
===
THREE
.
Math
.
isPowerOfTwo
(
a
.
height
)){
var
b
=
c
(
a
.
width
),
d
=
c
(
a
.
height
);
w
.
image
.
width
=
b
;
w
.
image
.
height
=
d
;
w
.
image
.
getContext
(
"
2d
"
).
drawImage
(
a
,
0
,
0
,
b
,
d
)}
else
w
.
image
=
a
;
w
.
needsUpdate
=!
0
}));
w
.
sourceFile
=
e
;
g
&&
(
w
.
repeat
.
set
(
g
[
0
],
g
[
1
]),
1
!==
g
[
0
]
&&
(
w
.
wrapS
=
THREE
.
RepeatWrapping
),
THREE
.
Math
.
isPowerOfTwo
(
a
.
width
)
||!
1
===
THREE
.
Math
.
isPowerOfTwo
(
a
.
height
)){
var
b
=
c
(
a
.
width
),
d
=
c
(
a
.
height
);
w
.
image
.
width
=
b
;
w
.
image
.
height
=
d
;
w
.
image
.
getContext
(
"
2d
"
).
drawImage
(
a
,
0
,
0
,
b
,
d
)}
else
w
.
image
=
a
;
w
.
needsUpdate
=!
0
})}
function
e
(
a
){
return
(
255
*
a
[
0
]
<<
16
)
+
(
255
*
a
[
1
]
<<
8
)
+
255
*
a
[
2
]}
var
f
=
this
,
g
=
"
MeshLambertMaterial
"
,
h
=
{
color
:
15658734
,
opacity
:
1
,
map
:
null
,
lightMap
:
null
,
normalMap
:
null
,
bumpMap
:
null
,
wireframe
:
!
1
};
if
(
a
.
shading
){
var
k
=
a
.
shading
.
toLowerCase
();
"
phong
"
===
k
?
g
=
"
MeshPhongMaterial
"
:
"
basic
"
===
k
&&
(
g
=
"
MeshBasicMaterial
"
)}
void
0
!==
1
!==
g
[
1
]
&&
(
w
.
wrapT
=
THREE
.
RepeatWrapping
));
h
&&
w
.
offset
.
set
(
h
[
0
],
h
[
1
]);
k
&&
(
e
=
{
repeat
:
THREE
.
RepeatWrapping
,
mirror
:
THREE
.
MirroredRepeatWrapping
},
void
0
!==
e
[
k
[
0
]]
&&
(
w
.
wrapS
=
e
[
k
[
0
]]),
void
0
!==
e
[
k
[
1
]]
&&
(
w
.
wrapT
=
e
[
k
[
1
]]));
p
&&
(
w
.
anisotropy
=
p
);
a
[
d
]
=
w
}
function
e
(
a
){
return
(
255
*
a
[
0
]
<<
16
)
+
(
255
*
a
[
1
]
<<
8
)
+
255
*
a
[
2
]}
var
f
=
this
,
g
=
"
MeshLambertMaterial
"
,
h
=
{
color
:
15658734
,
opacity
:
1
,
map
:
null
,
lightMap
:
null
,
normalMap
:
null
,
bumpMap
:
null
,
wireframe
:
!
1
};
if
(
a
.
shading
){
var
k
=
a
.
shading
.
toLowerCase
();
"
phong
"
===
k
?
g
=
"
MeshPhongMaterial
"
:
a
.
blending
&&
void
0
!==
THREE
[
a
.
blending
]
&&
(
h
.
blending
=
THREE
[
a
.
blending
]);
if
(
void
0
!==
a
.
transparent
||
1
>
a
.
opacity
)
h
.
transparent
=
a
.
transparent
;
void
0
!==
a
.
depthTest
&&
(
h
.
depthTest
=
a
.
depthTest
);
void
0
!==
a
.
depthWrite
&&
(
h
.
depthWrite
=
a
.
depthWrite
);
void
0
!==
a
.
visible
&&
(
h
.
visible
=
a
.
visible
);
void
0
!==
a
.
flipSided
&&
(
h
.
side
=
THREE
.
BackSide
);
void
0
!==
a
.
doubleSided
&&
(
h
.
side
=
THREE
.
DoubleSide
);
void
0
!==
a
.
wireframe
&&
(
h
.
wireframe
=
a
.
wireframe
);
void
0
!==
a
.
vertexColors
&&
(
"
face
"
===
a
.
vertexColors
?
h
.
vertexColors
=
THREE
.
FaceColors
:
"
basic
"
===
k
&&
(
g
=
"
MeshBasicMaterial
"
)}
void
0
!==
a
.
blending
&&
void
0
!==
THREE
[
a
.
blending
]
&&
(
h
.
blending
=
THREE
[
a
.
blending
]);
if
(
void
0
!==
a
.
transparent
||
1
>
a
.
opacity
)
h
.
transparent
=
a
.
transparent
;
void
0
!==
a
.
depthTest
&&
(
h
.
depthTest
=
a
.
depthTest
);
void
0
!==
a
.
depthWrite
&&
(
h
.
depthWrite
=
a
.
depthWrite
);
void
0
!==
a
.
visible
&&
(
h
.
visible
=
a
.
visible
);
void
0
!==
a
.
flipSided
&&
(
h
.
side
=
THREE
.
BackSide
);
void
0
!==
a
.
doubleSided
&&
(
h
.
side
=
THREE
.
DoubleSide
);
void
0
!==
a
.
wireframe
&&
(
h
.
wireframe
=
a
.
wireframe
);
void
0
!==
a
.
vertexColors
&&
(
"
face
"
===
a
.
vertexColors
&&
(
h
.
vertexColors
=
THREE
.
VertexColors
));
a
.
colorDiffuse
?
h
.
color
=
e
(
a
.
colorDiffuse
):
a
.
DbgColor
&&
(
h
.
color
=
a
.
DbgColor
);
a
.
colorSpecular
&&
(
h
.
specular
=
e
(
a
.
colorSpecular
));
a
.
colorAmbient
&&
(
h
.
ambient
=
e
(
a
.
colorAmbient
));
a
.
colorEmissive
&&
(
h
.
emissive
=
e
(
a
.
colorEmissive
));
a
.
transparency
&&
(
h
.
opacity
=
a
.
transparency
);
a
.
specularCoef
&&
(
h
.
shininess
=
a
.
specularCoef
);
a
.
mapDiffuse
&&
b
&&
d
(
h
,
"
map
"
,
a
.
mapDiffuse
,
a
.
mapDiffuseRepeat
,
a
.
mapDiffuseOffset
,
a
.
mapDiffuseWrap
,
a
.
mapDiffuseAnisotropy
);
a
.
mapLight
&&
b
&&
d
(
h
,
"
lightMap
"
,
a
.
vertexColors
?
h
.
vertexColors
=
THREE
.
FaceColors
:
a
.
vertexColors
&&
(
h
.
vertexColors
=
THREE
.
VertexColors
));
a
.
colorDiffuse
?
h
.
color
=
e
(
a
.
colorDiffuse
):
a
.
DbgColor
&&
(
h
.
color
=
a
.
DbgColor
);
a
.
colorSpecular
&&
(
h
.
specular
=
e
(
a
.
colorSpecular
));
a
.
colorAmbient
&&
(
h
.
ambient
=
e
(
a
.
colorAmbient
));
a
.
colorEmissive
&&
(
h
.
emissive
=
e
(
a
.
colorEmissive
));
a
.
transparency
&&
(
h
.
opacity
=
a
.
transparency
);
a
.
specularCoef
&&
(
h
.
shininess
=
a
.
specularCoef
);
a
.
mapDiffuse
&&
b
&&
d
(
h
,
"
map
"
,
a
.
mapDiffuse
,
a
.
mapDiffuseRepeat
,
a
.
mapDiffuseOffset
,
a
.
mapDiffuseWrap
,
a
.
map
Light
,
a
.
mapLightRepeat
,
a
.
mapLightOffset
,
a
.
mapLightWrap
,
a
.
mapLightAnisotropy
);
a
.
mapBump
&&
b
&&
d
(
h
,
"
bumpMap
"
,
a
.
mapBump
,
a
.
mapBumpRepeat
,
a
.
mapBumpOffset
,
a
.
mapBumpWrap
,
a
.
mapBumpAnisotropy
);
a
.
mapNormal
&&
b
&&
d
(
h
,
"
normalMap
"
,
a
.
mapNormal
,
a
.
mapNormalRepeat
,
a
.
mapNormalOffset
,
a
.
mapNormalWrap
,
a
.
mapNormalAnisotropy
);
a
.
mapSpecular
&&
b
&&
d
(
h
,
"
specularMap
"
,
a
.
mapSpecular
,
a
.
mapSpecularRepeat
,
a
.
mapSpecularOffset
,
a
.
mapSpecularWrap
,
a
.
mapSpecularAnisotropy
);
a
.
mapBumpScale
&&
(
h
.
bumpScale
=
a
.
mapBumpScale
);
a
.
mapNormal
?(
g
=
THREE
.
ShaderLib
.
normalmap
,
a
.
map
DiffuseAnisotropy
);
a
.
mapLight
&&
b
&&
d
(
h
,
"
lightMap
"
,
a
.
mapLight
,
a
.
mapLightRepeat
,
a
.
mapLightOffset
,
a
.
mapLightWrap
,
a
.
mapLightAnisotropy
);
a
.
mapBump
&&
b
&&
d
(
h
,
"
bumpMap
"
,
a
.
mapBump
,
a
.
mapBumpRepeat
,
a
.
mapBumpOffset
,
a
.
mapBumpWrap
,
a
.
mapBumpAnisotropy
);
a
.
mapNormal
&&
b
&&
d
(
h
,
"
normalMap
"
,
a
.
mapNormal
,
a
.
mapNormalRepeat
,
a
.
mapNormalOffset
,
a
.
mapNormalWrap
,
a
.
mapNormalAnisotropy
);
a
.
mapSpecular
&&
b
&&
d
(
h
,
"
specularMap
"
,
a
.
mapSpecular
,
a
.
mapSpecularRepeat
,
a
.
mapSpecularOffset
,
a
.
mapSpecularWrap
,
a
.
mapSpecularAnisotropy
);
a
.
mapBumpScale
&&
k
=
THREE
.
UniformsUtils
.
clone
(
g
.
uniforms
),
k
.
tNormal
.
value
=
h
.
normalMap
,
a
.
mapNormalFactor
&&
k
.
uNormalScale
.
value
.
set
(
a
.
mapNormalFactor
,
a
.
mapNormalFactor
),
h
.
map
&&
(
k
.
tDiffuse
.
value
=
h
.
map
,
k
.
enableDiffuse
.
value
=!
0
),
h
.
specularMap
&&
(
k
.
tSpecular
.
value
=
h
.
specularMap
,
k
.
enableSpecular
.
value
=!
0
),
h
.
lightMap
&&
(
k
.
tAO
.
value
=
h
.
lightMap
,
k
.
enableAO
.
value
=!
0
),
k
.
diffuse
.
value
.
setHex
(
h
.
color
),
k
.
specular
.
value
.
setHex
(
h
.
specular
),
k
.
ambient
.
value
.
setHex
(
h
.
ambient
),
k
.
shininess
.
value
=
h
.
shininess
,
void
0
!==
h
.
opacity
&&
(
k
.
opacity
.
value
=
(
h
.
bumpScale
=
a
.
mapBumpScale
);
a
.
mapNormal
?(
g
=
THREE
.
ShaderLib
.
normalmap
,
k
=
THREE
.
UniformsUtils
.
clone
(
g
.
uniforms
),
k
.
tNormal
.
value
=
h
.
normalMap
,
a
.
mapNormalFactor
&&
k
.
uNormalScale
.
value
.
set
(
a
.
mapNormalFactor
,
a
.
mapNormalFactor
),
h
.
map
&&
(
k
.
tDiffuse
.
value
=
h
.
map
,
k
.
enableDiffuse
.
value
=!
0
),
h
.
specularMap
&&
(
k
.
tSpecular
.
value
=
h
.
specularMap
,
k
.
enableSpecular
.
value
=!
0
),
h
.
lightMap
&&
(
k
.
tAO
.
value
=
h
.
lightMap
,
k
.
enableAO
.
value
=!
0
),
k
.
diffuse
.
value
.
setHex
(
h
.
color
),
k
.
specular
.
value
.
setHex
(
h
.
specular
),
k
.
ambient
.
value
.
setHex
(
h
.
ambient
),
h
.
opacity
),
g
=
new
THREE
.
ShaderMaterial
({
fragmentShader
:
g
.
fragmentShader
,
vertexShader
:
g
.
vertexShader
,
uniforms
:
k
,
lights
:
!
0
,
fog
:
!
0
}),
h
.
transparent
&&
(
g
.
transparent
=!
0
)):
g
=
new
THREE
[
g
](
h
);
void
0
!==
a
.
DbgName
&&
(
g
.
name
=
a
.
DbgName
);
return
g
}};
THREE
.
XHRLoader
=
function
(
a
){
this
.
cache
=
new
THREE
.
Cache
;
this
.
manager
=
void
0
!==
a
?
a
:
THREE
.
DefaultLoadingManager
};
k
.
shininess
.
value
=
h
.
shininess
,
void
0
!==
h
.
opacity
&&
(
k
.
opacity
.
value
=
h
.
opacity
),
g
=
new
THREE
.
ShaderMaterial
({
fragmentShader
:
g
.
fragmentShader
,
vertexShader
:
g
.
vertexShader
,
uniforms
:
k
,
lights
:
!
0
,
fog
:
!
0
}),
h
.
transparent
&&
(
g
.
transparent
=!
0
)):
g
=
new
THREE
[
g
](
h
);
void
0
!==
a
.
DbgName
&&
(
g
.
name
=
a
.
DbgName
);
return
g
}};
THREE
.
Loader
.
Handlers
=
{
handlers
:[],
add
:
function
(
a
,
b
){
this
.
handlers
.
push
(
a
,
b
)},
get
:
function
(
a
){
for
(
var
b
=
0
,
c
=
this
.
handlers
.
length
;
b
<
c
;
b
+=
2
){
var
d
=
this
.
handlers
[
b
+
1
];
if
(
this
.
handlers
[
b
].
test
(
a
))
return
d
}
return
null
}};
THREE
.
XHRLoader
=
function
(
a
){
this
.
cache
=
new
THREE
.
Cache
;
this
.
manager
=
void
0
!==
a
?
a
:
THREE
.
DefaultLoadingManager
};
THREE
.
XHRLoader
.
prototype
=
{
constructor
:
THREE
.
XHRLoader
,
load
:
function
(
a
,
b
,
c
,
d
){
var
e
=
this
,
f
=
e
.
cache
.
get
(
a
);
void
0
!==
f
?
b
(
f
):(
f
=
new
XMLHttpRequest
,
f
.
open
(
"
GET
"
,
a
,
!
0
),
void
0
!==
b
&&
f
.
addEventListener
(
"
load
"
,
function
(
c
){
e
.
cache
.
add
(
a
,
this
.
response
);
b
(
this
.
response
);
e
.
manager
.
itemEnd
(
a
)},
!
1
),
void
0
!==
c
&&
f
.
addEventListener
(
"
progress
"
,
function
(
a
){
c
(
a
)},
!
1
),
void
0
!==
d
&&
f
.
addEventListener
(
"
error
"
,
function
(
a
){
d
(
a
)},
!
1
),
void
0
!==
this
.
crossOrigin
&&
(
f
.
crossOrigin
=
this
.
crossOrigin
),
void
0
!==
this
.
responseType
&&
(
f
.
responseType
=
THREE
.
XHRLoader
.
prototype
=
{
constructor
:
THREE
.
XHRLoader
,
load
:
function
(
a
,
b
,
c
,
d
){
var
e
=
this
,
f
=
e
.
cache
.
get
(
a
);
void
0
!==
f
?
b
(
f
):(
f
=
new
XMLHttpRequest
,
f
.
open
(
"
GET
"
,
a
,
!
0
),
void
0
!==
b
&&
f
.
addEventListener
(
"
load
"
,
function
(
c
){
e
.
cache
.
add
(
a
,
this
.
response
);
b
(
this
.
response
);
e
.
manager
.
itemEnd
(
a
)},
!
1
),
void
0
!==
c
&&
f
.
addEventListener
(
"
progress
"
,
function
(
a
){
c
(
a
)},
!
1
),
void
0
!==
d
&&
f
.
addEventListener
(
"
error
"
,
function
(
a
){
d
(
a
)},
!
1
),
void
0
!==
this
.
crossOrigin
&&
(
f
.
crossOrigin
=
this
.
crossOrigin
),
void
0
!==
this
.
responseType
&&
(
f
.
responseType
=
this
.
responseType
),
f
.
send
(
null
),
e
.
manager
.
itemStart
(
a
))},
setResponseType
:
function
(
a
){
this
.
responseType
=
a
},
setCrossOrigin
:
function
(
a
){
this
.
crossOrigin
=
a
}};
THREE
.
ImageLoader
=
function
(
a
){
this
.
cache
=
new
THREE
.
Cache
;
this
.
manager
=
void
0
!==
a
?
a
:
THREE
.
DefaultLoadingManager
};
this
.
responseType
),
f
.
send
(
null
),
e
.
manager
.
itemStart
(
a
))},
setResponseType
:
function
(
a
){
this
.
responseType
=
a
},
setCrossOrigin
:
function
(
a
){
this
.
crossOrigin
=
a
}};
THREE
.
ImageLoader
=
function
(
a
){
this
.
cache
=
new
THREE
.
Cache
;
this
.
manager
=
void
0
!==
a
?
a
:
THREE
.
DefaultLoadingManager
};
THREE
.
ImageLoader
.
prototype
=
{
constructor
:
THREE
.
ImageLoader
,
load
:
function
(
a
,
b
,
c
,
d
){
var
e
=
this
,
f
=
e
.
cache
.
get
(
a
);
if
(
void
0
!==
f
)
b
(
f
);
else
return
f
=
document
.
createElement
(
"
img
"
),
void
0
!==
b
&&
f
.
addEventListener
(
"
load
"
,
function
(
c
){
e
.
cache
.
add
(
a
,
this
);
b
(
this
);
e
.
manager
.
itemEnd
(
a
)},
!
1
),
void
0
!==
c
&&
f
.
addEventListener
(
"
progress
"
,
function
(
a
){
c
(
a
)},
!
1
),
void
0
!==
d
&&
f
.
addEventListener
(
"
error
"
,
function
(
a
){
d
(
a
)},
!
1
),
void
0
!==
this
.
crossOrigin
&&
(
f
.
crossOrigin
=
this
.
crossOrigin
),
f
.
src
=
a
,
e
.
manager
.
itemStart
(
a
),
f
},
setCrossOrigin
:
function
(
a
){
this
.
crossOrigin
=
THREE
.
ImageLoader
.
prototype
=
{
constructor
:
THREE
.
ImageLoader
,
load
:
function
(
a
,
b
,
c
,
d
){
var
e
=
this
,
f
=
e
.
cache
.
get
(
a
);
if
(
void
0
!==
f
)
b
(
f
);
else
return
f
=
document
.
createElement
(
"
img
"
),
void
0
!==
b
&&
f
.
addEventListener
(
"
load
"
,
function
(
c
){
e
.
cache
.
add
(
a
,
this
);
b
(
this
);
e
.
manager
.
itemEnd
(
a
)},
!
1
),
void
0
!==
c
&&
f
.
addEventListener
(
"
progress
"
,
function
(
a
){
c
(
a
)},
!
1
),
void
0
!==
d
&&
f
.
addEventListener
(
"
error
"
,
function
(
a
){
d
(
a
)},
!
1
),
void
0
!==
this
.
crossOrigin
&&
(
f
.
crossOrigin
=
this
.
crossOrigin
),
f
.
src
=
a
,
e
.
manager
.
itemStart
(
a
),
f
},
setCrossOrigin
:
function
(
a
){
this
.
crossOrigin
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录