Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
66cd1198
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,体验更适合开发者的 AI 搜索 >>
提交
66cd1198
编写于
3月 03, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated examples and utils that used Cube().
上级
eea0ee67
变更
15
展开全部
显示空白变更内容
内联
并排
Showing
15 changed file
with
291 addition
and
292 deletion
+291
-292
build/Three.js
build/Three.js
+205
-205
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
+66
-66
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
examples/canvas_geometry_cube.html
examples/canvas_geometry_cube.html
+2
-2
examples/canvas_geometry_panorama.html
examples/canvas_geometry_panorama.html
+1
-1
examples/canvas_geometry_panorama_fisheye.html
examples/canvas_geometry_panorama_fisheye.html
+1
-1
examples/webgl_geometry_minecraft.html
examples/webgl_geometry_minecraft.html
+1
-1
examples/webgl_geometry_minecraft_ao.html
examples/webgl_geometry_minecraft_ao.html
+1
-1
examples/webgl_lod.html
examples/webgl_lod.html
+4
-5
examples/webgl_shader2.html
examples/webgl_shader2.html
+1
-1
src/extras/SceneUtils.js
src/extras/SceneUtils.js
+1
-1
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+4
-4
未找到文件。
build/Three.js
浏览文件 @
66cd1198
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
66cd1198
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
e
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
e
);
e
=
Math
.
sin
(
-
e
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
a
*
b
,
j
=
d
*
e
;
this
.
w
=
g
*
f
-
j
*
c
;
this
.
x
=
g
*
c
+
j
*
f
;
this
.
y
=
d
*
b
*
f
+
a
*
e
*
c
;
this
.
z
=
a
*
e
*
f
-
d
*
b
*
c
;
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
*=
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
e
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
e
);
e
=
Math
.
sin
(
-
e
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
a
*
b
,
j
=
d
*
e
;
this
.
w
=
g
*
f
-
j
*
c
;
this
.
x
=
g
*
c
+
j
*
f
;
this
.
y
=
d
*
b
*
f
+
a
*
e
*
c
;
this
.
z
=
a
*
e
*
f
-
d
*
b
*
c
;
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
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
},
-
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
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
},
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
,
h
=
this
.
w
,
i
=
h
*
c
+
g
*
e
-
j
*
d
,
n
=
h
*
d
+
j
*
c
-
f
*
e
,
m
=
h
*
e
+
f
*
d
-
g
*
c
;
c
=-
f
*
c
-
g
*
d
-
j
*
e
;
b
.
x
=
i
*
h
+
c
*-
f
+
n
*-
j
-
m
*-
g
;
b
.
y
=
n
*
h
+
c
*-
g
+
m
*-
f
-
i
*-
j
;
b
.
z
=
m
*
h
+
c
*-
j
+
i
*-
g
-
n
*-
f
;
return
b
}};
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
,
h
=
this
.
w
,
i
=
h
*
c
+
g
*
e
-
j
*
d
,
n
=
h
*
d
+
j
*
c
-
f
*
e
,
m
=
h
*
e
+
f
*
d
-
g
*
c
;
c
=-
f
*
c
-
g
*
d
-
j
*
e
;
b
.
x
=
i
*
h
+
c
*-
f
+
n
*-
j
-
m
*-
g
;
b
.
y
=
n
*
h
+
c
*-
g
+
m
*-
f
-
i
*-
j
;
b
.
z
=
m
*
h
+
c
*-
j
+
i
*-
g
-
n
*-
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
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
f
=
Math
.
acos
(
e
),
g
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
g
)
<
0.001
0
){
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
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
f
)
/
g
;
d
=
Math
.
sin
(
d
*
f
)
/
g
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
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
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
f
=
Math
.
acos
(
e
),
g
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
g
)
<
0.001
){
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
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
f
)
/
g
;
d
=
Math
.
sin
(
d
*
f
)
/
g
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
faces
=
[];
this
.
uvs
=
[];
this
.
uvs2
=
[];
this
.
colors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
faces
=
[];
this
.
uvs
=
[];
this
.
uvs2
=
[];
this
.
colors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
build/custom/ThreeDOM.js
浏览文件 @
66cd1198
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
e
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
e
);
e
=
Math
.
sin
(
-
e
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
a
*
b
,
i
=
d
*
e
;
this
.
w
=
g
*
f
-
i
*
c
;
this
.
x
=
g
*
c
+
i
*
f
;
this
.
y
=
d
*
b
*
f
+
a
*
e
*
c
;
this
.
z
=
a
*
e
*
f
-
d
*
b
*
c
;
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
*=
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
e
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
e
);
e
=
Math
.
sin
(
-
e
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
a
*
b
,
i
=
d
*
e
;
this
.
w
=
g
*
f
-
i
*
c
;
this
.
x
=
g
*
c
+
i
*
f
;
this
.
y
=
d
*
b
*
f
+
a
*
e
*
c
;
this
.
z
=
a
*
e
*
f
-
d
*
b
*
c
;
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
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
},
-
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
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
},
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
,
h
=
this
.
w
,
j
=
h
*
c
+
g
*
e
-
i
*
d
,
n
=
h
*
d
+
i
*
c
-
f
*
e
,
l
=
h
*
e
+
f
*
d
-
g
*
c
;
c
=-
f
*
c
-
g
*
d
-
i
*
e
;
b
.
x
=
j
*
h
+
c
*-
f
+
n
*-
i
-
l
*-
g
;
b
.
y
=
n
*
h
+
c
*-
g
+
l
*-
f
-
j
*-
i
;
b
.
z
=
l
*
h
+
c
*-
i
+
j
*-
g
-
n
*-
f
;
return
b
}};
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
,
h
=
this
.
w
,
j
=
h
*
c
+
g
*
e
-
i
*
d
,
n
=
h
*
d
+
i
*
c
-
f
*
e
,
l
=
h
*
e
+
f
*
d
-
g
*
c
;
c
=-
f
*
c
-
g
*
d
-
i
*
e
;
b
.
x
=
j
*
h
+
c
*-
f
+
n
*-
i
-
l
*-
g
;
b
.
y
=
n
*
h
+
c
*-
g
+
l
*-
f
-
j
*-
i
;
b
.
z
=
l
*
h
+
c
*-
i
+
j
*-
g
-
n
*-
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
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
f
=
Math
.
acos
(
e
),
g
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
g
)
<
0.001
0
){
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
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
f
)
/
g
;
d
=
Math
.
sin
(
d
*
f
)
/
g
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
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
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
f
=
Math
.
acos
(
e
),
g
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
g
)
<
0.001
){
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
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
f
)
/
g
;
d
=
Math
.
sin
(
d
*
f
)
/
g
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
...
...
build/custom/ThreeExtras.js
浏览文件 @
66cd1198
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
66cd1198
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
e
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
e
);
e
=
Math
.
sin
(
-
e
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
a
*
b
,
i
=
d
*
e
;
this
.
w
=
g
*
f
-
i
*
c
;
this
.
x
=
g
*
c
+
i
*
f
;
this
.
y
=
d
*
b
*
f
+
a
*
e
*
c
;
this
.
z
=
a
*
e
*
f
-
d
*
b
*
c
;
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
*=
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
e
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
e
);
e
=
Math
.
sin
(
-
e
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
a
*
b
,
i
=
d
*
e
;
this
.
w
=
g
*
f
-
i
*
c
;
this
.
x
=
g
*
c
+
i
*
f
;
this
.
y
=
d
*
b
*
f
+
a
*
e
*
c
;
this
.
z
=
a
*
e
*
f
-
d
*
b
*
c
;
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
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
},
-
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
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
},
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
,
h
=
this
.
w
,
l
=
h
*
c
+
g
*
e
-
i
*
d
,
n
=
h
*
d
+
i
*
c
-
f
*
e
,
m
=
h
*
e
+
f
*
d
-
g
*
c
;
c
=-
f
*
c
-
g
*
d
-
i
*
e
;
b
.
x
=
l
*
h
+
c
*-
f
+
n
*-
i
-
m
*-
g
;
b
.
y
=
n
*
h
+
c
*-
g
+
m
*-
f
-
l
*-
i
;
b
.
z
=
m
*
h
+
c
*-
i
+
l
*-
g
-
n
*-
f
;
return
b
}};
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
,
h
=
this
.
w
,
l
=
h
*
c
+
g
*
e
-
i
*
d
,
n
=
h
*
d
+
i
*
c
-
f
*
e
,
m
=
h
*
e
+
f
*
d
-
g
*
c
;
c
=-
f
*
c
-
g
*
d
-
i
*
e
;
b
.
x
=
l
*
h
+
c
*-
f
+
n
*-
i
-
m
*-
g
;
b
.
y
=
n
*
h
+
c
*-
g
+
m
*-
f
-
l
*-
i
;
b
.
z
=
m
*
h
+
c
*-
i
+
l
*-
g
-
n
*-
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
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
f
=
Math
.
acos
(
e
),
g
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
g
)
<
0.001
0
){
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
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
f
)
/
g
;
d
=
Math
.
sin
(
d
*
f
)
/
g
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
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
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
f
=
Math
.
acos
(
e
),
g
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
g
)
<
0.001
){
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
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
f
)
/
g
;
d
=
Math
.
sin
(
d
*
f
)
/
g
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
faces
=
[];
this
.
uvs
=
[];
this
.
uvs2
=
[];
this
.
colors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
faces
=
[];
this
.
uvs
=
[];
this
.
uvs2
=
[];
this
.
colors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
66cd1198
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,d,e){this.set(a||0
...
@@ -49,7 +49,7 @@ THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,d,e){this.set(a||0
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
d
,
e
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
d
;
this
.
w
=
e
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
d
=
a
.
x
*
b
,
e
=
a
.
y
*
b
,
h
=
a
.
z
*
b
;
a
=
Math
.
cos
(
e
);
e
=
Math
.
sin
(
e
);
b
=
Math
.
cos
(
-
h
);
h
=
Math
.
sin
(
-
h
);
var
m
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
var
k
=
a
*
b
,
o
=
e
*
h
;
this
.
w
=
k
*
m
-
o
*
d
;
this
.
x
=
k
*
d
+
o
*
m
;
this
.
y
=
e
*
b
*
m
+
a
*
h
*
d
;
this
.
z
=
a
*
h
*
m
-
e
*
b
*
d
;
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
*=
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
d
,
e
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
d
;
this
.
w
=
e
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
d
=
a
.
x
*
b
,
e
=
a
.
y
*
b
,
h
=
a
.
z
*
b
;
a
=
Math
.
cos
(
e
);
e
=
Math
.
sin
(
e
);
b
=
Math
.
cos
(
-
h
);
h
=
Math
.
sin
(
-
h
);
var
m
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
var
k
=
a
*
b
,
o
=
e
*
h
;
this
.
w
=
k
*
m
-
o
*
d
;
this
.
x
=
k
*
d
+
o
*
m
;
this
.
y
=
e
*
b
*
m
+
a
*
h
*
d
;
this
.
z
=
a
*
h
*
m
-
e
*
b
*
d
;
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
a
=
1
/
a
;
this
.
x
*=
a
;
this
.
y
*=
a
;
this
.
z
*=
a
;
this
.
w
*=
a
}
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
d
=
this
.
y
,
e
=
this
.
z
,
h
=
this
.
w
,
m
=
a
.
x
,
k
=
a
.
y
,
o
=
a
.
z
;
a
=
a
.
w
;
this
.
x
=
b
*
a
+
h
*
m
+
d
*
o
-
e
*
k
;
this
.
y
=
d
*
a
+
h
*
k
+
e
*
m
-
b
*
o
;
this
.
z
=
e
*
a
+
h
*
o
+
b
*
k
-
d
*
m
;
this
.
w
=
h
*
a
-
b
*
m
-
d
*
k
-
e
*
o
;
return
this
},
-
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
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
a
=
1
/
a
;
this
.
x
*=
a
;
this
.
y
*=
a
;
this
.
z
*=
a
;
this
.
w
*=
a
}
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
d
=
this
.
y
,
e
=
this
.
z
,
h
=
this
.
w
,
m
=
a
.
x
,
k
=
a
.
y
,
o
=
a
.
z
;
a
=
a
.
w
;
this
.
x
=
b
*
a
+
h
*
m
+
d
*
o
-
e
*
k
;
this
.
y
=
d
*
a
+
h
*
k
+
e
*
m
-
b
*
o
;
this
.
z
=
e
*
a
+
h
*
o
+
b
*
k
-
d
*
m
;
this
.
w
=
h
*
a
-
b
*
m
-
d
*
k
-
e
*
o
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
d
=
a
.
x
,
e
=
a
.
y
,
h
=
a
.
z
,
m
=
this
.
x
,
k
=
this
.
y
,
o
=
this
.
z
,
n
=
this
.
w
,
t
=
n
*
d
+
k
*
h
-
o
*
e
,
y
=
n
*
e
+
o
*
d
-
m
*
h
,
w
=
n
*
h
+
m
*
e
-
k
*
d
;
d
=-
m
*
d
-
k
*
e
-
o
*
h
;
b
.
x
=
t
*
n
+
d
*-
m
+
y
*-
o
-
w
*-
k
;
b
.
y
=
y
*
n
+
d
*-
k
+
w
*-
m
-
t
*-
o
;
b
.
z
=
w
*
n
+
d
*-
o
+
t
*-
k
-
y
*-
m
;
return
b
}};
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
d
=
a
.
x
,
e
=
a
.
y
,
h
=
a
.
z
,
m
=
this
.
x
,
k
=
this
.
y
,
o
=
this
.
z
,
n
=
this
.
w
,
t
=
n
*
d
+
k
*
h
-
o
*
e
,
y
=
n
*
e
+
o
*
d
-
m
*
h
,
w
=
n
*
h
+
m
*
e
-
k
*
d
;
d
=-
m
*
d
-
k
*
e
-
o
*
h
;
b
.
x
=
t
*
n
+
d
*-
m
+
y
*-
o
-
w
*-
k
;
b
.
y
=
y
*
n
+
d
*-
k
+
w
*-
m
-
t
*-
o
;
b
.
z
=
w
*
n
+
d
*-
o
+
t
*-
k
-
y
*-
m
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
d
,
e
){
var
h
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
h
)
>=
1
){
d
.
w
=
a
.
w
;
d
.
x
=
a
.
x
;
d
.
y
=
a
.
y
;
d
.
z
=
a
.
z
;
return
d
}
var
m
=
Math
.
acos
(
h
),
k
=
Math
.
sqrt
(
1
-
h
*
h
);
if
(
Math
.
abs
(
k
)
<
0.001
0
){
d
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
d
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
d
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
d
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
d
}
h
=
Math
.
sin
((
1
-
e
)
*
m
)
/
k
;
e
=
Math
.
sin
(
e
*
m
)
/
k
;
d
.
w
=
a
.
w
*
h
+
b
.
w
*
e
;
d
.
x
=
a
.
x
*
h
+
b
.
x
*
e
;
d
.
y
=
a
.
y
*
h
+
b
.
y
*
e
;
d
.
z
=
a
.
z
*
h
+
b
.
z
*
e
;
return
d
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
d
,
e
){
var
h
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
h
)
>=
1
){
d
.
w
=
a
.
w
;
d
.
x
=
a
.
x
;
d
.
y
=
a
.
y
;
d
.
z
=
a
.
z
;
return
d
}
var
m
=
Math
.
acos
(
h
),
k
=
Math
.
sqrt
(
1
-
h
*
h
);
if
(
Math
.
abs
(
k
)
<
0.001
){
d
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
d
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
d
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
d
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
d
}
h
=
Math
.
sin
((
1
-
e
)
*
m
)
/
k
;
e
=
Math
.
sin
(
e
*
m
)
/
k
;
d
.
w
=
a
.
w
*
h
+
b
.
w
*
e
;
d
.
x
=
a
.
x
*
h
+
b
.
x
*
e
;
d
.
y
=
a
.
y
*
h
+
b
.
y
*
e
;
d
.
z
=
a
.
z
*
h
+
b
.
z
*
e
;
return
d
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Face3
=
function
(
a
,
b
,
d
,
e
,
h
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
]};
THREE
.
Face4
=
function
(
a
,
b
,
d
,
e
,
h
,
m
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
d
;
this
.
d
=
e
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
h
instanceof
THREE
.
Vector3
?
h
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
h
instanceof
Array
?
h
:[];
this
.
materials
=
m
instanceof
Array
?
m
:[
m
]};
THREE
.
Face3
=
function
(
a
,
b
,
d
,
e
,
h
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
]};
THREE
.
Face4
=
function
(
a
,
b
,
d
,
e
,
h
,
m
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
d
;
this
.
d
=
e
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
h
instanceof
THREE
.
Vector3
?
h
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
h
instanceof
Array
?
h
:[];
this
.
materials
=
m
instanceof
Array
?
m
:[
m
]};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
faces
=
[];
this
.
uvs
=
[];
this
.
uvs2
=
[];
this
.
colors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
faces
=
[];
this
.
uvs
=
[];
this
.
uvs2
=
[];
this
.
colors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
examples/canvas_geometry_cube.html
浏览文件 @
66cd1198
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
}
}
cube
=
new
THREE
.
Mesh
(
new
Cube
(
200
,
200
,
200
,
1
,
1
,
materials
),
new
THREE
.
MeshFaceMaterial
()
);
cube
=
new
THREE
.
Mesh
(
new
Cube
(
200
,
200
,
200
,
1
,
1
,
1
,
materials
),
new
THREE
.
MeshFaceMaterial
()
);
cube
.
position
.
y
=
150
;
cube
.
position
.
y
=
150
;
cube
.
overdraw
=
true
;
cube
.
overdraw
=
true
;
scene
.
addObject
(
cube
);
scene
.
addObject
(
cube
);
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
// Plane
// Plane
plane
=
new
THREE
.
Mesh
(
new
Plane
(
200
,
200
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xe0e0e0
}
)
);
plane
=
new
THREE
.
Mesh
(
new
Plane
(
200
,
200
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xe0e0e0
}
)
);
plane
.
rotation
.
x
=
-
90
*
(
Math
.
PI
/
180
);
plane
.
rotation
.
x
=
-
90
*
(
Math
.
PI
/
180
);
plane
.
overdraw
=
true
;
plane
.
overdraw
=
true
;
scene
.
addObject
(
plane
);
scene
.
addObject
(
plane
);
...
...
examples/canvas_geometry_panorama.html
浏览文件 @
66cd1198
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
];
];
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
300
,
300
,
300
,
7
,
7
,
materials
,
true
),
new
THREE
.
MeshFaceMaterial
()
);
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
300
,
300
,
300
,
7
,
7
,
7
,
materials
,
true
),
new
THREE
.
MeshFaceMaterial
()
);
mesh
.
overdraw
=
true
;
mesh
.
overdraw
=
true
;
scene
.
addObject
(
mesh
);
scene
.
addObject
(
mesh
);
...
...
examples/canvas_geometry_panorama_fisheye.html
浏览文件 @
66cd1198
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
];
];
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
300
,
300
,
300
,
7
,
7
,
materials
,
true
),
new
THREE
.
MeshFaceMaterial
()
);
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
300
,
300
,
300
,
7
,
7
,
7
,
materials
,
true
),
new
THREE
.
MeshFaceMaterial
()
);
mesh
.
overdraw
=
true
;
mesh
.
overdraw
=
true
;
scene
.
addObject
(
mesh
);
scene
.
addObject
(
mesh
);
...
...
examples/webgl_geometry_minecraft.html
浏览文件 @
66cd1198
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
nx
=
(
i
&
4
)
==
4
;
nx
=
(
i
&
4
)
==
4
;
pz
=
(
i
&
2
)
==
2
;
pz
=
(
i
&
2
)
==
2
;
nz
=
(
i
&
1
)
==
1
;
nz
=
(
i
&
1
)
==
1
;
cubes
[
i
]
=
new
Cube
(
100
,
100
,
100
,
1
,
1
,
materials
,
false
,
{
px
:
px
,
nx
:
nx
,
py
:
true
,
ny
:
false
,
pz
:
pz
,
nz
:
nz
}
);
cubes
[
i
]
=
new
Cube
(
100
,
100
,
100
,
1
,
1
,
1
,
materials
,
false
,
{
px
:
px
,
nx
:
nx
,
py
:
true
,
ny
:
false
,
pz
:
pz
,
nz
:
nz
}
);
}
}
...
...
examples/webgl_geometry_minecraft_ao.html
浏览文件 @
66cd1198
...
@@ -368,7 +368,7 @@
...
@@ -368,7 +368,7 @@
sides
=
{
px
:
px
,
nx
:
nx
,
py
:
true
,
ny
:
false
,
pz
:
pz
,
nz
:
nz
};
sides
=
{
px
:
px
,
nx
:
nx
,
py
:
true
,
ny
:
false
,
pz
:
pz
,
nz
:
nz
};
cube
=
new
Cube
(
100
,
100
,
100
,
1
,
1
,
materials
,
false
,
sides
);
cube
=
new
Cube
(
100
,
100
,
100
,
1
,
1
,
1
,
materials
,
false
,
sides
);
// set UV tiles
// set UV tiles
...
...
examples/webgl_lod.html
浏览文件 @
66cd1198
...
@@ -87,11 +87,10 @@
...
@@ -87,11 +87,10 @@
];
];
var
geometry
=
[
var
geometry
=
[
[
new
Sphere
(
100
,
128
,
64
),
0
],
[
new
Sphere
(
100
,
64
,
32
),
300
],
[
new
Sphere
(
100
,
64
,
32
),
200
],
[
new
Sphere
(
100
,
32
,
16
),
1000
],
[
new
Sphere
(
100
,
32
,
16
),
400
],
[
new
Sphere
(
100
,
16
,
8
),
2000
],
[
new
Sphere
(
100
,
16
,
8
),
6000
],
[
new
Sphere
(
100
,
8
,
4
),
10000
]
[
new
Sphere
(
100
,
8
,
4
),
12000
]
];
];
var
i
,
j
,
mesh
,
lod
;
var
i
,
j
,
mesh
,
lod
;
...
...
examples/webgl_shader2.html
浏览文件 @
66cd1198
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
mlib
[
i
]
=
material
;
mlib
[
i
]
=
material
;
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
size
,
size
,
size
,
1
,
1
,
[
mlib
[
i
],
mlib
[
i
],
mlib
[
i
],
mlib
[
i
],
mlib
[
i
],
mlib
[
i
]
],
false
),
new
THREE
.
MeshFaceMaterial
()
);
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
size
,
size
,
size
,
1
,
1
,
1
,
[
mlib
[
i
],
mlib
[
i
],
mlib
[
i
],
mlib
[
i
],
mlib
[
i
],
mlib
[
i
]
],
false
),
new
THREE
.
MeshFaceMaterial
()
);
mesh
.
position
.
x
=
i
-
(
params
.
length
-
1
)
/
2
;
mesh
.
position
.
x
=
i
-
(
params
.
length
-
1
)
/
2
;
mesh
.
position
.
y
=
i
%
2
-
0.5
;
mesh
.
position
.
y
=
i
%
2
-
0.5
;
scene
.
addObject
(
mesh
);
scene
.
addObject
(
mesh
);
...
...
src/extras/SceneUtils.js
浏览文件 @
66cd1198
...
@@ -427,7 +427,7 @@ var SceneUtils = {
...
@@ -427,7 +427,7 @@ var SceneUtils = {
uniforms
:
shader
.
uniforms
uniforms
:
shader
.
uniforms
}
),
}
),
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
size
,
size
,
size
,
1
,
1
,
null
,
true
),
material
);
mesh
=
new
THREE
.
Mesh
(
new
Cube
(
size
,
size
,
size
,
1
,
1
,
1
,
null
,
true
),
material
);
scene
.
addObject
(
mesh
);
scene
.
addObject
(
mesh
);
return
mesh
;
return
mesh
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
66cd1198
...
@@ -2306,11 +2306,11 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -2306,11 +2306,11 @@ THREE.WebGLRenderer = function ( parameters ) {
geometry
.
__dirtyVertices
=
false
;
geometry
.
__dirtyVertices
=
false
;
geometry
.
__dirtyColors
=
false
;
geometry
.
__dirtyColors
=
false
;
}
else
if
(
THREE
.
MarchingCubes
!==
undefined
&&
object
instanceof
THREE
.
MarchingCubes
)
{
}
/*
else if ( THREE.MarchingCubes !== undefined && object instanceof THREE.MarchingCubes ) {
// it updates itself in render callback
// it updates itself in render callback
}
/*
else if ( object instanceof THREE.Particle ) {
}
else if ( object instanceof THREE.Particle ) {
}*/
}*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录