Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
3b6b3dc5
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
3b6b3dc5
编写于
3月 21, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Made more examples working.
上级
044a27b5
变更
27
展开全部
隐藏空白更改
内联
并排
Showing
27 changed file
with
680 addition
and
554 deletion
+680
-554
build/Three.js
build/Three.js
+256
-253
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+44
-44
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+13
-13
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+79
-78
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+38
-38
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+77
-77
examples/misc_lights_test.html
examples/misc_lights_test.html
+5
-3
examples/misc_materials_multimaterials.html
examples/misc_materials_multimaterials.html
+4
-3
examples/webgl_geometry_dynamic.html
examples/webgl_geometry_dynamic.html
+2
-2
examples/webgl_lights_pointlights.html
examples/webgl_lights_pointlights.html
+4
-3
examples/webgl_materials_cars.html
examples/webgl_materials_cars.html
+3
-3
examples/webgl_materials_cars_camaro.html
examples/webgl_materials_cars_camaro.html
+2
-2
examples/webgl_materials_cubemap.html
examples/webgl_materials_cubemap.html
+2
-2
examples/webgl_materials_cubemap_refraction.html
examples/webgl_materials_cubemap_refraction.html
+2
-2
examples/webgl_materials_normalmap.html
examples/webgl_materials_normalmap.html
+1
-1
examples/webgl_materials_normalmap2.html
examples/webgl_materials_normalmap2.html
+86
-2
examples/webgl_materials_shaders.html
examples/webgl_materials_shaders.html
+5
-3
examples/webgl_materials_texture_filters.html
examples/webgl_materials_texture_filters.html
+4
-4
examples/webgl_materials_video.html
examples/webgl_materials_video.html
+2
-2
examples/webgl_morphtargets.html
examples/webgl_morphtargets.html
+1
-1
examples/webgl_objconvert_test.html
examples/webgl_objconvert_test.html
+3
-2
examples/webgl_postprocessing.html
examples/webgl_postprocessing.html
+2
-2
examples/webgl_rtt.html
examples/webgl_rtt.html
+2
-2
src/extras/SceneUtils.js
src/extras/SceneUtils.js
+9
-8
src/extras/io/BinaryLoader.js
src/extras/io/BinaryLoader.js
+4
-2
src/extras/io/JSONLoader.js
src/extras/io/JSONLoader.js
+28
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+2
-2
未找到文件。
build/Three.js
浏览文件 @
3b6b3dc5
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
3b6b3dc5
此差异已折叠。
点击以展开。
build/custom/ThreeDOM.js
浏览文件 @
3b6b3dc5
...
...
@@ -12,7 +12,7 @@ this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPosit
1.0
E
-
4
&&
Math
.
abs
(
this
.
z
)
<
1.0
E
-
4
},
clone
:
function
(){
return
new
THREE
.
Vector3
(
this
.
x
,
this
.
y
,
this
.
z
)}};
THREE
.
Vector4
=
function
(
a
,
b
,
c
,
e
){
this
.
set
(
a
||
0
,
b
||
0
,
c
||
0
,
e
||
1
)};
THREE
.
Vector4
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
e
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
e
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
x
,
a
.
y
,
a
.
z
,
a
.
w
||
1
);
return
this
},
add
:
function
(
a
,
b
){
this
.
set
(
a
.
x
+
b
.
x
,
a
.
y
+
b
.
y
,
a
.
z
+
b
.
z
,
a
.
w
+
b
.
w
);
return
this
},
addSelf
:
function
(
a
){
this
.
set
(
this
.
x
+
a
.
x
,
this
.
y
+
a
.
y
,
this
.
z
+
a
.
z
,
this
.
w
+
a
.
w
);
return
this
},
sub
:
function
(
a
,
b
){
this
.
set
(
a
.
x
-
b
.
x
,
a
.
y
-
b
.
y
,
a
.
z
-
b
.
z
,
a
.
w
-
b
.
w
);
return
this
},
subSelf
:
function
(
a
){
this
.
set
(
this
.
x
-
a
.
x
,
this
.
y
-
a
.
y
,
this
.
z
-
a
.
z
,
this
.
w
-
a
.
w
);
return
this
},
multiplyScalar
:
function
(
a
){
this
.
set
(
this
.
x
*
a
,
this
.
y
*
a
,
this
.
z
*
a
,
this
.
w
*
a
);
return
this
},
divideScalar
:
function
(
a
){
this
.
set
(
this
.
x
/
a
,
this
.
y
/
a
,
this
.
z
/
a
,
this
.
w
/
a
);
return
this
},
lerpSelf
:
function
(
a
,
b
){
this
.
set
(
this
.
x
+
(
a
.
x
-
this
.
x
)
*
b
,
this
.
y
+
(
a
.
y
-
this
.
y
)
*
b
,
this
.
z
+
(
a
.
z
-
this
.
z
)
*
b
,
this
.
w
+
(
a
.
w
-
this
.
w
)
*
b
)},
clone
:
function
(){
return
new
THREE
.
Vector4
(
this
.
x
,
this
.
y
,
this
.
z
,
this
.
w
)}};
THREE
.
Ray
=
function
(
a
,
b
){
this
.
origin
=
a
||
new
THREE
.
Vector3
;
this
.
direction
=
b
||
new
THREE
.
Vector3
};
THREE
.
Ray
.
prototype
=
{
intersectScene
:
function
(
a
){
var
b
,
c
,
e
=
a
.
objects
,
d
=
[];
a
=
0
;
for
(
b
=
e
.
length
;
a
<
b
;
a
++
){
c
=
e
[
a
];
c
instanceof
THREE
.
Mesh
&&
(
d
=
d
.
concat
(
this
.
intersectObject
(
c
)))}
d
.
sort
(
function
(
g
,
f
){
return
g
.
distance
-
f
.
distance
});
return
d
},
intersectObject
:
function
(
a
){
function
b
(
s
,
u
,
B
,
v
){
v
=
v
.
clone
().
subSelf
(
u
);
B
=
B
.
clone
().
subSelf
(
u
);
var
o
=
s
.
clone
().
subSelf
(
u
);
s
=
v
.
dot
(
v
);
u
=
v
.
dot
(
B
);
v
=
v
.
dot
(
o
);
var
G
=
B
.
dot
(
B
);
B
=
B
.
dot
(
o
);
o
=
1
/
(
s
*
G
-
u
*
u
);
G
=
(
G
*
v
-
u
*
B
)
*
o
;
s
=
(
s
*
B
-
u
*
v
)
*
o
;
return
G
>
0
&&
s
>
0
&&
G
+
s
<
1
}
var
c
,
e
,
d
,
g
,
f
,
i
,
h
,
j
,
m
,
l
,
THREE
.
Ray
.
prototype
=
{
intersectScene
:
function
(
a
){
var
b
,
c
,
e
=
a
.
objects
,
d
=
[];
a
=
0
;
for
(
b
=
e
.
length
;
a
<
b
;
a
++
){
c
=
e
[
a
];
c
instanceof
THREE
.
Mesh
&&
(
d
=
d
.
concat
(
this
.
intersectObject
(
c
)))}
d
.
sort
(
function
(
g
,
f
){
return
g
.
distance
-
f
.
distance
});
return
d
},
intersectObject
:
function
(
a
){
function
b
(
s
,
u
,
C
,
v
){
v
=
v
.
clone
().
subSelf
(
u
);
C
=
C
.
clone
().
subSelf
(
u
);
var
o
=
s
.
clone
().
subSelf
(
u
);
s
=
v
.
dot
(
v
);
u
=
v
.
dot
(
C
);
v
=
v
.
dot
(
o
);
var
I
=
C
.
dot
(
C
);
C
=
C
.
dot
(
o
);
o
=
1
/
(
s
*
I
-
u
*
u
);
I
=
(
I
*
v
-
u
*
C
)
*
o
;
s
=
(
s
*
C
-
u
*
v
)
*
o
;
return
I
>
0
&&
s
>
0
&&
I
+
s
<
1
}
var
c
,
e
,
d
,
g
,
f
,
i
,
h
,
j
,
m
,
l
,
n
,
k
=
a
.
geometry
,
q
=
k
.
vertices
,
p
=
[];
c
=
0
;
for
(
e
=
k
.
faces
.
length
;
c
<
e
;
c
++
){
d
=
k
.
faces
[
c
];
l
=
this
.
origin
.
clone
();
n
=
this
.
direction
.
clone
();
h
=
a
.
matrixWorld
;
g
=
h
.
multiplyVector3
(
q
[
d
.
a
].
position
.
clone
());
f
=
h
.
multiplyVector3
(
q
[
d
.
b
].
position
.
clone
());
i
=
h
.
multiplyVector3
(
q
[
d
.
c
].
position
.
clone
());
h
=
d
instanceof
THREE
.
Face4
?
h
.
multiplyVector3
(
q
[
d
.
d
].
position
.
clone
()):
null
;
j
=
a
.
matrixRotationWorld
.
multiplyVector3
(
d
.
normal
.
clone
());
m
=
n
.
dot
(
j
);
if
(
m
<
0
){
j
=
j
.
dot
((
new
THREE
.
Vector3
).
sub
(
g
,
l
))
/
m
;
l
=
l
.
addSelf
(
n
.
multiplyScalar
(
j
));
if
(
d
instanceof
THREE
.
Face3
){
if
(
b
(
l
,
g
,
f
,
i
)){
d
=
{
distance
:
this
.
origin
.
distanceTo
(
l
),
point
:
l
,
face
:
d
,
object
:
a
};
p
.
push
(
d
)}}
else
if
(
d
instanceof
THREE
.
Face4
&&
(
b
(
l
,
g
,
f
,
h
)
||
b
(
l
,
f
,
i
,
h
))){
d
=
{
distance
:
this
.
origin
.
distanceTo
(
l
),
point
:
l
,
face
:
d
,
object
:
a
};
p
.
push
(
d
)}}}
return
p
}};
THREE
.
Rectangle
=
function
(){
function
a
(){
g
=
e
-
b
;
f
=
d
-
c
}
var
b
,
c
,
e
,
d
,
g
,
f
,
i
=!
0
;
this
.
getX
=
function
(){
return
b
};
this
.
getY
=
function
(){
return
c
};
this
.
getWidth
=
function
(){
return
g
};
this
.
getHeight
=
function
(){
return
f
};
this
.
getLeft
=
function
(){
return
b
};
this
.
getTop
=
function
(){
return
c
};
this
.
getRight
=
function
(){
return
e
};
this
.
getBottom
=
function
(){
return
d
};
this
.
set
=
function
(
h
,
j
,
m
,
l
){
i
=!
1
;
b
=
h
;
c
=
j
;
e
=
m
;
d
=
l
;
a
()};
this
.
addPoint
=
function
(
h
,
j
){
if
(
i
){
i
=!
1
;
b
=
h
;
c
=
j
;
e
=
h
;
d
=
j
}
else
{
b
=
b
<
h
?
b
:
h
;
c
=
c
<
j
?
c
:
j
;
e
=
e
>
h
?
e
:
h
;
d
=
d
>
j
?
d
:
j
}
a
()};
...
...
@@ -23,8 +23,8 @@ THREE.Matrix4=function(a,b,c,e,d,g,f,i,h,j,m,l,n,k,q,p){this.set(a||1,b||0,c||0,
THREE
.
Matrix4
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
e
,
d
,
g
,
f
,
i
,
h
,
j
,
m
,
l
,
n
,
k
,
q
,
p
){
this
.
n11
=
a
;
this
.
n12
=
b
;
this
.
n13
=
c
;
this
.
n14
=
e
;
this
.
n21
=
d
;
this
.
n22
=
g
;
this
.
n23
=
f
;
this
.
n24
=
i
;
this
.
n31
=
h
;
this
.
n32
=
j
;
this
.
n33
=
m
;
this
.
n34
=
l
;
this
.
n41
=
n
;
this
.
n42
=
k
;
this
.
n43
=
q
;
this
.
n44
=
p
;
return
this
},
identity
:
function
(){
this
.
set
(
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
n11
,
a
.
n12
,
a
.
n13
,
a
.
n14
,
a
.
n21
,
a
.
n22
,
a
.
n23
,
a
.
n24
,
a
.
n31
,
a
.
n32
,
a
.
n33
,
a
.
n34
,
a
.
n41
,
a
.
n42
,
a
.
n43
,
a
.
n44
);
return
this
},
lookAt
:
function
(
a
,
b
,
c
){
var
e
=
THREE
.
Matrix4
.
__v1
,
d
=
THREE
.
Matrix4
.
__v2
,
g
=
THREE
.
Matrix4
.
__v3
;
g
.
sub
(
a
,
b
).
normalize
();
if
(
g
.
length
()
===
0
)
g
.
z
=
1
;
e
.
cross
(
c
,
g
).
normalize
();
if
(
e
.
length
()
===
0
){
g
.
x
+=
1.0
E
-
4
;
e
.
cross
(
c
,
g
).
normalize
()}
d
.
cross
(
g
,
e
).
normalize
();
this
.
n11
=
e
.
x
;
this
.
n12
=
d
.
x
;
this
.
n13
=
g
.
x
;
this
.
n21
=
e
.
y
;
this
.
n22
=
d
.
y
;
this
.
n23
=
g
.
y
;
this
.
n31
=
e
.
z
;
this
.
n32
=
d
.
z
;
this
.
n33
=
g
.
z
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
e
=
a
.
z
,
d
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
e
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
e
+
this
.
n14
)
*
d
;
a
.
y
=
(
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
e
+
this
.
n24
)
*
d
;
a
.
z
=
(
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
e
+
this
.
n34
)
*
d
;
return
a
},
multiplyVector4
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
e
=
a
.
z
,
d
=
a
.
w
;
a
.
x
=
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
e
+
this
.
n14
*
d
;
a
.
y
=
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
e
+
this
.
n24
*
d
;
a
.
z
=
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
e
+
this
.
n34
*
d
;
a
.
w
=
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
e
+
this
.
n44
*
d
;
return
a
},
rotateAxis
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
e
=
a
.
z
;
a
.
x
=
b
*
this
.
n11
+
c
*
this
.
n12
+
e
*
this
.
n13
;
a
.
y
=
b
*
this
.
n21
+
c
*
this
.
n22
+
e
*
this
.
n23
;
a
.
z
=
b
*
this
.
n31
+
c
*
this
.
n32
+
e
*
this
.
n33
;
a
.
normalize
();
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
multiply
:
function
(
a
,
b
){
var
c
=
a
.
n11
,
e
=
a
.
n12
,
d
=
a
.
n13
,
g
=
a
.
n14
,
f
=
a
.
n21
,
i
=
a
.
n22
,
h
=
a
.
n23
,
j
=
a
.
n24
,
m
=
a
.
n31
,
l
=
a
.
n32
,
n
=
a
.
n33
,
k
=
a
.
n34
,
q
=
a
.
n41
,
p
=
a
.
n42
,
s
=
a
.
n43
,
u
=
a
.
n44
,
B
=
b
.
n11
,
v
=
b
.
n12
,
o
=
b
.
n13
,
G
=
b
.
n14
,
D
=
b
.
n21
,
I
=
b
.
n22
,
J
=
b
.
n23
,
P
=
b
.
n24
,
t
=
b
.
n31
,
r
=
b
.
n32
,
F
=
b
.
n33
,
z
=
b
.
n34
;
this
.
n11
=
c
*
B
+
e
*
D
+
d
*
t
;
this
.
n12
=
c
*
v
+
e
*
I
+
d
*
r
;
this
.
n13
=
c
*
o
+
e
*
J
+
d
*
F
;
this
.
n14
=
c
*
G
+
e
*
P
+
d
*
z
+
g
;
this
.
n21
=
f
*
B
+
i
*
D
+
h
*
t
;
this
.
n22
=
f
*
v
+
i
*
I
+
h
*
r
;
this
.
n23
=
f
*
o
+
i
*
J
+
h
*
F
;
this
.
n24
=
f
*
G
+
i
*
P
+
h
*
z
+
j
;
this
.
n31
=
m
*
B
+
l
*
D
+
n
*
t
;
this
.
n32
=
m
*
v
+
l
*
I
+
n
*
r
;
this
.
n33
=
m
*
o
+
l
*
J
+
n
*
F
;
this
.
n34
=
m
*
G
+
l
*
P
+
n
*
z
+
k
;
this
.
n41
=
q
*
B
+
p
*
D
+
s
*
t
;
this
.
n42
=
q
*
v
+
p
*
I
+
s
*
r
;
this
.
n43
=
q
*
o
+
p
*
J
+
s
*
F
;
this
.
n44
=
q
*
G
+
p
*
P
+
s
*
z
+
u
;
return
this
},
multiplyToArray
:
function
(
a
,
b
,
c
){
this
.
multiply
(
a
,
b
);
c
[
0
]
=
this
.
n11
;
c
[
1
]
=
this
.
n21
;
c
[
2
]
=
this
.
n31
;
c
[
3
]
=
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
multiply
:
function
(
a
,
b
){
var
c
=
a
.
n11
,
e
=
a
.
n12
,
d
=
a
.
n13
,
g
=
a
.
n14
,
f
=
a
.
n21
,
i
=
a
.
n22
,
h
=
a
.
n23
,
j
=
a
.
n24
,
m
=
a
.
n31
,
l
=
a
.
n32
,
n
=
a
.
n33
,
k
=
a
.
n34
,
q
=
a
.
n41
,
p
=
a
.
n42
,
s
=
a
.
n43
,
u
=
a
.
n44
,
C
=
b
.
n11
,
v
=
b
.
n12
,
o
=
b
.
n13
,
I
=
b
.
n14
,
F
=
b
.
n21
,
K
=
b
.
n22
,
L
=
b
.
n23
,
t
=
b
.
n24
,
r
=
b
.
n31
,
G
=
b
.
n32
,
z
=
b
.
n33
,
D
=
b
.
n34
;
this
.
n11
=
c
*
C
+
e
*
F
+
d
*
r
;
this
.
n12
=
c
*
v
+
e
*
K
+
d
*
G
;
this
.
n13
=
c
*
o
+
e
*
L
+
d
*
z
;
this
.
n14
=
c
*
I
+
e
*
t
+
d
*
D
+
g
;
this
.
n21
=
f
*
C
+
i
*
F
+
h
*
r
;
this
.
n22
=
f
*
v
+
i
*
K
+
h
*
G
;
this
.
n23
=
f
*
o
+
i
*
L
+
h
*
z
;
this
.
n24
=
f
*
I
+
i
*
t
+
h
*
D
+
j
;
this
.
n31
=
m
*
C
+
l
*
F
+
n
*
r
;
this
.
n32
=
m
*
v
+
l
*
K
+
n
*
G
;
this
.
n33
=
m
*
o
+
l
*
L
+
n
*
z
;
this
.
n34
=
m
*
I
+
l
*
t
+
n
*
D
+
k
;
this
.
n41
=
q
*
C
+
p
*
F
+
s
*
r
;
this
.
n42
=
q
*
v
+
p
*
K
+
s
*
G
;
this
.
n43
=
q
*
o
+
p
*
L
+
s
*
z
;
this
.
n44
=
q
*
I
+
p
*
t
+
s
*
D
+
u
;
return
this
},
multiplyToArray
:
function
(
a
,
b
,
c
){
this
.
multiply
(
a
,
b
);
c
[
0
]
=
this
.
n11
;
c
[
1
]
=
this
.
n21
;
c
[
2
]
=
this
.
n31
;
c
[
3
]
=
this
.
n41
;
c
[
4
]
=
this
.
n12
;
c
[
5
]
=
this
.
n22
;
c
[
6
]
=
this
.
n32
;
c
[
7
]
=
this
.
n42
;
c
[
8
]
=
this
.
n13
;
c
[
9
]
=
this
.
n23
;
c
[
10
]
=
this
.
n33
;
c
[
11
]
=
this
.
n43
;
c
[
12
]
=
this
.
n14
;
c
[
13
]
=
this
.
n24
;
c
[
14
]
=
this
.
n34
;
c
[
15
]
=
this
.
n44
;
return
this
},
multiplySelf
:
function
(
a
){
this
.
multiply
(
this
,
a
);
return
this
},
multiplyScalar
:
function
(
a
){
this
.
n11
*=
a
;
this
.
n12
*=
a
;
this
.
n13
*=
a
;
this
.
n14
*=
a
;
this
.
n21
*=
a
;
this
.
n22
*=
a
;
this
.
n23
*=
a
;
this
.
n24
*=
a
;
this
.
n31
*=
a
;
this
.
n32
*=
a
;
this
.
n33
*=
a
;
this
.
n34
*=
a
;
this
.
n41
*=
a
;
this
.
n42
*=
a
;
this
.
n43
*=
a
;
this
.
n44
*=
a
;
return
this
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
e
=
this
.
n14
,
d
=
this
.
n21
,
g
=
this
.
n22
,
f
=
this
.
n23
,
i
=
this
.
n24
,
h
=
this
.
n31
,
j
=
this
.
n32
,
m
=
this
.
n33
,
l
=
this
.
n34
,
n
=
this
.
n41
,
k
=
this
.
n42
,
q
=
this
.
n43
,
p
=
this
.
n44
;
return
e
*
f
*
j
*
n
-
c
*
i
*
j
*
n
-
e
*
g
*
m
*
n
+
b
*
i
*
m
*
n
+
c
*
g
*
l
*
n
-
b
*
f
*
l
*
n
-
e
*
f
*
h
*
k
+
c
*
i
*
h
*
k
+
e
*
d
*
m
*
k
-
a
*
i
*
m
*
k
-
c
*
d
*
l
*
k
+
a
*
f
*
l
*
k
+
e
*
g
*
h
*
q
-
b
*
i
*
h
*
q
-
e
*
d
*
j
*
q
+
a
*
i
*
j
*
q
+
b
*
d
*
l
*
q
-
a
*
g
*
l
*
q
-
c
*
g
*
h
*
p
+
b
*
f
*
h
*
p
+
c
*
d
*
j
*
p
-
a
*
f
*
j
*
p
-
b
*
d
*
m
*
p
+
a
*
g
*
m
*
p
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n43
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
.
n43
=
this
.
n43
;
a
.
n44
=
this
.
n44
;
return
a
},
flatten
:
function
(){
this
.
flat
[
0
]
=
this
.
n11
;
this
.
flat
[
1
]
=
this
.
n21
;
...
...
@@ -84,16 +84,16 @@ THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.f
THREE
.
Scene
.
prototype
.
addChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
this
.
lights
.
indexOf
(
a
)
===-
1
&&
this
.
lights
.
push
(
a
);
else
if
(
a
instanceof
THREE
.
Sound
)
this
.
sounds
.
indexOf
(
a
)
===-
1
&&
this
.
sounds
.
push
(
a
);
else
if
(
!
(
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
)
&&
this
.
objects
.
indexOf
(
a
)
===-
1
){
this
.
objects
.
push
(
a
);
this
.
__objectsAdded
.
push
(
a
)}
for
(
var
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
addChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
removeChild
=
function
(
a
){
this
.
supr
.
removeChild
.
call
(
this
,
a
);
this
.
removeChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
removeChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
lights
.
indexOf
(
a
);
b
!==-
1
&&
this
.
lights
.
splice
(
b
,
1
)}
else
if
(
a
instanceof
THREE
.
Sound
){
b
=
this
.
sounds
.
indexOf
(
a
);
b
!==-
1
&&
this
.
sounds
.
splice
(
b
,
1
)}
else
if
(
!
(
a
instanceof
THREE
.
Camera
)){
b
=
this
.
objects
.
indexOf
(
a
);
if
(
b
!==-
1
){
this
.
objects
.
splice
(
b
,
1
);
this
.
__objectsRemoved
.
push
(
a
)}}
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
removeChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
addObject
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeObject
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Scene
.
prototype
.
addLight
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeLight
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Projector
=
function
(){
function
a
(){
var
t
=
h
[
i
]
=
h
[
i
]
||
new
THREE
.
RenderableVertex
;
i
++
;
return
t
}
function
b
(
t
,
r
){
return
r
.
z
-
t
.
z
}
function
c
(
t
,
r
){
var
F
=
0
,
z
=
1
,
H
=
t
.
z
+
t
.
w
,
C
=
r
.
z
+
r
.
w
,
x
=-
t
.
z
+
t
.
w
,
y
=-
r
.
z
+
r
.
w
;
if
(
H
>=
0
&&
C
>=
0
&&
x
>=
0
&&
y
>=
0
)
return
!
0
;
else
if
(
H
<
0
&&
C
<
0
||
x
<
0
&&
y
<
0
)
return
!
1
;
else
{
if
(
H
<
0
)
F
=
Math
.
max
(
F
,
H
/
(
H
-
C
));
else
C
<
0
&&
(
z
=
Math
.
min
(
z
,
H
/
(
H
-
C
)));
if
(
x
<
0
)
F
=
Math
.
max
(
F
,
x
/
(
x
-
y
));
else
y
<
0
&&
(
z
=
Math
.
min
(
z
,
x
/
(
x
-
y
)));
if
(
z
<
F
)
return
!
1
;
else
{
t
.
lerpSelf
(
r
,
F
);
r
.
lerpSelf
(
t
,
1
-
z
);
return
!
0
}}}
var
e
,
d
,
g
=
[],
f
,
i
,
h
=
[],
j
,
m
,
l
=
[],
n
,
k
,
q
=
[],
p
,
s
,
u
=
[],
B
=
new
THREE
.
Vector4
,
v
=
new
THREE
.
Vector4
,
o
=
new
THREE
.
Matrix4
,
G
=
new
THREE
.
Matrix4
,
D
=
[
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
],
I
=
new
THREE
.
Vector4
,
J
=
new
THREE
.
Vector4
,
P
;
this
.
projectVector
=
function
(
t
,
r
){
o
.
multiply
(
r
.
projectionMatrix
,
r
.
matrixWorldInverse
);
o
.
multiplyVector3
(
t
);
return
t
};
this
.
unprojectVector
=
function
(
t
,
r
){
o
.
multiply
(
THREE
.
Matrix4
.
makeInvert
(
r
.
projectionMatrix
),
r
.
matrixWorld
);
o
.
multiplyVector3
(
t
);
return
t
};
this
.
projectObjects
=
function
(
t
,
r
,
F
){
r
=
[];
var
z
,
H
,
C
;
d
=
0
;
H
=
t
.
objects
;
t
=
0
;
for
(
z
=
H
.
length
;
t
<
z
;
t
++
){
C
=
H
[
t
];
var
x
;
if
(
!
(
x
=!
C
.
visible
))
if
(
x
=
C
instanceof
THREE
.
Mesh
){
a
:{
x
=
void
0
;
for
(
var
y
=
C
.
matrixWorld
,
M
=-
C
.
geometry
.
boundingSphere
.
radius
*
Math
.
max
(
C
.
scale
.
x
,
Math
.
max
(
C
.
scale
.
y
,
C
.
scale
.
z
)),
w
=
0
;
w
<
6
;
w
++
){
x
=
D
[
w
].
x
*
y
.
n14
+
D
[
w
].
y
*
y
.
n24
+
D
[
w
].
z
*
y
.
n34
+
D
[
w
].
w
;
if
(
x
<=
M
){
x
=!
1
;
break
a
}}
x
=!
0
}
x
=!
x
}
if
(
!
x
){
x
=
g
[
d
]
=
g
[
d
]
||
new
THREE
.
RenderableObject
;
d
++
;
e
=
x
;
B
.
copy
(
C
.
position
);
o
.
multiplyVector3
(
B
);
e
.
object
=
C
;
e
.
z
=
B
.
z
;
r
.
push
(
e
)}}
F
&&
r
.
sort
(
b
);
return
r
};
this
.
projectScene
=
function
(
t
,
r
,
F
){
var
z
=
[],
H
=
r
.
near
,
C
=
r
.
far
,
x
,
y
,
M
,
w
,
K
,
A
,
N
,
T
,
R
,
Q
,
E
,
S
,
L
,
O
;
s
=
k
=
m
=
0
;
r
.
matrixAutoUpdate
&&
r
.
updateMatrix
();
t
.
update
(
undefined
,
!
1
,
r
);
o
.
multiply
(
r
.
projectionMatrix
,
r
.
matrixWorldInverse
);
D
[
0
].
set
(
o
.
n41
-
o
.
n11
,
o
.
n42
-
o
.
n12
,
o
.
n43
-
o
.
n13
,
o
.
n44
-
o
.
n14
);
D
[
1
].
set
(
o
.
n41
+
o
.
n11
,
o
.
n42
+
o
.
n12
,
o
.
n43
+
o
.
n13
,
o
.
n44
+
o
.
n14
);
D
[
2
].
set
(
o
.
n41
+
o
.
n21
,
o
.
n42
+
o
.
n22
,
o
.
n43
+
o
.
n23
,
o
.
n44
+
o
.
n24
);
D
[
3
].
set
(
o
.
n41
-
o
.
n21
,
o
.
n42
-
o
.
n22
,
o
.
n43
-
o
.
n23
,
o
.
n44
-
o
.
n24
);
D
[
4
].
set
(
o
.
n41
-
o
.
n31
,
o
.
n42
-
o
.
n32
,
o
.
n43
-
o
.
n33
,
o
.
n44
-
o
.
n34
);
D
[
5
].
set
(
o
.
n41
+
o
.
n31
,
o
.
n42
+
o
.
n32
,
o
.
n43
+
o
.
n33
,
o
.
n44
+
o
.
n34
);
for
(
x
=
0
;
x
<
6
;
x
++
){
K
=
D
[
x
];
K
.
divideScalar
(
Math
.
sqrt
(
K
.
x
*
K
.
x
+
K
.
y
*
K
.
y
+
K
.
z
*
K
.
z
))}
K
=
this
.
projectObjects
(
t
,
r
,
!
0
);
t
=
0
;
for
(
x
=
K
.
length
;
t
<
x
;
t
++
){
A
=
K
[
t
].
object
;
if
(
A
.
visible
){
N
=
A
.
matrixWorld
;
R
=
A
.
matrixRotationWorld
;
T
=
A
.
materials
;
i
=
0
;
if
(
A
instanceof
THREE
.
Mesh
){
Q
=
A
.
geometry
;
E
=
Q
.
vertices
;
S
=
Q
.
faces
;
y
=
0
;
for
(
M
=
E
.
length
;
y
<
M
;
y
++
){
f
=
a
();
f
.
positionWorld
.
copy
(
E
[
y
].
position
);
N
.
multiplyVector3
(
f
.
positionWorld
);
f
.
positionScreen
.
copy
(
f
.
positionWorld
);
o
.
multiplyVector4
(
f
.
positionScreen
);
f
.
positionScreen
.
x
/=
f
.
positionScreen
.
w
;
f
.
positionScreen
.
y
/=
f
.
positionScreen
.
w
;
f
.
visible
=
f
.
positionScreen
.
z
>
H
&&
f
.
positionScreen
.
z
<
C
}
y
=
0
;
for
(
M
=
S
.
length
;
y
<
M
;
y
++
){
E
=
S
[
y
];
if
(
E
instanceof
THREE
.
Face3
){
w
=
h
[
E
.
a
];
L
=
h
[
E
.
b
];
O
=
h
[
E
.
c
];
if
(
w
.
visible
&&
L
.
visible
&&
O
.
visible
&&
(
A
.
doubleSided
||
A
.
flipSided
!=
(
O
.
positionScreen
.
x
-
w
.
positionScreen
.
x
)
*
(
L
.
positionScreen
.
y
-
w
.
positionScreen
.
y
)
-
(
O
.
positionScreen
.
y
-
w
.
positionScreen
.
y
)
*
(
L
.
positionScreen
.
x
-
w
.
positionScreen
.
x
)
<
0
)){
var
U
=
l
[
m
]
=
l
[
m
]
||
new
THREE
.
RenderableFace3
;
m
++
;
j
=
U
;
j
.
v1
.
copy
(
w
);
j
.
v2
.
copy
(
L
);
j
.
v3
.
copy
(
O
);
j
.
normalWorld
.
copy
(
E
.
normal
);
R
.
multiplyVector3
(
j
.
normalWorld
);
j
.
centroidWorld
.
copy
(
E
.
centroid
);
N
.
multiplyVector3
(
j
.
centroidWorld
);
j
.
centroidScreen
.
copy
(
j
.
centroidWorld
);
o
.
multiplyVector3
(
j
.
centroidScreen
);
L
=
E
.
vertexNormals
;
P
=
j
.
vertexNormalsWorld
;
for
(
w
=
0
;
w
<
3
;
w
++
){
O
=
P
[
w
];
O
.
copy
(
L
[
w
]);
R
.
multiplyVector3
(
O
)}
if
(
w
=
Q
.
faceVertexUvs
[
0
][
y
]){
j
.
uvs
[
0
]
=
w
[
0
];
j
.
uvs
[
1
]
=
w
[
1
];
j
.
uvs
[
2
]
=
w
[
2
]}
j
.
meshMaterials
=
T
;
j
.
faceMaterials
=
E
.
materials
;
j
.
z
=
j
.
centroidScreen
.
z
;
z
.
push
(
j
)}}}}
else
if
(
A
instanceof
THREE
.
Line
){
G
.
multiply
(
o
,
N
);
E
=
A
.
geometry
.
vertices
;
w
=
a
();
w
.
positionScreen
.
copy
(
E
[
0
].
position
);
G
.
multiplyVector4
(
w
.
positionScreen
);
y
=
1
;
for
(
M
=
E
.
length
;
y
<
M
;
y
++
){
w
=
a
();
w
.
positionScreen
.
copy
(
E
[
y
].
position
);
G
.
multiplyVector4
(
w
.
positionScreen
);
L
=
h
[
i
-
2
];
I
.
copy
(
w
.
positionScreen
);
J
.
copy
(
L
.
positionScreen
);
if
(
c
(
I
,
J
)){
I
.
multiplyScalar
(
1
/
I
.
w
);
J
.
multiplyScalar
(
1
/
J
.
w
);
N
=
q
[
k
]
=
q
[
k
]
||
new
THREE
.
RenderableLine
;
k
++
;
n
=
N
;
n
.
v1
.
positionScreen
.
copy
(
I
);
n
.
v2
.
positionScreen
.
copy
(
J
);
n
.
z
=
Math
.
max
(
I
.
z
,
J
.
z
);
n
.
materials
=
A
.
materials
;
z
.
push
(
n
)}}}
else
if
(
A
instanceof
THREE
.
Particle
){
v
.
set
(
A
.
position
.
x
,
A
.
position
.
y
,
A
.
position
.
z
,
1
);
o
.
multiplyVector4
(
v
);
v
.
z
/=
v
.
w
;
if
(
v
.
z
>
0
&&
v
.
z
<
1
){
N
=
u
[
s
]
=
u
[
s
]
||
new
THREE
.
RenderableParticle
;
s
++
;
p
=
N
;
p
.
x
=
v
.
x
/
v
.
w
;
p
.
y
=
v
.
y
/
v
.
w
;
p
.
z
=
v
.
z
;
p
.
rotation
=
A
.
rotation
.
z
;
p
.
scale
.
x
=
A
.
scale
.
x
*
Math
.
abs
(
p
.
x
-
(
v
.
x
+
r
.
projectionMatrix
.
n11
)
/
(
v
.
w
+
r
.
projectionMatrix
.
n14
));
p
.
scale
.
y
=
A
.
scale
.
y
*
Math
.
abs
(
p
.
y
-
(
v
.
y
+
r
.
projectionMatrix
.
n22
)
/
(
v
.
w
+
r
.
projectionMatrix
.
n24
));
p
.
materials
=
A
.
materials
;
z
.
push
(
p
)}}}}
F
&&
z
.
sort
(
b
);
return
z
}};
THREE
.
Projector
=
function
(){
function
a
(){
var
t
=
h
[
i
]
=
h
[
i
]
||
new
THREE
.
RenderableVertex
;
i
++
;
return
t
}
function
b
(
t
,
r
){
return
r
.
z
-
t
.
z
}
function
c
(
t
,
r
){
var
G
=
0
,
z
=
1
,
D
=
t
.
z
+
t
.
w
,
E
=
r
.
z
+
r
.
w
,
w
=-
t
.
z
+
t
.
w
,
A
=-
r
.
z
+
r
.
w
;
if
(
D
>=
0
&&
E
>=
0
&&
w
>=
0
&&
A
>=
0
)
return
!
0
;
else
if
(
D
<
0
&&
E
<
0
||
w
<
0
&&
A
<
0
)
return
!
1
;
else
{
if
(
D
<
0
)
G
=
Math
.
max
(
G
,
D
/
(
D
-
E
));
else
E
<
0
&&
(
z
=
Math
.
min
(
z
,
D
/
(
D
-
E
)));
if
(
w
<
0
)
G
=
Math
.
max
(
G
,
w
/
(
w
-
A
));
else
A
<
0
&&
(
z
=
Math
.
min
(
z
,
w
/
(
w
-
A
)));
if
(
z
<
G
)
return
!
1
;
else
{
t
.
lerpSelf
(
r
,
G
);
r
.
lerpSelf
(
t
,
1
-
z
);
return
!
0
}}}
var
e
,
d
,
g
=
[],
f
,
i
,
h
=
[],
j
,
m
,
l
=
[],
n
,
k
,
q
=
[],
p
,
s
,
u
=
[],
C
=
new
THREE
.
Vector4
,
v
=
new
THREE
.
Vector4
,
o
=
new
THREE
.
Matrix4
,
I
=
new
THREE
.
Matrix4
,
F
=
[
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
,
new
THREE
.
Vector4
],
K
=
new
THREE
.
Vector4
,
L
=
new
THREE
.
Vector4
;
this
.
projectVector
=
function
(
t
,
r
){
o
.
multiply
(
r
.
projectionMatrix
,
r
.
matrixWorldInverse
);
o
.
multiplyVector3
(
t
);
return
t
};
this
.
unprojectVector
=
function
(
t
,
r
){
o
.
multiply
(
THREE
.
Matrix4
.
makeInvert
(
r
.
projectionMatrix
),
r
.
matrixWorld
);
o
.
multiplyVector3
(
t
);
return
t
};
this
.
projectObjects
=
function
(
t
,
r
,
G
){
r
=
[];
var
z
,
D
,
E
;
d
=
0
;
D
=
t
.
objects
;
t
=
0
;
for
(
z
=
D
.
length
;
t
<
z
;
t
++
){
E
=
D
[
t
];
var
w
;
if
(
!
(
w
=!
E
.
visible
))
if
(
w
=
E
instanceof
THREE
.
Mesh
){
a
:{
w
=
void
0
;
for
(
var
A
=
E
.
matrixWorld
,
H
=-
E
.
geometry
.
boundingSphere
.
radius
*
Math
.
max
(
E
.
scale
.
x
,
Math
.
max
(
E
.
scale
.
y
,
E
.
scale
.
z
)),
B
=
0
;
B
<
6
;
B
++
){
w
=
F
[
B
].
x
*
A
.
n14
+
F
[
B
].
y
*
A
.
n24
+
F
[
B
].
z
*
A
.
n34
+
F
[
B
].
w
;
if
(
w
<=
H
){
w
=!
1
;
break
a
}}
w
=!
0
}
w
=!
w
}
if
(
!
w
){
w
=
g
[
d
]
=
g
[
d
]
||
new
THREE
.
RenderableObject
;
d
++
;
e
=
w
;
C
.
copy
(
E
.
position
);
o
.
multiplyVector3
(
C
);
e
.
object
=
E
;
e
.
z
=
C
.
z
;
r
.
push
(
e
)}}
G
&&
r
.
sort
(
b
);
return
r
};
this
.
projectScene
=
function
(
t
,
r
,
G
){
var
z
=
[],
D
=
r
.
near
,
E
=
r
.
far
,
w
,
A
,
H
,
B
,
x
,
M
,
J
,
P
,
N
,
y
,
O
,
R
,
U
,
V
,
Q
,
S
,
T
;
s
=
k
=
m
=
0
;
r
.
matrixAutoUpdate
&&
r
.
updateMatrix
();
t
.
update
(
undefined
,
!
1
,
r
);
o
.
multiply
(
r
.
projectionMatrix
,
r
.
matrixWorldInverse
);
F
[
0
].
set
(
o
.
n41
-
o
.
n11
,
o
.
n42
-
o
.
n12
,
o
.
n43
-
o
.
n13
,
o
.
n44
-
o
.
n14
);
F
[
1
].
set
(
o
.
n41
+
o
.
n11
,
o
.
n42
+
o
.
n12
,
o
.
n43
+
o
.
n13
,
o
.
n44
+
o
.
n14
);
F
[
2
].
set
(
o
.
n41
+
o
.
n21
,
o
.
n42
+
o
.
n22
,
o
.
n43
+
o
.
n23
,
o
.
n44
+
o
.
n24
);
F
[
3
].
set
(
o
.
n41
-
o
.
n21
,
o
.
n42
-
o
.
n22
,
o
.
n43
-
o
.
n23
,
o
.
n44
-
o
.
n24
);
F
[
4
].
set
(
o
.
n41
-
o
.
n31
,
o
.
n42
-
o
.
n32
,
o
.
n43
-
o
.
n33
,
o
.
n44
-
o
.
n34
);
F
[
5
].
set
(
o
.
n41
+
o
.
n31
,
o
.
n42
+
o
.
n32
,
o
.
n43
+
o
.
n33
,
o
.
n44
+
o
.
n34
);
for
(
w
=
0
;
w
<
6
;
w
++
){
N
=
F
[
w
];
N
.
divideScalar
(
Math
.
sqrt
(
N
.
x
*
N
.
x
+
N
.
y
*
N
.
y
+
N
.
z
*
N
.
z
))}
N
=
this
.
projectObjects
(
t
,
r
,
!
0
);
t
=
0
;
for
(
w
=
N
.
length
;
t
<
w
;
t
++
){
y
=
N
[
t
].
object
;
if
(
y
.
visible
){
O
=
y
.
matrixWorld
;
R
=
y
.
matrixRotationWorld
;
U
=
y
.
materials
;
V
=
y
.
overdraw
;
i
=
0
;
if
(
y
instanceof
THREE
.
Mesh
){
Q
=
y
.
geometry
;
B
=
Q
.
vertices
;
S
=
Q
.
faces
;
Q
=
Q
.
faceVertexUvs
;
A
=
0
;
for
(
H
=
B
.
length
;
A
<
H
;
A
++
){
f
=
a
();
f
.
positionWorld
.
copy
(
B
[
A
].
position
);
O
.
multiplyVector3
(
f
.
positionWorld
);
f
.
positionScreen
.
copy
(
f
.
positionWorld
);
o
.
multiplyVector4
(
f
.
positionScreen
);
f
.
positionScreen
.
x
/=
f
.
positionScreen
.
w
;
f
.
positionScreen
.
y
/=
f
.
positionScreen
.
w
;
f
.
visible
=
f
.
positionScreen
.
z
>
D
&&
f
.
positionScreen
.
z
<
E
}
B
=
0
;
for
(
A
=
S
.
length
;
B
<
A
;
B
++
){
H
=
S
[
B
];
if
(
H
instanceof
THREE
.
Face3
){
x
=
h
[
H
.
a
];
M
=
h
[
H
.
b
];
J
=
h
[
H
.
c
];
if
(
x
.
visible
&&
M
.
visible
&&
J
.
visible
&&
(
y
.
doubleSided
||
y
.
flipSided
!=
(
J
.
positionScreen
.
x
-
x
.
positionScreen
.
x
)
*
(
M
.
positionScreen
.
y
-
x
.
positionScreen
.
y
)
-
(
J
.
positionScreen
.
y
-
x
.
positionScreen
.
y
)
*
(
M
.
positionScreen
.
x
-
x
.
positionScreen
.
x
)
<
0
)){
P
=
l
[
m
]
=
l
[
m
]
||
new
THREE
.
RenderableFace3
;
m
++
;
j
=
P
;
j
.
v1
.
copy
(
x
);
j
.
v2
.
copy
(
M
);
j
.
v3
.
copy
(
J
);
j
.
normalWorld
.
copy
(
H
.
normal
);
R
.
multiplyVector3
(
j
.
normalWorld
);
j
.
centroidWorld
.
copy
(
H
.
centroid
);
O
.
multiplyVector3
(
j
.
centroidWorld
);
j
.
centroidScreen
.
copy
(
j
.
centroidWorld
);
o
.
multiplyVector3
(
j
.
centroidScreen
);
J
=
H
.
vertexNormals
;
x
=
0
;
for
(
M
=
J
.
length
;
x
<
M
;
x
++
){
P
=
j
.
vertexNormalsWorld
[
x
];
P
.
copy
(
J
[
x
]);
R
.
multiplyVector3
(
P
)}
x
=
0
;
for
(
M
=
Q
.
length
;
x
<
M
;
x
++
)
if
(
T
=
Q
[
x
][
B
]){
J
=
0
;
for
(
P
=
T
.
length
;
J
<
P
;
J
++
)
j
.
uvs
[
x
][
J
]
=
T
[
J
]}
j
.
meshMaterials
=
U
;
j
.
faceMaterials
=
H
.
materials
;
j
.
overdraw
=
V
;
j
.
z
=
j
.
centroidScreen
.
z
;
z
.
push
(
j
)}}}}
else
if
(
y
instanceof
THREE
.
Line
){
I
.
multiply
(
o
,
O
);
B
=
y
.
geometry
.
vertices
;
x
=
a
();
x
.
positionScreen
.
copy
(
B
[
0
].
position
);
I
.
multiplyVector4
(
x
.
positionScreen
);
A
=
1
;
for
(
H
=
B
.
length
;
A
<
H
;
A
++
){
x
=
a
();
x
.
positionScreen
.
copy
(
B
[
A
].
position
);
I
.
multiplyVector4
(
x
.
positionScreen
);
M
=
h
[
i
-
2
];
K
.
copy
(
x
.
positionScreen
);
L
.
copy
(
M
.
positionScreen
);
if
(
c
(
K
,
L
)){
K
.
multiplyScalar
(
1
/
K
.
w
);
L
.
multiplyScalar
(
1
/
L
.
w
);
O
=
q
[
k
]
=
q
[
k
]
||
new
THREE
.
RenderableLine
;
k
++
;
n
=
O
;
n
.
v1
.
positionScreen
.
copy
(
K
);
n
.
v2
.
positionScreen
.
copy
(
L
);
n
.
z
=
Math
.
max
(
K
.
z
,
L
.
z
);
n
.
materials
=
y
.
materials
;
z
.
push
(
n
)}}}
else
if
(
y
instanceof
THREE
.
Particle
){
v
.
set
(
y
.
position
.
x
,
y
.
position
.
y
,
y
.
position
.
z
,
1
);
o
.
multiplyVector4
(
v
);
v
.
z
/=
v
.
w
;
if
(
v
.
z
>
0
&&
v
.
z
<
1
){
O
=
u
[
s
]
=
u
[
s
]
||
new
THREE
.
RenderableParticle
;
s
++
;
p
=
O
;
p
.
x
=
v
.
x
/
v
.
w
;
p
.
y
=
v
.
y
/
v
.
w
;
p
.
z
=
v
.
z
;
p
.
rotation
=
y
.
rotation
.
z
;
p
.
scale
.
x
=
y
.
scale
.
x
*
Math
.
abs
(
p
.
x
-
(
v
.
x
+
r
.
projectionMatrix
.
n11
)
/
(
v
.
w
+
r
.
projectionMatrix
.
n14
));
p
.
scale
.
y
=
y
.
scale
.
y
*
Math
.
abs
(
p
.
y
-
(
v
.
y
+
r
.
projectionMatrix
.
n22
)
/
(
v
.
w
+
r
.
projectionMatrix
.
n24
));
p
.
materials
=
y
.
materials
;
z
.
push
(
p
)}}}}
G
&&
z
.
sort
(
b
);
return
z
}};
THREE
.
DOMRenderer
=
function
(){
THREE
.
Renderer
.
call
(
this
);
var
a
=
null
,
b
=
new
THREE
.
Projector
,
c
,
e
,
d
,
g
;
this
.
domElement
=
document
.
createElement
(
"
div
"
);
this
.
setSize
=
function
(
f
,
i
){
c
=
f
;
e
=
i
;
d
=
c
/
2
;
g
=
e
/
2
};
this
.
render
=
function
(
f
,
i
){
var
h
,
j
,
m
,
l
,
n
,
k
,
q
,
p
;
a
=
b
.
projectScene
(
f
,
i
);
h
=
0
;
for
(
j
=
a
.
length
;
h
<
j
;
h
++
){
n
=
a
[
h
];
if
(
n
instanceof
THREE
.
RenderableParticle
){
q
=
n
.
x
*
d
+
d
;
p
=
n
.
y
*
g
+
g
;
m
=
0
;
for
(
l
=
n
.
material
.
length
;
m
<
l
;
m
++
){
k
=
n
.
material
[
m
];
if
(
k
instanceof
THREE
.
ParticleDOMMaterial
){
k
=
k
.
domElement
;
k
.
style
.
left
=
q
+
"
px
"
;
k
.
style
.
top
=
p
+
"
px
"
}}}}}};
THREE
.
SoundRenderer
=
function
(){
this
.
volume
=
1
;
this
.
domElement
=
document
.
createElement
(
"
div
"
);
this
.
domElement
.
id
=
"
THREESound
"
;
this
.
cameraPosition
=
new
THREE
.
Vector3
;
this
.
soundPosition
=
new
THREE
.
Vector3
;
this
.
render
=
function
(
a
,
b
,
c
){
c
&&
a
.
update
(
undefined
,
!
1
,
b
);
c
=
a
.
sounds
;
var
e
,
d
=
c
.
length
;
for
(
e
=
0
;
e
<
d
;
e
++
){
a
=
c
[
e
];
this
.
soundPosition
.
set
(
a
.
matrixWorld
.
n14
,
a
.
matrixWorld
.
n24
,
a
.
matrixWorld
.
n34
);
this
.
soundPosition
.
subSelf
(
b
.
position
);
if
(
a
.
isPlaying
&&
a
.
isLoaded
){
a
.
isAddedToDOM
||
a
.
addToDOM
(
this
.
domElement
);
a
.
calculateVolumeAndPan
(
this
.
soundPosition
)}}}};
THREE
.
RenderableParticle
=
function
(){
this
.
rotation
=
this
.
z
=
this
.
y
=
this
.
x
=
null
;
this
.
scale
=
new
THREE
.
Vector2
;
this
.
materials
=
null
};
build/custom/ThreeExtras.js
浏览文件 @
3b6b3dc5
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
3b6b3dc5
此差异已折叠。
点击以展开。
build/custom/ThreeWebGL.js
浏览文件 @
3b6b3dc5
此差异已折叠。
点击以展开。
examples/misc_lights_test.html
浏览文件 @
3b6b3dc5
...
...
@@ -164,9 +164,11 @@
bwebgl
.
addEventListener
(
"
click
"
,
toggleWebGL
,
false
);
var
loader
=
new
THREE
.
Loader
();
//loader.loadAscii( { model: "obj/torus/Torus_slim.js", callback: function( geometry ) { createMesh( geometry ) } } );
loader
.
loadBinary
(
{
model
:
"
obj/torus/Torus_bin.js
"
,
callback
:
function
(
geometry
)
{
createMesh
(
geometry
)
}
}
);
//var loader = new THREE.JSONLoader();
//loader.load( { model: "obj/torus/Torus_slim.js", callback: function( geometry ) { createMesh( geometry ) } } );
var
loader
=
new
THREE
.
BinaryLoader
();
loader
.
load
(
{
model
:
"
obj/torus/Torus_bin.js
"
,
callback
:
function
(
geometry
)
{
createMesh
(
geometry
)
}
}
);
}
...
...
examples/misc_materials_multimaterials.html
浏览文件 @
3b6b3dc5
...
...
@@ -159,11 +159,12 @@
bcanvas
.
addEventListener
(
"
click
"
,
toggleCanvas
,
false
);
bwebgl
.
addEventListener
(
"
click
"
,
toggleWebGL
,
false
);
var
loader
=
new
THREE
.
Loader
(),
//var loader = new THREE.BinaryLoader(),
var
loader
=
new
THREE
.
JSONLoader
(),
callback
=
function
(
geometry
)
{
createScene
(
geometry
)
};
loader
.
load
Ascii
(
{
model
:
"
obj/female02/Female02_slim.js
"
,
callback
:
callback
}
);
//loader.load
Binary
( { model: "obj/female02/Female02_bin.js", callback: callback } );
loader
.
load
(
{
model
:
"
obj/female02/Female02_slim.js
"
,
callback
:
callback
}
);
//loader.load( { model: "obj/female02/Female02_bin.js", callback: callback } );
}
...
...
examples/webgl_geometry_dynamic.html
浏览文件 @
3b6b3dc5
...
...
@@ -95,9 +95,9 @@
}
for
(
i
=
0
;
i
<
geometry
.
uvs
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
geometry
.
faceVertexUvs
[
0
]
.
length
;
i
++
)
{
var
uvs
=
geometry
.
uvs
[
i
];
var
uvs
=
geometry
.
faceVertexUvs
[
0
]
[
i
];
for
(
j
=
0
,
jl
=
uvs
.
length
;
j
<
jl
;
j
++
)
{
uvs
[
j
].
u
*=
5
;
...
...
examples/webgl_lights_pointlights.html
浏览文件 @
3b6b3dc5
...
...
@@ -69,7 +69,8 @@
scene
=
new
THREE
.
Scene
();
loader
=
new
THREE
.
Loader
(
true
);
//loader = new THREE.JSONLoader( true );
loader
=
new
THREE
.
BinaryLoader
(
true
);
document
.
body
.
appendChild
(
loader
.
statusDomElement
);
var
callback
=
function
(
geometry
)
{
...
...
@@ -83,8 +84,8 @@
};
//loader.load
Ascii
( { model: "obj/walt/WaltHead_slim.js", callback: callback } );
loader
.
load
Binary
(
{
model
:
"
obj/walt/WaltHead_bin.js
"
,
callback
:
callback
}
);
//loader.load( { model: "obj/walt/WaltHead_slim.js", callback: callback } );
loader
.
load
(
{
model
:
"
obj/walt/WaltHead_bin.js
"
,
callback
:
callback
}
);
/*
var directionalLight = new THREE.DirectionalLight( 0x111111, 0.9 );
...
...
examples/webgl_materials_cars.html
浏览文件 @
3b6b3dc5
...
...
@@ -151,7 +151,7 @@
var
windowHalfX
=
window
.
innerWidth
/
2
;
var
windowHalfY
=
window
.
innerHeight
/
2
;
var
loader
=
new
THREE
.
Loader
(
true
);
var
loader
=
new
THREE
.
Binary
Loader
(
true
);
document
.
body
.
appendChild
(
loader
.
statusDomElement
);
init
();
...
...
@@ -449,7 +449,7 @@
}
loader
.
load
Binary
(
{
model
:
CARS
[
"
veyron
"
].
url
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
"
veyron
"
)
}
}
);
loader
.
load
(
{
model
:
CARS
[
"
veyron
"
].
url
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
"
veyron
"
)
}
}
);
for
(
var
c
in
CARS
)
initCarButton
(
c
);
...
...
@@ -462,7 +462,7 @@
if
(
!
CARS
[
car
].
object
)
{
loader
.
statusDomElement
.
style
.
display
=
"
block
"
;
loader
.
load
Binary
(
{
model
:
CARS
[
car
].
url
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
car
)
}
}
);
loader
.
load
(
{
model
:
CARS
[
car
].
url
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
car
)
}
}
);
}
else
{
...
...
examples/webgl_materials_cars_camaro.html
浏览文件 @
3b6b3dc5
...
...
@@ -144,8 +144,8 @@
camaroMaterials
.
body
.
push
(
[
"
Bronze
"
,
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x150505
,
specular
:
0xee6600
,
shininess
:
10
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.5
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Chrome
"
,
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0xffffff
,
envMap
:
textureCube
,
combine
:
THREE
.
MultiplyOperation
}
)
]
);
var
loader
=
new
THREE
.
Loader
();
loader
.
load
Binary
(
{
model
:
"
obj/camaro/CamaroNoUv_bin.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
camaroMaterials
)
}
}
);
var
loader
=
new
THREE
.
Binary
Loader
();
loader
.
load
(
{
model
:
"
obj/camaro/CamaroNoUv_bin.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
camaroMaterials
)
}
}
);
}
...
...
examples/webgl_materials_cubemap.html
浏览文件 @
3b6b3dc5
...
...
@@ -126,10 +126,10 @@
stats
.
domElement
.
style
.
zIndex
=
100
;
container
.
appendChild
(
stats
.
domElement
);
loader
=
new
THREE
.
Loader
(
true
);
loader
=
new
THREE
.
Binary
Loader
(
true
);
document
.
body
.
appendChild
(
loader
.
statusDomElement
);
loader
.
load
Binary
(
{
model
:
"
obj/walt/WaltHead_bin.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
cubeMaterial1
,
cubeMaterial2
,
cubeMaterial3
)
}
}
);
loader
.
load
(
{
model
:
"
obj/walt/WaltHead_bin.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
cubeMaterial1
,
cubeMaterial2
,
cubeMaterial3
)
}
}
);
}
...
...
examples/webgl_materials_cubemap_refraction.html
浏览文件 @
3b6b3dc5
...
...
@@ -123,10 +123,10 @@
stats
.
domElement
.
style
.
zIndex
=
100
;
container
.
appendChild
(
stats
.
domElement
);
loader
=
new
THREE
.
Loader
(
true
);
loader
=
new
THREE
.
Binary
Loader
(
true
);
document
.
body
.
appendChild
(
loader
.
statusDomElement
);
loader
.
load
Binary
(
{
model
:
'
obj/lucy/Lucy100k_bin.js
'
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
cubeMaterial1
,
cubeMaterial2
,
cubeMaterial3
)
}
}
);
loader
.
load
(
{
model
:
'
obj/lucy/Lucy100k_bin.js
'
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
cubeMaterial1
,
cubeMaterial2
,
cubeMaterial3
)
}
}
);
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
...
...
examples/webgl_materials_normalmap.html
浏览文件 @
3b6b3dc5
...
...
@@ -187,7 +187,7 @@
function
createScene
(
geometry
,
scale
,
material1
,
material2
)
{
//
geometry.computeTangents();
geometry
.
computeTangents
();
//mesh1 = SceneUtils.addMesh( scene, geometry, scale, -scale * 12, 0, 0, 0,0,0, material1 );
mesh2
=
SceneUtils
.
addMesh
(
scene
,
geometry
,
scale
,
scale
*
12
,
0
,
0
,
0
,
0
,
0
,
material2
);
...
...
examples/webgl_materials_normalmap2.html
浏览文件 @
3b6b3dc5
...
...
@@ -52,8 +52,92 @@
</div>
</div>
<!--
<script type="text/javascript" src="../build/Three.js"></script>
-->
<script
type=
"text/javascript"
src=
"../src/Three.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Color.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector4.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Ray.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Rectangle.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Matrix3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Matrix4.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Object3D.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Quaternion.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vertex.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Face3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Face4.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/UV.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Geometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Spline.js"
></script>
<script
type=
"text/javascript"
src=
"../src/animation/AnimationHandler.js"
></script>
<script
type=
"text/javascript"
src=
"../src/animation/Animation.js"
></script>
<script
type=
"text/javascript"
src=
"../src/cameras/Camera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/Light.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/AmbientLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/DirectionalLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/PointLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Material.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Mappings.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/LineBasicMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshBasicMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshLambertMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshPhongMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshDepthMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshNormalMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshFaceMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/MeshShaderMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/ParticleBasicMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/ParticleCanvasMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/ParticleDOMMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Texture.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/RenderTarget.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Uniforms.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Particle.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/ParticleSystem.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Line.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Mesh.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Bone.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/SkinnedMesh.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Ribbon.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Sound.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/LOD.js"
></script>
<script
type=
"text/javascript"
src=
"../src/scenes/Scene.js"
></script>
<script
type=
"text/javascript"
src=
"../src/scenes/Fog.js"
></script>
<script
type=
"text/javascript"
src=
"../src/scenes/FogExp2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/Projector.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/DOMRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/CanvasRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/SVGRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/WebGLShaders.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/WebGLRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/SoundRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableVertex.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableFace3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableObject.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableParticle.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableLine.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/GeometryUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/ImageUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/SceneUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/ShaderUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/QuakeCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/PathCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Cube.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Cylinder.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Icosahedron.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Lathe.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Plane.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Sphere.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Torus.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/TorusKnot.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/io/Loader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/io/JSONLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/io/BinaryLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/objects/MarchingCubes.js"
></script>
<script
type=
"text/javascript"
src=
"js/Detector.js"
></script>
<script
type=
"text/javascript"
src=
"js/RequestAnimationFrame.js"
></script>
<script
type=
"text/javascript"
src=
"js/Stats.js"
></script>
...
...
@@ -166,7 +250,7 @@
function
createScene
(
geometry
,
scale
,
material
)
{
//
geometry.computeTangents();
geometry
.
computeTangents
();
material
=
new
THREE
.
MeshFaceMaterial
();
mesh1
=
SceneUtils
.
addMesh
(
scene
,
geometry
,
scale
,
0
,
-
50
,
0
,
0
,
0
,
0
,
material
);
...
...
examples/webgl_materials_shaders.html
浏览文件 @
3b6b3dc5
...
...
@@ -187,9 +187,11 @@
bcanvas
.
addEventListener
(
"
click
"
,
toggleCanvas
,
false
);
bwebgl
.
addEventListener
(
"
click
"
,
toggleWebGL
,
false
);
var
loader
=
new
THREE
.
Loader
();
loader
.
loadAscii
(
{
model
:
"
obj/torus/Torus_slim.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
)
}
}
);
//loader.loadBinary( { model: "obj/torus/Torus_bin.js", callback: function( geometry ) { createScene( geometry ) } } );
var
loader
=
new
THREE
.
JSONLoader
();
loader
.
load
(
{
model
:
"
obj/torus/Torus_slim.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
)
}
}
);
//var loader = new THREE.BinaryLoader();
//loader.load( { model: "obj/torus/Torus_bin.js", callback: function( geometry ) { createScene( geometry ) } } );
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
...
...
examples/webgl_materials_texture_filters.html
浏览文件 @
3b6b3dc5
...
...
@@ -126,14 +126,14 @@
var
i
,
j
,
uvs
,
geometryRepeat
=
new
Plane
(
100
,
100
,
1
,
1
);
for
(
i
=
0
;
i
<
geometryRepeat
.
uvs
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
geometryRepeat
.
faceVertexUvs
[
0
]
.
length
;
i
++
)
{
uvs
=
geometryRepeat
.
uvs
[
i
];
uvs
=
geometryRepeat
.
faceVertexUvs
[
0
][
i
];
for
(
j
=
0
;
j
<
uvs
.
length
;
j
++
)
{
uvs
[
j
].
u
*=
1000
;
uvs
[
j
].
v
*=
1000
;
uvs
[
j
].
u
*=
1000
;
uvs
[
j
].
v
*=
1000
;
}
...
...
examples/webgl_materials_video.html
浏览文件 @
3b6b3dc5
...
...
@@ -180,9 +180,9 @@
var
i
,
j
,
uv
;
for
(
i
=
0
;
i
<
geometry
.
uvs
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
geometry
.
faceVertexUvs
[
0
]
.
length
;
i
++
)
{
uv
=
geometry
.
uvs
[
i
];
uv
=
geometry
.
faceVertexUvs
[
0
]
[
i
];
for
(
j
=
0
;
j
<
uv
.
length
;
j
++
)
{
...
...
examples/webgl_morphtargets.html
浏览文件 @
3b6b3dc5
...
...
@@ -120,7 +120,7 @@
for
(
var
v
=
0
;
v
<
geometry
.
vertices
.
length
;
v
++
)
{
vertices
.
push
(
new
THREE
.
Vertex
(
geometry
.
vertices
[
v
].
position
.
clone
()
,
geometry
.
vertices
[
v
].
normal
.
clone
())
)
vertices
.
push
(
new
THREE
.
Vertex
(
geometry
.
vertices
[
v
].
position
.
clone
()
)
)
if
(
v
===
i
)
{
...
...
examples/webgl_objconvert_test.html
浏览文件 @
3b6b3dc5
...
...
@@ -192,6 +192,7 @@
bcanvas
.
addEventListener
(
"
click
"
,
toggleCanvas
,
false
);
bwebgl
.
addEventListener
(
"
click
"
,
toggleWebGL
,
false
);
//var loader = new THREE.BinaryLoader(),
var
loader
=
new
THREE
.
JSONLoader
(),
callbackMale
=
function
(
geometry
)
{
createScene
(
geometry
,
90
,
50
,
FLOOR
,
105
)
},
callbackFemale
=
function
(
geometry
)
{
createScene
(
geometry
,
-
80
,
50
,
FLOOR
,
0
)
};
...
...
@@ -199,8 +200,8 @@
loader
.
load
(
{
model
:
"
obj/male02/Male02_slim.js
"
,
callback
:
callbackMale
}
);
loader
.
load
(
{
model
:
"
obj/female02/Female02_slim.js
"
,
callback
:
callbackFemale
}
);
//loader.load
Binary
( { model: "obj/male02/Male02_bin.js", callback: callbackMale } );
//loader.load
Binary
( { model: "obj/female02/Female02_bin.js", callback: callbackFemale } );
//loader.load( { model: "obj/male02/Male02_bin.js", callback: callbackMale } );
//loader.load( { model: "obj/female02/Female02_bin.js", callback: callbackFemale } );
}
...
...
examples/webgl_postprocessing.html
浏览文件 @
3b6b3dc5
...
...
@@ -176,9 +176,9 @@
quadBG
.
position
.
z
=
-
500
;
sceneBG
.
addObject
(
quadBG
);
loader
=
new
THREE
.
Loader
(
true
);
loader
=
new
THREE
.
JSON
Loader
(
true
);
document
.
body
.
appendChild
(
loader
.
statusDomElement
);
loader
.
load
Ascii
(
{
model
:
"
obj/leeperrysmith/LeePerrySmith.js
"
,
callback
:
function
(
geometry
)
{
createMesh
(
geometry
,
sceneModel
,
100
)
}
}
);
loader
.
load
(
{
model
:
"
obj/leeperrysmith/LeePerrySmith.js
"
,
callback
:
function
(
geometry
)
{
createMesh
(
geometry
,
sceneModel
,
100
)
}
}
);
quadScreen
=
new
THREE
.
Mesh
(
plane
,
materialConvolution
);
quadScreen
.
position
.
z
=
-
100
;
...
...
examples/webgl_rtt.html
浏览文件 @
3b6b3dc5
...
...
@@ -156,8 +156,8 @@
quad
.
position
.
z
=
-
100
;
sceneRTT
.
addObject
(
quad
);
var
loader
=
new
THREE
.
Loader
();
loader
.
load
Binary
(
{
model
:
"
obj/torus/Torus_bin.js
"
,
callback
:
function
(
geometry
)
{
createMesh
(
geometry
,
sceneRTT
)
}
}
);
var
loader
=
new
THREE
.
Binary
Loader
();
loader
.
load
(
{
model
:
"
obj/torus/Torus_bin.js
"
,
callback
:
function
(
geometry
)
{
createMesh
(
geometry
,
sceneRTT
)
}
}
);
quad
=
new
THREE
.
Mesh
(
plane
,
materialScreen
);
quad
.
position
.
z
=
-
100
;
...
...
src/extras/SceneUtils.js
浏览文件 @
3b6b3dc5
...
...
@@ -16,13 +16,14 @@ var SceneUtils = {
geometry
,
material
,
camera
,
fog
,
texture
,
images
,
materials
,
data
,
l
oader
,
data
,
binLoader
,
jsonL
oader
,
counter_models
,
counter_textures
,
total_models
,
total_textures
,
result
;
data
=
event
.
data
;
loader
=
new
THREE
.
Loader
();
binLoader
=
new
THREE
.
BinaryLoader
();
jsonLoader
=
new
THREE
.
JSONLoader
();
counter_models
=
0
;
counter_textures
=
0
;
...
...
@@ -290,15 +291,15 @@ var SceneUtils = {
}
else
if
(
g
.
type
==
"
bin_mesh
"
)
{
loader
.
loadBinary
(
{
model
:
g
.
url
,
callback
:
create_callback
(
dg
)
}
);
binLoader
.
load
(
{
model
:
g
.
url
,
callback
:
create_callback
(
dg
)
}
);
}
else
if
(
g
.
type
==
"
ascii_mesh
"
)
{
loader
.
loadAscii
(
{
model
:
g
.
url
,
callback
:
create_callback
(
dg
)
}
);
jsonLoader
.
load
(
{
model
:
g
.
url
,
callback
:
create_callback
(
dg
)
}
);
}
...
...
src/extras/io/BinaryLoader.js
浏览文件 @
3b6b3dc5
...
...
@@ -711,7 +711,8 @@ THREE.BinaryLoader.prototype = {
scope
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
,
[
new
THREE
.
Vector3
(
nax
,
nay
,
naz
),
new
THREE
.
Vector3
(
nbx
,
nby
,
nbz
),
new
THREE
.
Vector3
(
ncx
,
ncy
,
ncz
)],
new
THREE
.
Vector3
(
ncx
,
ncy
,
ncz
)],
null
,
material
)
);
},
...
...
@@ -739,7 +740,8 @@ THREE.BinaryLoader.prototype = {
[
new
THREE
.
Vector3
(
nax
,
nay
,
naz
),
new
THREE
.
Vector3
(
nbx
,
nby
,
nbz
),
new
THREE
.
Vector3
(
ncx
,
ncy
,
ncz
),
new
THREE
.
Vector3
(
ndx
,
ndy
,
ndz
)],
new
THREE
.
Vector3
(
ndx
,
ndy
,
ndz
)],
null
,
material
)
);
},
...
...
src/extras/io/JSONLoader.js
浏览文件 @
3b6b3dc5
...
...
@@ -53,6 +53,7 @@ THREE.JSONLoader.prototype = {
parse
();
init_skin
();
init_morphing
();
this
.
computeCentroids
();
this
.
computeFaceNormals
();
...
...
@@ -311,6 +312,33 @@ THREE.JSONLoader.prototype = {
};
function
init_morphing
()
{
if
(
json
.
morphTargets
!==
undefined
)
{
var
i
,
l
,
v
,
vl
;
for
(
i
=
0
,
l
=
json
.
morphTargets
.
length
;
i
<
l
;
i
++
)
{
scope
.
morphTargets
[
i
]
=
{};
scope
.
morphTargets
[
i
].
name
=
json
.
morphTargets
[
i
].
name
;
scope
.
morphTargets
[
i
].
vertices
=
[];
dstVertices
=
scope
.
morphTargets
[
i
].
vertices
;
srcVertices
=
json
.
morphTargets
[
i
].
vertices
;
for
(
v
=
0
,
vl
=
srcVertices
.
length
;
v
<
vl
;
v
+=
3
)
{
dstVertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
srcVertices
[
v
],
srcVertices
[
v
+
1
],
srcVertices
[
v
+
2
]
)
)
);
}
}
}
};
};
Model
.
prototype
=
new
THREE
.
Geometry
();
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
3b6b3dc5
...
...
@@ -3519,7 +3519,7 @@ THREE.WebGLRenderer = function ( parameters ) {
m
=
materials
[
i
];
if
(
m
instanceof
THREE
.
MeshBasicMaterial
||
m
instanceof
THREE
.
MeshDepthMaterial
)
continue
;
if
(
(
m
instanceof
THREE
.
MeshBasicMaterial
&&
!
m
.
envMap
)
||
m
instanceof
THREE
.
MeshDepthMaterial
)
continue
;
if
(
materialNeedsSmoothNormals
(
m
)
)
{
...
...
@@ -3547,7 +3547,7 @@ THREE.WebGLRenderer = function ( parameters ) {
m
=
materials
[
i
];
if
(
m
.
map
||
m
.
lightMap
)
{
if
(
m
.
map
||
m
.
lightMap
||
m
instanceof
THREE
.
MeshShaderMaterial
)
{
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录