Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
efa7d446
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,发现更多精彩内容 >>
提交
efa7d446
编写于
1月 01, 2012
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
b28c4637
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
21 addition
and
21 deletion
+21
-21
build/Three.js
build/Three.js
+9
-9
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
+7
-7
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+2
-2
未找到文件。
build/Three.js
浏览文件 @
efa7d446
此差异已折叠。
点击以展开。
build/custom/ThreeCanvas.js
浏览文件 @
efa7d446
...
...
@@ -77,7 +77,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
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
,
i
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
f
+
c
*
i
-
d
*
g
;
this
.
y
=
c
*
a
+
e
*
g
+
d
*
f
-
b
*
i
;
this
.
z
=
d
*
a
+
e
*
i
+
b
*
g
-
c
*
f
;
this
.
w
=
e
*
a
-
b
*
f
-
c
*
g
-
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
,
f
=
this
.
x
,
g
=
this
.
y
,
i
=
this
.
z
,
m
=
this
.
w
,
h
=
m
*
c
+
g
*
e
-
i
*
d
,
l
=
m
*
d
+
i
*
c
-
f
*
e
,
o
=
m
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
i
*
e
;
b
.
x
=
h
*
m
+
c
*-
f
+
l
*-
i
-
o
*-
g
;
b
.
y
=
l
*
m
+
c
*-
g
+
o
*-
f
-
h
*-
i
;
b
.
z
=
o
*
m
+
c
*-
i
+
h
*-
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
>
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
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
.
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
.
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
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
u
=
a
||
0
;
this
.
v
=
b
||
0
};
THREE
.
UV
.
prototype
=
{
constructor
:
THREE
.
UV
,
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
u
=
a
.
u
;
this
.
v
=
a
.
v
;
return
this
},
clone
:
function
(){
return
new
THREE
.
UV
(
this
.
u
,
this
.
v
)}};
...
...
build/custom/ThreeDOM.js
浏览文件 @
efa7d446
...
...
@@ -77,7 +77,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
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
>
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
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
.
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
.
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
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
u
=
a
||
0
;
this
.
v
=
b
||
0
};
THREE
.
UV
.
prototype
=
{
constructor
:
THREE
.
UV
,
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
u
=
a
.
u
;
this
.
v
=
a
.
v
;
return
this
},
clone
:
function
(){
return
new
THREE
.
UV
(
this
.
u
,
this
.
v
)}};
...
...
build/custom/ThreeExtras.js
浏览文件 @
efa7d446
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
efa7d446
...
...
@@ -77,7 +77,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
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
,
j
=
l
*
c
+
g
*
e
-
h
*
d
,
i
=
l
*
d
+
h
*
c
-
f
*
e
,
m
=
l
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
h
*
e
;
b
.
x
=
j
*
l
+
c
*-
f
+
i
*-
h
-
m
*-
g
;
b
.
y
=
i
*
l
+
c
*-
g
+
m
*-
f
-
j
*-
h
;
b
.
z
=
m
*
l
+
c
*-
h
+
j
*-
g
-
i
*-
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
>
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
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
.
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
.
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
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
u
=
a
||
0
;
this
.
v
=
b
||
0
};
THREE
.
UV
.
prototype
=
{
constructor
:
THREE
.
UV
,
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
u
=
a
.
u
;
this
.
v
=
a
.
v
;
return
this
},
clone
:
function
(){
return
new
THREE
.
UV
(
this
.
u
,
this
.
v
)}};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
efa7d446
...
...
@@ -66,7 +66,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
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
>
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
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
.
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
.
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
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
u
=
a
||
0
;
this
.
v
=
b
||
0
};
THREE
.
UV
.
prototype
=
{
constructor
:
THREE
.
UV
,
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
u
=
a
.
u
;
this
.
v
=
a
.
v
;
return
this
},
clone
:
function
(){
return
new
THREE
.
UV
(
this
.
u
,
this
.
v
)}};
...
...
@@ -337,7 +337,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
"
);
o
=!
1
};
this
.
render
=
function
(
a
,
d
,
e
,
v
){
var
a
=
a
.
__webglFlares
,
F
=
a
.
length
;
if
(
F
){
var
A
=
new
THREE
.
Vector3
,
K
=
v
/
e
,
y
=
0.5
*
e
,
J
=
0.5
*
v
,
H
=
16
/
v
,
I
=
new
THREE
.
Vector2
(
H
*
K
,
H
),
M
=
new
THREE
.
Vector3
(
1
,
1
,
0
),
G
=
new
THREE
.
Vector2
(
1
,
1
),
L
=
m
,
H
=
n
;
b
.
useProgram
(
j
);
o
||
(
b
.
enableVertexAttribArray
(
n
.
vertex
),
b
.
enableVertexAttribArray
(
n
.
uv
),
o
=!
0
);
b
.
uniform1i
(
L
.
occlusionMap
,
0
);
b
.
uniform1i
(
L
.
map
,
1
);
b
.
bindBuffer
(
b
.
ARRAY_BUFFER
,
g
);
b
.
vertexAttribPointer
(
H
.
vertex
,
2
,
b
.
FLOAT
,
!
1
,
16
,
0
);
b
.
vertexAttribPointer
(
H
.
uv
,
2
,
b
.
FLOAT
,
!
1
,
16
,
8
);
b
.
bindBuffer
(
b
.
ELEMENT_ARRAY_BUFFER
,
h
);
b
.
disable
(
b
.
CULL_FACE
);
b
.
depthMask
(
!
1
);
var
ka
,
T
,
la
,
ca
,
z
;
for
(
ka
=
0
;
ka
<
F
;
ka
++
)
if
(
H
=
16
/
v
,
I
.
set
(
H
*
K
,
H
),
ca
=
a
[
ka
],
A
.
set
(
ca
.
matrixWorld
.
n14
,
ca
.
matrixWorld
.
n24
,
ca
.
matrixWorld
.
n34
),
d
.
matrixWorldInverse
.
multiplyVector3
(
A
),
d
.
projectionMatrix
.
multiplyVector3
(
A
),
M
.
copy
(
A
),
G
.
x
=
M
.
x
*
y
+
y
,
G
.
y
=
M
.
y
*
J
+
J
,
l
||
0
<
G
.
x
&&
G
.
x
<
e
&&
0
<
G
.
y
&&
G
.
y
<
v
){
b
.
activeTexture
(
b
.
TEXTURE1
);
b
.
bindTexture
(
b
.
TEXTURE_2D
,
i
);
b
.
copyTexImage2D
(
b
.
TEXTURE_2D
,
0
,
b
.
RGB
,
G
.
x
-
8
,
G
.
y
-
8
,
16
,
16
,
0
);
b
.
uniform1i
(
L
.
renderType
,
0
);
b
.
uniform2f
(
L
.
scale
,
I
.
x
,
I
.
y
);
b
.
uniform3f
(
L
.
screenPosition
,
M
.
x
,
M
.
y
,
M
.
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
,
G
.
x
-
8
,
G
.
y
-
8
,
16
,
16
,
0
);
b
.
uniform1i
(
L
.
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
);
ca
.
positionScreen
.
copy
(
M
);
ca
.
customUpdateCallback
?
ca
.
customUpdateCallback
(
ca
):
ca
.
updateLensFlares
();
b
.
uniform1i
(
L
.
renderType
,
2
);
b
.
enable
(
b
.
BLEND
);
for
(
T
=
0
,
la
=
ca
.
lensFlares
.
length
;
T
<
la
;
T
++
)
if
(
z
=
ca
.
lensFlares
[
T
],
0.001
<
z
.
opacity
&&
0.001
<
z
.
scale
)
M
.
x
=
z
.
x
,
M
.
y
=
z
.
y
,
M
.
z
=
z
.
z
,
H
=
z
.
size
*
z
.
scale
/
v
,
I
.
x
=
H
*
K
,
I
.
y
=
H
,
b
.
uniform3f
(
L
.
screenPosition
,
M
.
x
,
M
.
y
,
M
.
z
),
b
.
uniform2f
(
L
.
scale
,
I
.
x
,
I
.
y
),
b
.
uniform1f
(
L
.
rotation
,
z
.
rotation
),
b
.
uniform1f
(
L
.
opacity
,
z
.
opacity
),
b
.
uniform3f
(
L
.
color
,
i
);
b
.
drawElements
(
b
.
TRIANGLES
,
6
,
b
.
UNSIGNED_SHORT
,
0
);
ca
.
positionScreen
.
copy
(
M
);
ca
.
customUpdateCallback
?
ca
.
customUpdateCallback
(
ca
):
ca
.
updateLensFlares
();
b
.
uniform1i
(
L
.
renderType
,
2
);
b
.
enable
(
b
.
BLEND
);
for
(
T
=
0
,
la
=
ca
.
lensFlares
.
length
;
T
<
la
;
T
++
)
if
(
z
=
ca
.
lensFlares
[
T
],
0.001
0
<
z
.
opacity
&&
0.0010
<
z
.
scale
)
M
.
x
=
z
.
x
,
M
.
y
=
z
.
y
,
M
.
z
=
z
.
z
,
H
=
z
.
size
*
z
.
scale
/
v
,
I
.
x
=
H
*
K
,
I
.
y
=
H
,
b
.
uniform3f
(
L
.
screenPosition
,
M
.
x
,
M
.
y
,
M
.
z
),
b
.
uniform2f
(
L
.
scale
,
I
.
x
,
I
.
y
),
b
.
uniform1f
(
L
.
rotation
,
z
.
rotation
),
b
.
uniform1f
(
L
.
opacity
,
z
.
opacity
),
b
.
uniform3f
(
L
.
color
,
z
.
color
.
r
,
z
.
color
.
g
,
z
.
color
.
b
),
c
.
setBlending
(
z
.
blending
),
c
.
setTexture
(
z
.
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
,
g
=
new
THREE
.
Frustum
,
h
=
new
THREE
.
Matrix4
;
this
.
shadowMatrix
=
[];
this
.
shadowMap
=
[];
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
(
i
){
var
k
,
l
,
j
,
n
,
m
,
o
,
p
,
r
,
t
=
0
,
v
=
i
.
lights
;
e
||
(
e
=
new
THREE
.
PerspectiveCamera
(
b
.
shadowCameraFov
,
b
.
shadowMapWidth
/
b
.
shadowMapHeight
,
b
.
shadowCameraNear
,
b
.
shadowCameraFar
));
for
(
k
=
0
,
l
=
v
.
length
;
k
<
l
;
k
++
)
if
(
p
=
v
[
k
],
p
.
castShadow
&&
p
instanceof
THREE
.
SpotLight
){
this
.
shadowMap
[
t
]
||
(
this
.
shadowMap
[
t
]
=
new
THREE
.
WebGLRenderTarget
(
b
.
shadowMapWidth
,
b
.
shadowMapHeight
,{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录