Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
cd338249
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,发现更多精彩内容 >>
提交
cd338249
编写于
11月 22, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'alteredq/dev' into dev
上级
8749fe04
43036191
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
82 addition
and
61 deletion
+82
-61
build/Three.js
build/Three.js
+35
-34
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
+6
-6
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+17
-16
src/objects/ParticleSystem.js
src/objects/ParticleSystem.js
+16
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+5
-2
未找到文件。
build/Three.js
浏览文件 @
cd338249
此差异已折叠。
点击以展开。
build/custom/ThreeCanvas.js
浏览文件 @
cd338249
...
...
@@ -76,7 +76,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
);
a
===
0
?
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
,
j
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
f
+
c
*
j
-
d
*
g
;
this
.
y
=
c
*
a
+
e
*
g
+
d
*
f
-
b
*
j
;
this
.
z
=
d
*
a
+
e
*
j
+
b
*
g
-
c
*
f
;
this
.
w
=
e
*
a
-
b
*
f
-
c
*
g
-
d
*
j
;
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
,
j
=
this
.
z
,
n
=
this
.
w
,
k
=
n
*
c
+
g
*
e
-
j
*
d
,
l
=
n
*
d
+
j
*
c
-
f
*
e
,
h
=
n
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
j
*
e
;
b
.
x
=
k
*
n
+
c
*-
f
+
l
*-
j
-
h
*-
g
;
b
.
y
=
l
*
n
+
c
*-
g
+
h
*-
f
-
k
*-
j
;
b
.
z
=
h
*
n
+
c
*-
j
+
k
*-
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
;
e
<
0
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
Math
.
abs
(
e
)
>=
1
)
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
(
Math
.
abs
(
e
)
<
0.001
)
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
;
e
<
0
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
Math
.
abs
(
e
)
>=
1
)
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
(
Math
.
abs
(
e
)
<
0.001
0
)
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
浏览文件 @
cd338249
...
...
@@ -76,7 +76,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
);
a
===
0
?
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
,
k
=
l
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
h
*
e
;
b
.
x
=
i
*
l
+
c
*-
f
+
j
*-
h
-
k
*-
g
;
b
.
y
=
j
*
l
+
c
*-
g
+
k
*-
f
-
i
*-
h
;
b
.
z
=
k
*
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
;
e
<
0
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
Math
.
abs
(
e
)
>=
1
)
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
(
Math
.
abs
(
e
)
<
0.001
)
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
;
e
<
0
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
Math
.
abs
(
e
)
>=
1
)
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
(
Math
.
abs
(
e
)
<
0.001
0
)
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
浏览文件 @
cd338249
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
cd338249
...
...
@@ -76,7 +76,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
);
a
===
0
?
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
,
k
=
l
*
d
+
h
*
c
-
f
*
e
,
j
=
l
*
e
+
f
*
d
-
g
*
c
,
c
=-
f
*
c
-
g
*
d
-
h
*
e
;
b
.
x
=
i
*
l
+
c
*-
f
+
k
*-
h
-
j
*-
g
;
b
.
y
=
k
*
l
+
c
*-
g
+
j
*-
f
-
i
*-
h
;
b
.
z
=
j
*
l
+
c
*-
h
+
i
*-
g
-
k
*-
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
;
e
<
0
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
Math
.
abs
(
e
)
>=
1
)
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
(
Math
.
abs
(
e
)
<
0.001
)
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
;
e
<
0
?(
c
.
w
=-
b
.
w
,
c
.
x
=-
b
.
x
,
c
.
y
=-
b
.
y
,
c
.
z
=-
b
.
z
,
e
=-
e
):
c
.
copy
(
b
);
if
(
Math
.
abs
(
e
)
>=
1
)
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
(
Math
.
abs
(
e
)
<
0.001
0
)
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
浏览文件 @
cd338249
此差异已折叠。
点击以展开。
src/objects/ParticleSystem.js
浏览文件 @
cd338249
...
...
@@ -11,6 +11,22 @@ THREE.ParticleSystem = function ( geometry, material ) {
this
.
sortParticles
=
false
;
if
(
this
.
geometry
)
{
// calc bound radius
if
(
!
this
.
geometry
.
boundingSphere
)
{
this
.
geometry
.
computeBoundingSphere
();
}
this
.
boundRadius
=
geometry
.
boundingSphere
.
radius
;
}
this
.
frustumCulled
=
false
;
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
();
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
cd338249
...
...
@@ -88,7 +88,8 @@ THREE.WebGLRenderer = function ( parameters ) {
calls
:
0
,
vertices
:
0
,
faces
:
0
faces
:
0
,
points
:
0
}
...
...
@@ -2897,6 +2898,7 @@ THREE.WebGLRenderer = function ( parameters ) {
_gl
.
drawArrays
(
_gl
.
POINTS
,
0
,
geometryGroup
.
__webglParticleCount
);
_this
.
info
.
render
.
calls
++
;
_this
.
info
.
render
.
points
+=
geometryGroup
.
__webglParticleCount
;
// render ribbon
...
...
@@ -3039,6 +3041,7 @@ THREE.WebGLRenderer = function ( parameters ) {
_this
.
info
.
render
.
calls
=
0
;
_this
.
info
.
render
.
vertices
=
0
;
_this
.
info
.
render
.
faces
=
0
;
_this
.
info
.
render
.
points
=
0
;
camera
.
matrixWorldInverse
.
getInverse
(
camera
.
matrixWorld
);
...
...
@@ -3072,7 +3075,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
object
.
visible
)
{
if
(
!
(
object
instanceof
THREE
.
Mesh
)
||
!
(
object
.
frustumCulled
)
||
_frustum
.
contains
(
object
)
)
{
if
(
!
(
object
instanceof
THREE
.
Mesh
||
object
instanceof
THREE
.
ParticleSystem
)
||
!
(
object
.
frustumCulled
)
||
_frustum
.
contains
(
object
)
)
{
object
.
matrixWorld
.
flattenToArray
(
object
.
_objectMatrixArray
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录