Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
448e5075
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
448e5075
编写于
2月 15, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
If extractUrlBase returns '' textures in the root folder won't load. Fixes #1314.
上级
3af68ade
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
44 addition
and
56 deletion
+44
-56
build/Three.js
build/Three.js
+13
-13
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+1
-1
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+1
-1
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+10
-10
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+3
-3
src/extras/loaders/ColladaLoader.js
src/extras/loaders/ColladaLoader.js
+1
-1
src/extras/loaders/JSONLoader.js
src/extras/loaders/JSONLoader.js
+5
-17
src/extras/loaders/Loader.js
src/extras/loaders/Loader.js
+9
-9
未找到文件。
build/Three.js
浏览文件 @
448e5075
此差异已折叠。
点击以展开。
build/custom/ThreeCanvas.js
浏览文件 @
448e5075
...
...
@@ -79,7 +79,7 @@ f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
-
Math
.
abs
(
this
.
y
):
Math
.
abs
(
this
.
y
);
this
.
z
=
0
>
a
.
n21
-
a
.
n12
?
-
Math
.
abs
(
this
.
z
):
Math
.
abs
(
this
.
z
);
this
.
normalize
();
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
0
===
a
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
f
=
a
.
x
,
g
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
f
+
c
*
h
-
d
*
g
;
this
.
y
=
c
*
a
+
e
*
g
+
d
*
f
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
g
-
c
*
f
;
this
.
w
=
e
*
a
-
b
*
f
-
c
*
g
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
f
=
this
.
x
,
g
=
this
.
y
,
h
=
this
.
z
,
m
=
this
.
w
,
j
=
m
*
c
+
g
*
e
-
h
*
d
,
l
=
m
*
d
+
h
*
c
-
f
*
e
,
o
=
m
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
h
*
e
;
b
.
x
=
j
*
m
+
c
*-
f
+
l
*-
h
-
o
*-
g
;
b
.
y
=
l
*
m
+
c
*-
g
+
o
*-
f
-
j
*-
h
;
b
.
z
=
o
*
m
+
c
*-
h
+
j
*-
g
-
l
*-
f
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
f
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
0
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
f
)
/
e
;
d
=
Math
.
sin
(
d
*
f
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
f
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
f
)
/
e
;
d
=
Math
.
sin
(
d
*
f
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Vertex
.
prototype
=
{
constructor
:
THREE
.
Vertex
,
clone
:
function
(){
return
new
THREE
.
Vertex
(
this
.
position
.
clone
())}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
f
;
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
.
prototype
=
{
constructor
:
THREE
.
Face3
,
clone
:
function
(){
var
a
=
new
THREE
.
Face3
(
this
.
a
,
this
.
b
,
this
.
c
);
a
.
normal
.
copy
(
this
.
normal
);
a
.
color
.
copy
(
this
.
color
);
a
.
centroid
.
copy
(
this
.
centroid
);
a
.
materialIndex
=
this
.
materialIndex
;
var
b
,
c
;
for
(
b
=
0
,
c
=
this
.
vertexNormals
.
length
;
b
<
c
;
b
++
)
a
.
vertexNormals
[
b
]
=
this
.
vertexNormals
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexColors
.
length
;
b
<
c
;
b
++
)
a
.
vertexColors
[
b
]
=
this
.
vertexColors
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexTangents
.
length
;
b
<
c
;
b
++
)
a
.
vertexTangents
[
b
]
=
this
.
vertexTangents
[
b
].
clone
();
return
a
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
g
;
this
.
centroid
=
new
THREE
.
Vector3
};
...
...
build/custom/ThreeDOM.js
浏览文件 @
448e5075
...
...
@@ -78,7 +78,7 @@ f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
-
Math
.
abs
(
this
.
y
):
Math
.
abs
(
this
.
y
);
this
.
z
=
0
>
a
.
n21
-
a
.
n12
?
-
Math
.
abs
(
this
.
z
):
Math
.
abs
(
this
.
z
);
this
.
normalize
();
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
0
===
a
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
f
=
a
.
x
,
g
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
f
+
c
*
h
-
d
*
g
;
this
.
y
=
c
*
a
+
e
*
g
+
d
*
f
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
g
-
c
*
f
;
this
.
w
=
e
*
a
-
b
*
f
-
c
*
g
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
f
=
this
.
x
,
g
=
this
.
y
,
h
=
this
.
z
,
k
=
this
.
w
,
i
=
k
*
c
+
g
*
e
-
h
*
d
,
j
=
k
*
d
+
h
*
c
-
f
*
e
,
l
=
k
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
h
*
e
;
b
.
x
=
i
*
k
+
c
*-
f
+
j
*-
h
-
l
*-
g
;
b
.
y
=
j
*
k
+
c
*-
g
+
l
*-
f
-
i
*-
h
;
b
.
z
=
l
*
k
+
c
*-
h
+
i
*-
g
-
j
*-
f
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
f
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
0
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
f
)
/
e
;
d
=
Math
.
sin
(
d
*
f
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
f
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
f
)
/
e
;
d
=
Math
.
sin
(
d
*
f
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Vertex
.
prototype
=
{
constructor
:
THREE
.
Vertex
,
clone
:
function
(){
return
new
THREE
.
Vertex
(
this
.
position
.
clone
())}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
f
;
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
.
prototype
=
{
constructor
:
THREE
.
Face3
,
clone
:
function
(){
var
a
=
new
THREE
.
Face3
(
this
.
a
,
this
.
b
,
this
.
c
);
a
.
normal
.
copy
(
this
.
normal
);
a
.
color
.
copy
(
this
.
color
);
a
.
centroid
.
copy
(
this
.
centroid
);
a
.
materialIndex
=
this
.
materialIndex
;
var
b
,
c
;
for
(
b
=
0
,
c
=
this
.
vertexNormals
.
length
;
b
<
c
;
b
++
)
a
.
vertexNormals
[
b
]
=
this
.
vertexNormals
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexColors
.
length
;
b
<
c
;
b
++
)
a
.
vertexColors
[
b
]
=
this
.
vertexColors
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexTangents
.
length
;
b
<
c
;
b
++
)
a
.
vertexTangents
[
b
]
=
this
.
vertexTangents
[
b
].
clone
();
return
a
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
g
;
this
.
centroid
=
new
THREE
.
Vector3
};
...
...
build/custom/ThreeExtras.js
浏览文件 @
448e5075
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
448e5075
...
...
@@ -78,7 +78,7 @@ f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
-
Math
.
abs
(
this
.
y
):
Math
.
abs
(
this
.
y
);
this
.
z
=
0
>
a
.
n21
-
a
.
n12
?
-
Math
.
abs
(
this
.
z
):
Math
.
abs
(
this
.
z
);
this
.
normalize
();
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
0
===
a
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
f
=
a
.
x
,
g
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
f
+
c
*
h
-
d
*
g
;
this
.
y
=
c
*
a
+
e
*
g
+
d
*
f
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
g
-
c
*
f
;
this
.
w
=
e
*
a
-
b
*
f
-
c
*
g
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
f
=
this
.
x
,
g
=
this
.
y
,
h
=
this
.
z
,
l
=
this
.
w
,
i
=
l
*
c
+
g
*
e
-
h
*
d
,
j
=
l
*
d
+
h
*
c
-
f
*
e
,
m
=
l
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
h
*
e
;
b
.
x
=
i
*
l
+
c
*-
f
+
j
*-
h
-
m
*-
g
;
b
.
y
=
j
*
l
+
c
*-
g
+
m
*-
f
-
i
*-
h
;
b
.
z
=
m
*
l
+
c
*-
h
+
i
*-
g
-
j
*-
f
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
f
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
0
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
f
)
/
e
;
d
=
Math
.
sin
(
d
*
f
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
f
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
f
)
/
e
;
d
=
Math
.
sin
(
d
*
f
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Vertex
.
prototype
=
{
constructor
:
THREE
.
Vertex
,
clone
:
function
(){
return
new
THREE
.
Vertex
(
this
.
position
.
clone
())}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
f
;
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
.
prototype
=
{
constructor
:
THREE
.
Face3
,
clone
:
function
(){
var
a
=
new
THREE
.
Face3
(
this
.
a
,
this
.
b
,
this
.
c
);
a
.
normal
.
copy
(
this
.
normal
);
a
.
color
.
copy
(
this
.
color
);
a
.
centroid
.
copy
(
this
.
centroid
);
a
.
materialIndex
=
this
.
materialIndex
;
var
b
,
c
;
for
(
b
=
0
,
c
=
this
.
vertexNormals
.
length
;
b
<
c
;
b
++
)
a
.
vertexNormals
[
b
]
=
this
.
vertexNormals
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexColors
.
length
;
b
<
c
;
b
++
)
a
.
vertexColors
[
b
]
=
this
.
vertexColors
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexTangents
.
length
;
b
<
c
;
b
++
)
a
.
vertexTangents
[
b
]
=
this
.
vertexTangents
[
b
].
clone
();
return
a
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
g
;
this
.
centroid
=
new
THREE
.
Vector3
};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
448e5075
...
...
@@ -79,7 +79,7 @@ g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
-
Math
.
abs
(
this
.
y
):
Math
.
abs
(
this
.
y
);
this
.
z
=
0
>
a
.
n21
-
a
.
n12
?
-
Math
.
abs
(
this
.
z
):
Math
.
abs
(
this
.
z
);
this
.
normalize
();
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
0
===
a
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
g
=
a
.
x
,
h
=
a
.
y
,
i
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
i
-
d
*
h
;
this
.
y
=
c
*
a
+
e
*
h
+
d
*
g
-
b
*
i
;
this
.
z
=
d
*
a
+
e
*
i
+
b
*
h
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
h
-
d
*
i
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
g
=
this
.
x
,
h
=
this
.
y
,
i
=
this
.
z
,
k
=
this
.
w
,
l
=
k
*
c
+
h
*
e
-
i
*
d
,
j
=
k
*
d
+
i
*
c
-
g
*
e
,
n
=
k
*
e
+
g
*
d
-
h
*
c
,
c
=-
g
*
c
-
h
*
d
-
i
*
e
;
b
.
x
=
l
*
k
+
c
*-
g
+
j
*-
i
-
n
*-
h
;
b
.
y
=
j
*
k
+
c
*-
h
+
n
*-
g
-
l
*-
i
;
b
.
z
=
n
*
k
+
c
*-
i
+
l
*-
h
-
j
*-
g
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
0
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
g
)
/
e
;
d
=
Math
.
sin
(
d
*
g
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
0
>
e
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
1
<=
Math
.
abs
(
e
))
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
e
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
0.001
>
Math
.
abs
(
e
))
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
b
=
Math
.
sin
((
1
-
d
)
*
g
)
/
e
;
d
=
Math
.
sin
(
d
*
g
)
/
e
;
c
.
w
=
a
.
w
*
b
+
c
.
w
*
d
;
c
.
x
=
a
.
x
*
b
+
c
.
x
*
d
;
c
.
y
=
a
.
y
*
b
+
c
.
y
*
d
;
c
.
z
=
a
.
z
*
b
+
c
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Vertex
.
prototype
=
{
constructor
:
THREE
.
Vertex
,
clone
:
function
(){
return
new
THREE
.
Vertex
(
this
.
position
.
clone
())}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
g
;
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
.
prototype
=
{
constructor
:
THREE
.
Face3
,
clone
:
function
(){
var
a
=
new
THREE
.
Face3
(
this
.
a
,
this
.
b
,
this
.
c
);
a
.
normal
.
copy
(
this
.
normal
);
a
.
color
.
copy
(
this
.
color
);
a
.
centroid
.
copy
(
this
.
centroid
);
a
.
materialIndex
=
this
.
materialIndex
;
var
b
,
c
;
for
(
b
=
0
,
c
=
this
.
vertexNormals
.
length
;
b
<
c
;
b
++
)
a
.
vertexNormals
[
b
]
=
this
.
vertexNormals
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexColors
.
length
;
b
<
c
;
b
++
)
a
.
vertexColors
[
b
]
=
this
.
vertexColors
[
b
].
clone
();
for
(
b
=
0
,
c
=
this
.
vertexTangents
.
length
;
b
<
c
;
b
++
)
a
.
vertexTangents
[
b
]
=
this
.
vertexTangents
[
b
].
clone
();
return
a
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
h
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
h
;
this
.
centroid
=
new
THREE
.
Vector3
};
...
...
@@ -219,7 +219,7 @@ c),Wa=b,Ma=c}function u(a,b){var c;"fragment"===a?c=f.createShader(f.FRAGMENT_SH
(
f
.
texParameteri
(
a
,
f
.
TEXTURE_WRAP_S
,
f
.
CLAMP_TO_EDGE
),
f
.
texParameteri
(
a
,
f
.
TEXTURE_WRAP_T
,
f
.
CLAMP_TO_EDGE
),
f
.
texParameteri
(
a
,
f
.
TEXTURE_MAG_FILTER
,
v
(
b
.
magFilter
)),
f
.
texParameteri
(
a
,
f
.
TEXTURE_MIN_FILTER
,
v
(
b
.
minFilter
)))}
function
A
(
a
,
b
){
f
.
bindRenderbuffer
(
f
.
RENDERBUFFER
,
a
);
b
.
depthBuffer
&&!
b
.
stencilBuffer
?(
f
.
renderbufferStorage
(
f
.
RENDERBUFFER
,
f
.
DEPTH_COMPONENT16
,
b
.
width
,
b
.
height
),
f
.
framebufferRenderbuffer
(
f
.
FRAMEBUFFER
,
f
.
DEPTH_ATTACHMENT
,
f
.
RENDERBUFFER
,
a
)):
b
.
depthBuffer
&&
b
.
stencilBuffer
?(
f
.
renderbufferStorage
(
f
.
RENDERBUFFER
,
f
.
DEPTH_STENCIL
,
b
.
width
,
b
.
height
),
f
.
framebufferRenderbuffer
(
f
.
FRAMEBUFFER
,
f
.
DEPTH_STENCIL_ATTACHMENT
,
f
.
RENDERBUFFER
,
a
)):
f
.
renderbufferStorage
(
f
.
RENDERBUFFER
,
f
.
RGBA4
,
b
.
width
,
b
.
height
)}
function
v
(
a
){
switch
(
a
){
case
THREE
.
NearestFilter
:
case
THREE
.
NearestMipMapNearestFilter
:
case
THREE
.
NearestMipMapLinearFilter
:
return
f
.
NEAREST
;
default
:
return
f
.
LINEAR
}}
function
I
(
a
){
switch
(
a
){
case
THREE
.
RepeatWrapping
:
return
f
.
REPEAT
;
case
THREE
.
ClampToEdgeWrapping
:
return
f
.
CLAMP_TO_EDGE
;
case
THREE
.
MirroredRepeatWrapping
:
return
f
.
MIRRORED_REPEAT
;
case
THREE
.
NearestFilter
:
return
f
.
NEAREST
;
case
THREE
.
NearestMipMapNearestFilter
:
return
f
.
NEAREST_MIPMAP_NEAREST
;
case
THREE
.
NearestMipMapLinearFilter
:
return
f
.
NEAREST_MIPMAP_LINEAR
;
case
THREE
.
LinearFilter
:
return
f
.
LINEAR
;
case
THREE
.
LinearMipMapNearestFilter
:
return
f
.
LINEAR_MIPMAP_NEAREST
;
case
THREE
.
LinearMipMapLinearFilter
:
return
f
.
LINEAR_MIPMAP_LINEAR
;
case
THREE
.
ByteType
:
return
f
.
BYTE
;
case
THREE
.
UnsignedByteType
:
return
f
.
UNSIGNED_BYTE
;
case
THREE
.
ShortType
:
return
f
.
SHORT
;
case
THREE
.
UnsignedShortType
:
return
f
.
UNSIGNED_SHORT
;
case
THREE
.
IntType
:
return
f
.
INT
;
case
THREE
.
Unsigned
Shor
tType
:
return
f
.
UNSIGNED_INT
;
case
THREE
.
FloatType
:
return
f
.
FLOAT
;
case
THREE
.
AlphaFormat
:
return
f
.
ALPHA
;
case
THREE
.
RGBFormat
:
return
f
.
RGB
;
case
THREE
.
RGBAFormat
:
return
f
.
RGBA
;
case
THREE
.
LuminanceFormat
:
return
f
.
LUMINANCE
;
case
THREE
.
LuminanceAlphaFormat
:
return
f
.
LUMINANCE_ALPHA
}
return
0
}
var
a
=
a
||
{},
B
=
void
0
!==
a
.
canvas
?
a
.
canvas
:
document
.
createElement
(
"
canvas
"
),
E
=
void
0
!==
a
.
precision
?
a
.
precision
:
"
mediump
"
,
L
=
void
0
!==
a
.
alpha
?
a
.
alpha
:
!
0
,
J
=
void
0
!==
a
.
premultipliedAlpha
?
case
THREE
.
IntType
:
return
f
.
INT
;
case
THREE
.
Unsigned
In
tType
:
return
f
.
UNSIGNED_INT
;
case
THREE
.
FloatType
:
return
f
.
FLOAT
;
case
THREE
.
AlphaFormat
:
return
f
.
ALPHA
;
case
THREE
.
RGBFormat
:
return
f
.
RGB
;
case
THREE
.
RGBAFormat
:
return
f
.
RGBA
;
case
THREE
.
LuminanceFormat
:
return
f
.
LUMINANCE
;
case
THREE
.
LuminanceAlphaFormat
:
return
f
.
LUMINANCE_ALPHA
}
return
0
}
var
a
=
a
||
{},
B
=
void
0
!==
a
.
canvas
?
a
.
canvas
:
document
.
createElement
(
"
canvas
"
),
E
=
void
0
!==
a
.
precision
?
a
.
precision
:
"
mediump
"
,
L
=
void
0
!==
a
.
alpha
?
a
.
alpha
:
!
0
,
J
=
void
0
!==
a
.
premultipliedAlpha
?
a
.
premultipliedAlpha
:
!
0
,
N
=
void
0
!==
a
.
antialias
?
a
.
antialias
:
!
1
,
ja
=
void
0
!==
a
.
stencil
?
a
.
stencil
:
!
0
,
oa
=
void
0
!==
a
.
preserveDrawingBuffer
?
a
.
preserveDrawingBuffer
:
!
1
,
ka
=
void
0
!==
a
.
clearColor
?
new
THREE
.
Color
(
a
.
clearColor
):
new
THREE
.
Color
(
0
),
X
=
void
0
!==
a
.
clearAlpha
?
a
.
clearAlpha
:
0
,
$
=
void
0
!==
a
.
maxLights
?
a
.
maxLights
:
4
;
this
.
domElement
=
B
;
this
.
context
=
null
;
this
.
autoUpdateScene
=
this
.
autoUpdateObjects
=
this
.
sortObjects
=
this
.
autoClearStencil
=
this
.
autoClearDepth
=
this
.
autoClearColor
=
this
.
autoClear
=!
0
;
this
.
shadowMapEnabled
=
this
.
physicallyBasedShading
=
this
.
gammaOutput
=
this
.
gammaInput
=!
1
;
this
.
shadowMapCullFrontFaces
=
this
.
shadowMapSoft
=
this
.
shadowMapAutoUpdate
=!
0
;
this
.
shadowMapCascade
=
this
.
shadowMapDebug
=!
1
;
this
.
maxMorphTargets
=
8
;
this
.
maxMorphNormals
=
4
;
this
.
autoScaleCubemaps
=!
0
;
this
.
renderPluginsPre
=
[];
this
.
renderPluginsPost
=
[];
this
.
info
=
{
memory
:{
programs
:
0
,
geometries
:
0
,
textures
:
0
},
render
:{
calls
:
0
,
vertices
:
0
,
faces
:
0
,
points
:
0
}};
var
D
=
this
,
f
,
Va
=
[],
Ba
=
null
,
S
=
null
,
sa
=-
1
,
M
=
null
,
aa
=
null
,
ta
=
0
,
xa
=
null
,
T
=
null
,
Aa
=
null
,
Ga
=
null
,
Ha
=
null
,
Sa
=
null
,
Wa
=
null
,
Ma
=
null
,
tb
=
null
,
Nb
=
0
,
Xb
=
0
,
Hb
=
0
,
Ob
=
0
,
lc
=
0
,
mc
=
0
,
Yb
=
new
THREE
.
Frustum
,
Xa
=
new
THREE
.
Matrix4
,
Na
=
new
THREE
.
Vector4
,
nb
=
new
THREE
.
Vector3
,
nc
=
{
ambient
:[
0
,
0
,
0
],
directional
:{
length
:
0
,
colors
:[],
positions
:[]},
point
:{
length
:
0
,
colors
:[],
positions
:[],
distances
:[]}};
f
=
function
(){
var
a
;
try
{
if
(
!
(
a
=
B
.
getContext
(
"
experimental-webgl
"
,{
alpha
:
L
,
premultipliedAlpha
:
J
,
antialias
:
N
,
stencil
:
ja
,
preserveDrawingBuffer
:
oa
})))
throw
"
Error creating WebGL context.
"
;
console
.
log
(
navigator
.
userAgent
+
"
|
"
+
a
.
getParameter
(
a
.
VERSION
)
+
...
...
@@ -376,7 +376,7 @@ b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b
"
color
"
);
m
.
scale
=
b
.
getUniformLocation
(
j
,
"
scale
"
);
m
.
rotation
=
b
.
getUniformLocation
(
j
,
"
rotation
"
);
m
.
screenPosition
=
b
.
getUniformLocation
(
j
,
"
screenPosition
"
);
q
=!
1
};
this
.
render
=
function
(
a
,
d
,
e
,
y
){
var
a
=
a
.
__webglFlares
,
u
=
a
.
length
;
if
(
u
){
var
K
=
new
THREE
.
Vector3
,
A
=
y
/
e
,
v
=
0.5
*
e
,
I
=
0.5
*
y
,
B
=
16
/
y
,
E
=
new
THREE
.
Vector2
(
B
*
A
,
B
),
L
=
new
THREE
.
Vector3
(
1
,
1
,
0
),
J
=
new
THREE
.
Vector2
(
1
,
1
),
N
=
m
,
B
=
n
;
b
.
useProgram
(
j
);
q
||
(
b
.
enableVertexAttribArray
(
n
.
vertex
),
b
.
enableVertexAttribArray
(
n
.
uv
),
q
=!
0
);
b
.
uniform1i
(
N
.
occlusionMap
,
0
);
b
.
uniform1i
(
N
.
map
,
1
);
b
.
bindBuffer
(
b
.
ARRAY_BUFFER
,
g
);
b
.
vertexAttribPointer
(
B
.
vertex
,
2
,
b
.
FLOAT
,
!
1
,
16
,
0
);
b
.
vertexAttribPointer
(
B
.
uv
,
2
,
b
.
FLOAT
,
!
1
,
16
,
8
);
b
.
bindBuffer
(
b
.
ELEMENT_ARRAY_BUFFER
,
h
);
b
.
disable
(
b
.
CULL_FACE
);
b
.
depthMask
(
!
1
);
var
ja
,
oa
,
ka
,
X
,
$
;
for
(
ja
=
0
;
ja
<
u
;
ja
++
)
if
(
B
=
16
/
y
,
E
.
set
(
B
*
A
,
B
),
X
=
a
[
ja
],
K
.
set
(
X
.
matrixWorld
.
n14
,
X
.
matrixWorld
.
n24
,
X
.
matrixWorld
.
n34
),
d
.
matrixWorldInverse
.
multiplyVector3
(
K
),
d
.
projectionMatrix
.
multiplyVector3
(
K
),
L
.
copy
(
K
),
J
.
x
=
L
.
x
*
v
+
v
,
J
.
y
=
L
.
y
*
I
+
I
,
l
||
0
<
J
.
x
&&
J
.
x
<
e
&&
0
<
J
.
y
&&
J
.
y
<
y
){
b
.
activeTexture
(
b
.
TEXTURE1
);
b
.
bindTexture
(
b
.
TEXTURE_2D
,
i
);
b
.
copyTexImage2D
(
b
.
TEXTURE_2D
,
0
,
b
.
RGB
,
J
.
x
-
8
,
J
.
y
-
8
,
16
,
16
,
0
);
b
.
uniform1i
(
N
.
renderType
,
0
);
b
.
uniform2f
(
N
.
scale
,
E
.
x
,
E
.
y
);
b
.
uniform3f
(
N
.
screenPosition
,
L
.
x
,
L
.
y
,
L
.
z
);
b
.
disable
(
b
.
BLEND
);
b
.
enable
(
b
.
DEPTH_TEST
);
b
.
drawElements
(
b
.
TRIANGLES
,
6
,
b
.
UNSIGNED_SHORT
,
0
);
b
.
activeTexture
(
b
.
TEXTURE0
);
b
.
bindTexture
(
b
.
TEXTURE_2D
,
k
);
b
.
copyTexImage2D
(
b
.
TEXTURE_2D
,
0
,
b
.
RGBA
,
J
.
x
-
8
,
J
.
y
-
8
,
16
,
16
,
0
);
b
.
uniform1i
(
N
.
renderType
,
1
);
b
.
disable
(
b
.
DEPTH_TEST
);
b
.
activeTexture
(
b
.
TEXTURE1
);
b
.
bindTexture
(
b
.
TEXTURE_2D
,
i
);
b
.
drawElements
(
b
.
TRIANGLES
,
6
,
b
.
UNSIGNED_SHORT
,
0
);
X
.
positionScreen
.
copy
(
L
);
X
.
customUpdateCallback
?
X
.
customUpdateCallback
(
X
):
X
.
updateLensFlares
();
b
.
uniform1i
(
N
.
renderType
,
2
);
b
.
enable
(
b
.
BLEND
);
for
(
oa
=
0
,
ka
=
X
.
lensFlares
.
length
;
oa
<
ka
;
oa
++
)
if
(
$
=
X
.
lensFlares
[
oa
],
0.001
0
<
$
.
opacity
&&
0.0010
<
$
.
scale
)
L
.
x
=
$
.
x
,
L
.
y
=
$
.
y
,
L
.
z
=
$
.
z
,
B
=
$
.
size
*
$
.
scale
/
y
,
E
.
x
=
B
*
A
,
E
.
y
=
B
,
b
.
uniform3f
(
N
.
screenPosition
,
L
.
x
,
L
.
y
,
L
.
z
),
b
.
uniform2f
(
N
.
scale
,
E
.
x
,
E
.
y
),
b
.
uniform1f
(
N
.
rotation
,
$
.
rotation
),
b
.
uniform1f
(
N
.
opacity
,
$
.
opacity
),
b
.
uniform3f
(
N
.
color
,
i
);
b
.
drawElements
(
b
.
TRIANGLES
,
6
,
b
.
UNSIGNED_SHORT
,
0
);
X
.
positionScreen
.
copy
(
L
);
X
.
customUpdateCallback
?
X
.
customUpdateCallback
(
X
):
X
.
updateLensFlares
();
b
.
uniform1i
(
N
.
renderType
,
2
);
b
.
enable
(
b
.
BLEND
);
for
(
oa
=
0
,
ka
=
X
.
lensFlares
.
length
;
oa
<
ka
;
oa
++
)
if
(
$
=
X
.
lensFlares
[
oa
],
0.001
<
$
.
opacity
&&
0.001
<
$
.
scale
)
L
.
x
=
$
.
x
,
L
.
y
=
$
.
y
,
L
.
z
=
$
.
z
,
B
=
$
.
size
*
$
.
scale
/
y
,
E
.
x
=
B
*
A
,
E
.
y
=
B
,
b
.
uniform3f
(
N
.
screenPosition
,
L
.
x
,
L
.
y
,
L
.
z
),
b
.
uniform2f
(
N
.
scale
,
E
.
x
,
E
.
y
),
b
.
uniform1f
(
N
.
rotation
,
$
.
rotation
),
b
.
uniform1f
(
N
.
opacity
,
$
.
opacity
),
b
.
uniform3f
(
N
.
color
,
$
.
color
.
r
,
$
.
color
.
g
,
$
.
color
.
b
),
c
.
setBlending
(
$
.
blending
),
c
.
setTexture
(
$
.
texture
,
1
),
b
.
drawElements
(
b
.
TRIANGLES
,
6
,
b
.
UNSIGNED_SHORT
,
0
)}
b
.
enable
(
b
.
CULL_FACE
);
b
.
enable
(
b
.
DEPTH_TEST
);
b
.
depthMask
(
!
0
)}}};
THREE
.
ShadowMapPlugin
=
function
(){
var
a
,
b
,
c
,
d
,
e
=
new
THREE
.
Frustum
,
g
=
new
THREE
.
Matrix4
,
h
=
new
THREE
.
Vector3
,
i
=
new
THREE
.
Vector3
;
this
.
init
=
function
(
e
){
a
=
e
.
context
;
b
=
e
;
var
e
=
THREE
.
ShaderLib
.
depthRGBA
,
g
=
THREE
.
UniformsUtils
.
clone
(
e
.
uniforms
);
c
=
new
THREE
.
ShaderMaterial
({
fragmentShader
:
e
.
fragmentShader
,
vertexShader
:
e
.
vertexShader
,
uniforms
:
g
});
d
=
new
THREE
.
ShaderMaterial
({
fragmentShader
:
e
.
fragmentShader
,
vertexShader
:
e
.
vertexShader
,
uniforms
:
g
,
morphTargets
:
!
0
});
c
.
_shadowPass
=!
0
;
d
.
_shadowPass
=!
0
};
this
.
render
=
function
(
a
,
c
){
b
.
shadowMapEnabled
&&
b
.
shadowMapAutoUpdate
&&
this
.
update
(
a
,
c
)};
this
.
update
=
function
(
k
,
l
){
var
j
,
n
,
m
,
q
,
r
,
o
,
p
,
y
,
u
,
K
=
[];
q
=
0
;
a
.
clearColor
(
1
,
1
,
1
,
1
);
a
.
disable
(
a
.
BLEND
);
b
.
shadowMapCullFrontFaces
&&
a
.
cullFace
(
a
.
FRONT
);
b
.
setDepthTest
(
!
0
);
for
(
j
=
0
,
n
=
k
.
lights
.
length
;
j
<
n
;
j
++
)
if
(
m
=
k
.
lights
[
j
],
m
.
castShadow
)
if
(
m
instanceof
THREE
.
DirectionalLight
&&
m
.
shadowCascade
)
for
(
r
=
0
;
r
<
m
.
shadowCascadeCount
;
r
++
){
var
A
;
if
(
m
.
shadowCascadeArray
[
r
])
A
=
m
.
shadowCascadeArray
[
r
];
else
{
u
=
m
;
p
=
r
;
A
=
new
THREE
.
DirectionalLight
;
A
.
isVirtual
=!
0
;
A
.
onlyShadow
=
...
...
src/extras/loaders/ColladaLoader.js
浏览文件 @
448e5075
...
...
@@ -118,7 +118,7 @@ THREE.ColladaLoader = function () {
var
parts
=
url
.
split
(
'
/
'
);
parts
.
pop
();
baseUrl
=
parts
.
length
<
1
?
''
:
parts
.
join
(
'
/
'
)
+
'
/
'
;
baseUrl
=
parts
.
length
<
1
?
'
.
'
:
parts
.
join
(
'
/
'
)
+
'
/
'
;
}
...
...
src/extras/loaders/JSONLoader.js
浏览文件 @
448e5075
...
...
@@ -17,18 +17,6 @@ THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
var
worker
,
scope
=
this
;
if
(
url
instanceof
Object
)
{
console
.
warn
(
'
DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath ).
'
);
var
parameters
=
url
;
url
=
parameters
.
model
;
callback
=
parameters
.
callback
;
texturePath
=
parameters
.
texture_path
;
}
texturePath
=
texturePath
?
texturePath
:
this
.
extractUrlbase
(
url
);
this
.
onLoadStart
();
...
...
@@ -36,13 +24,13 @@ THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
};
THREE
.
JSONLoader
.
prototype
.
loadAjaxJSON
=
function
(
context
,
url
,
callback
,
texturePath
,
callbackProgress
)
{
THREE
.
JSONLoader
.
prototype
.
loadAjaxJSON
=
function
(
context
,
url
,
callback
,
texturePath
,
callbackProgress
)
{
var
xhr
=
new
XMLHttpRequest
();
var
length
=
0
;
xhr
.
onreadystatechange
=
function
()
{
xhr
.
onreadystatechange
=
function
()
{
if
(
xhr
.
readyState
===
xhr
.
DONE
)
{
...
...
@@ -68,7 +56,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
}
if
(
json
)
context
.
createModel
(
json
,
callback
,
texturePath
);
if
(
json
)
context
.
createModel
(
json
,
callback
,
texturePath
);
// in context of more complex asset initialization
// do not block on single failed file
...
...
@@ -111,13 +99,13 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
};
THREE
.
JSONLoader
.
prototype
.
createModel
=
function
(
json
,
callback
,
texture
_p
ath
)
{
THREE
.
JSONLoader
.
prototype
.
createModel
=
function
(
json
,
callback
,
texture
P
ath
)
{
var
scope
=
this
,
geometry
=
new
THREE
.
Geometry
(),
scale
=
(
json
.
scale
!==
undefined
)
?
1.0
/
json
.
scale
:
1.0
;
this
.
initMaterials
(
geometry
,
json
.
materials
,
texture
_p
ath
);
this
.
initMaterials
(
geometry
,
json
.
materials
,
texture
P
ath
);
parseModel
(
scale
);
...
...
src/extras/loaders/Loader.js
浏览文件 @
448e5075
...
...
@@ -63,17 +63,17 @@ THREE.Loader.prototype = {
var
parts
=
url
.
split
(
'
/
'
);
parts
.
pop
();
return
parts
.
length
<
1
?
''
:
parts
.
join
(
'
/
'
)
+
'
/
'
;
return
parts
.
length
<
1
?
'
.
'
:
parts
.
join
(
'
/
'
)
+
'
/
'
;
},
initMaterials
:
function
(
scope
,
materials
,
texture
_p
ath
)
{
initMaterials
:
function
(
scope
,
materials
,
texture
P
ath
)
{
scope
.
materials
=
[];
for
(
var
i
=
0
;
i
<
materials
.
length
;
++
i
)
{
scope
.
materials
[
i
]
=
THREE
.
Loader
.
prototype
.
createMaterial
(
materials
[
i
],
texture
_p
ath
);
scope
.
materials
[
i
]
=
THREE
.
Loader
.
prototype
.
createMaterial
(
materials
[
i
],
texture
P
ath
);
}
...
...
@@ -95,7 +95,7 @@ THREE.Loader.prototype = {
},
createMaterial
:
function
(
m
,
texture
_p
ath
)
{
createMaterial
:
function
(
m
,
texture
P
ath
)
{
var
_this
=
this
;
...
...
@@ -175,7 +175,7 @@ THREE.Loader.prototype = {
}
load_image
(
where
[
name
],
texture
_p
ath
+
"
/
"
+
sourceFile
);
load_image
(
where
[
name
],
texture
P
ath
+
"
/
"
+
sourceFile
);
}
...
...
@@ -273,25 +273,25 @@ THREE.Loader.prototype = {
// textures
if
(
m
.
mapDiffuse
&&
texture
_p
ath
)
{
if
(
m
.
mapDiffuse
&&
texture
P
ath
)
{
create_texture
(
mpars
,
"
map
"
,
m
.
mapDiffuse
,
m
.
mapDiffuseRepeat
,
m
.
mapDiffuseOffset
,
m
.
mapDiffuseWrap
);
}
if
(
m
.
mapLight
&&
texture
_p
ath
)
{
if
(
m
.
mapLight
&&
texture
P
ath
)
{
create_texture
(
mpars
,
"
lightMap
"
,
m
.
mapLight
,
m
.
mapLightRepeat
,
m
.
mapLightOffset
,
m
.
mapLightWrap
);
}
if
(
m
.
mapNormal
&&
texture
_p
ath
)
{
if
(
m
.
mapNormal
&&
texture
P
ath
)
{
create_texture
(
mpars
,
"
normalMap
"
,
m
.
mapNormal
,
m
.
mapNormalRepeat
,
m
.
mapNormalOffset
,
m
.
mapNormalWrap
);
}
if
(
m
.
mapSpecular
&&
texture
_p
ath
)
{
if
(
m
.
mapSpecular
&&
texture
P
ath
)
{
create_texture
(
mpars
,
"
specularMap
"
,
m
.
mapSpecular
,
m
.
mapSpecularRepeat
,
m
.
mapSpecularOffset
,
m
.
mapSpecularWrap
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录