Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
93468b00
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93468b00
编写于
9月 07, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'remotes/mrdoob/dev' into dev
上级
0959969f
cec75333
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
502 addition
and
566 deletion
+502
-566
README.md
README.md
+1
-1
build/Three.js
build/Three.js
+305
-304
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+21
-21
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+1
-1
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+84
-83
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+4
-4
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
examples/misc_lookat.html
examples/misc_lookat.html
+11
-9
examples/misc_ubiquity_test.html
examples/misc_ubiquity_test.html
+1
-109
examples/webgl_materials_cars.html
examples/webgl_materials_cars.html
+3
-2
examples/webgl_materials_cubemap.html
examples/webgl_materials_cubemap.html
+1
-1
examples/webgl_materials_cubemap_balls_reflection.html
examples/webgl_materials_cubemap_balls_reflection.html
+3
-2
examples/webgl_materials_cubemap_balls_refraction.html
examples/webgl_materials_cubemap_balls_refraction.html
+3
-2
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
...s/webgl_materials_cubemap_balls_refraction_crosseyed.html
+1
-1
src/core/Rectangle.js
src/core/Rectangle.js
+1
-11
src/extras/GeometryUtils.js
src/extras/GeometryUtils.js
+51
-6
src/extras/geometries/CylinderGeometry.js
src/extras/geometries/CylinderGeometry.js
+2
-0
src/renderers/CanvasRenderer.js
src/renderers/CanvasRenderer.js
+5
-5
src/renderers/SVGRenderer.js
src/renderers/SVGRenderer.js
+3
-3
未找到文件。
README.md
浏览文件 @
93468b00
...
...
@@ -10,7 +10,7 @@ The aim of the project is to create a lightweight 3D engine with a very low leve
More?
[
#three.js on irc.freenode.net
](
http://webchat.freenode.net/?channels=three.js
)
###
Examples
###
###
Featured Examples ([View all](http://mrdoob.github.com/three.js/))
###
#### WebGL (Context 3D) ####
...
...
build/Three.js
浏览文件 @
93468b00
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
93468b00
此差异已折叠。
点击以展开。
build/custom/ThreeDOM.js
浏览文件 @
93468b00
...
...
@@ -20,7 +20,7 @@ Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,j,i,l,k,m,n,p=a.geometry,q=p
k
=
n
.
dot
(
l
),
a
.
doubleSided
||
(
a
.
flipSided
?
k
>
0
:
k
<
0
)))
if
(
k
=
l
.
dot
((
new
THREE
.
Vector3
).
sub
(
f
,
m
))
/
k
,
m
=
m
.
addSelf
(
n
.
multiplyScalar
(
k
)),
g
instanceof
THREE
.
Face3
)
c
(
m
,
f
,
h
,
j
)
&&
(
g
=
{
distance
:
this
.
origin
.
distanceTo
(
m
),
point
:
m
,
face
:
g
,
object
:
a
},
s
.
push
(
g
));
else
if
(
g
instanceof
THREE
.
Face4
&&
(
c
(
m
,
f
,
h
,
i
)
||
c
(
m
,
h
,
j
,
i
)))
g
=
{
distance
:
this
.
origin
.
distanceTo
(
m
),
point
:
m
,
face
:
g
,
object
:
a
},
s
.
push
(
g
);
s
.
sort
(
function
(
a
,
b
){
return
a
.
distance
-
b
.
distance
});
return
s
}
else
return
[]}};
THREE
.
Rectangle
=
function
(){
function
a
(){
g
=
d
-
b
;
f
=
e
-
c
}
var
b
,
c
,
d
,
e
,
g
,
f
,
h
=!
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
d
};
this
.
getBottom
=
function
(){
return
e
};
this
.
set
=
function
(
f
,
g
,
l
,
k
){
h
=!
1
;
b
=
f
;
c
=
g
;
d
=
l
;
e
=
k
;
a
()};
this
.
addPoint
=
function
(
f
,
g
){
h
?(
h
=!
1
,
b
=
f
,
c
=
g
,
d
=
f
,
e
=
g
):(
b
=
b
<
f
?
b
:
f
,
c
=
c
<
g
?
c
:
g
,
d
=
d
>
f
?
d
:
f
,
e
=
e
>
g
?
e
:
g
);
a
()};
this
.
add3Points
=
function
(
f
,
g
,
l
,
k
,
m
,
n
){
h
?(
h
=!
1
,
b
=
f
<
l
?
f
<
m
?
f
:
m
:
l
<
m
?
l
:
m
,
c
=
g
<
k
?
g
<
n
?
g
:
n
:
k
<
n
?
k
:
n
,
d
=
f
>
l
?
f
>
m
?
f
:
m
:
l
>
m
?
l
:
m
,
e
=
g
>
k
?
g
>
n
?
g
:
n
:
k
>
n
?
k
:
n
):(
b
=
f
<
l
?
f
<
m
?
f
<
b
?
f
:
b
:
m
<
b
?
m
:
b
:
l
<
m
?
l
<
b
?
l
:
b
:
m
<
b
?
m
:
b
,
c
=
g
<
k
?
g
<
n
?
g
<
c
?
g
:
c
:
n
<
c
?
n
:
c
:
k
<
n
?
k
<
c
?
k
:
c
:
n
<
c
?
n
:
c
,
d
=
f
>
l
?
f
>
m
?
f
>
d
?
f
:
d
:
m
>
d
?
m
:
d
:
l
>
m
?
l
>
d
?
l
:
d
:
m
>
d
?
m
:
d
,
e
=
g
>
k
?
g
>
n
?
g
>
e
?
g
:
e
:
n
>
e
?
n
:
e
:
k
>
n
?
k
>
e
?
k
:
e
:
n
>
e
?
n
:
e
);
a
()};
this
.
addRectangle
=
function
(
f
){
h
?(
h
=!
1
,
b
=
f
.
getLeft
(),
c
=
f
.
getTop
(),
d
=
f
.
getRight
(),
e
=
f
.
getBottom
()):(
b
=
b
<
f
.
getLeft
()?
b
:
f
.
getLeft
(),
c
=
c
<
f
.
getTop
()?
c
:
f
.
getTop
(),
d
=
d
>
f
.
getRight
()?
d
:
f
.
getRight
(),
e
=
e
>
f
.
getBottom
()?
e
:
f
.
getBottom
());
a
()};
this
.
inflate
=
function
(
f
){
b
-=
f
;
c
-=
f
;
d
+=
f
;
e
+=
f
;
a
()};
this
.
minSelf
=
function
(
f
){
b
=
b
>
f
.
getLeft
()?
b
:
f
.
getLeft
();
c
=
c
>
f
.
getTop
()?
c
:
f
.
getTop
();
d
=
d
<
f
.
getRight
()?
d
:
f
.
getRight
();
e
=
e
<
f
.
getBottom
()?
e
:
f
.
getBottom
();
a
()};
this
.
in
s
tersects
=
function
(
a
){
return
Math
.
min
(
d
,
a
.
getRight
())
-
Math
.
max
(
b
,
a
.
getLeft
())
>=
0
&&
Math
.
min
(
e
,
a
.
getBottom
())
-
Math
.
max
(
c
,
a
.
getTop
())
>=
0
};
this
.
empty
=
function
(){
h
=!
0
;
e
=
d
=
c
=
b
=
0
;
a
()};
this
.
isEmpty
=
function
(){
return
h
}};
THREE
.
Matrix3
=
function
(){
this
.
m
=
[]};
f
.
getBottom
()?
e
:
f
.
getBottom
());
a
()};
this
.
inflate
=
function
(
f
){
b
-=
f
;
c
-=
f
;
d
+=
f
;
e
+=
f
;
a
()};
this
.
minSelf
=
function
(
f
){
b
=
b
>
f
.
getLeft
()?
b
:
f
.
getLeft
();
c
=
c
>
f
.
getTop
()?
c
:
f
.
getTop
();
d
=
d
<
f
.
getRight
()?
d
:
f
.
getRight
();
e
=
e
<
f
.
getBottom
()?
e
:
f
.
getBottom
();
a
()};
this
.
intersects
=
function
(
a
){
return
Math
.
min
(
d
,
a
.
getRight
())
-
Math
.
max
(
b
,
a
.
getLeft
())
>=
0
&&
Math
.
min
(
e
,
a
.
getBottom
())
-
Math
.
max
(
c
,
a
.
getTop
())
>=
0
};
this
.
empty
=
function
(){
h
=!
0
;
e
=
d
=
c
=
b
=
0
;
a
()};
this
.
isEmpty
=
function
(){
return
h
}};
THREE
.
Matrix3
=
function
(){
this
.
m
=
[]};
THREE
.
Matrix3
.
prototype
=
{
constructor
:
THREE
.
Matrix3
,
transpose
:
function
(){
var
a
,
b
=
this
.
m
;
a
=
b
[
1
];
b
[
1
]
=
b
[
3
];
b
[
3
]
=
a
;
a
=
b
[
2
];
b
[
2
]
=
b
[
6
];
b
[
6
]
=
a
;
a
=
b
[
5
];
b
[
5
]
=
b
[
7
];
b
[
7
]
=
a
;
return
this
},
transposeIntoArray
:
function
(
a
){
var
b
=
this
.
m
;
a
[
0
]
=
b
[
0
];
a
[
1
]
=
b
[
3
];
a
[
2
]
=
b
[
6
];
a
[
3
]
=
b
[
1
];
a
[
4
]
=
b
[
4
];
a
[
5
]
=
b
[
7
];
a
[
6
]
=
b
[
2
];
a
[
7
]
=
b
[
5
];
a
[
8
]
=
b
[
8
];
return
this
}};
THREE
.
Matrix4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
,
h
,
j
,
i
,
l
,
k
,
m
,
n
,
p
,
q
){
this
.
set
(
a
||
1
,
b
||
0
,
c
||
0
,
d
||
0
,
e
||
0
,
g
||
1
,
f
||
0
,
h
||
0
,
j
||
0
,
i
||
0
,
l
||
1
,
k
||
0
,
m
||
0
,
n
||
0
,
p
||
0
,
q
||
1
);
this
.
flat
=
Array
(
16
);
this
.
m33
=
new
THREE
.
Matrix3
};
THREE
.
Matrix4
.
prototype
=
{
constructor
:
THREE
.
Matrix4
,
set
:
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
,
h
,
j
,
i
,
l
,
k
,
m
,
n
,
p
,
q
){
this
.
n11
=
a
;
this
.
n12
=
b
;
this
.
n13
=
c
;
this
.
n14
=
d
;
this
.
n21
=
e
;
this
.
n22
=
g
;
this
.
n23
=
f
;
this
.
n24
=
h
;
this
.
n31
=
j
;
this
.
n32
=
i
;
this
.
n33
=
l
;
this
.
n34
=
k
;
this
.
n41
=
m
;
this
.
n42
=
n
;
this
.
n43
=
p
;
this
.
n44
=
q
;
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
d
=
THREE
.
Matrix4
.
__v1
,
e
=
THREE
.
Matrix4
.
__v2
,
g
=
THREE
.
Matrix4
.
__v3
;
g
.
sub
(
a
,
b
).
normalize
();
if
(
g
.
length
()
===
0
)
g
.
z
=
1
;
d
.
cross
(
c
,
g
).
normalize
();
d
.
length
()
===
0
&&
(
g
.
x
+=
1.0
E
-
4
,
d
.
cross
(
c
,
g
).
normalize
());
e
.
cross
(
g
,
d
).
normalize
();
this
.
n11
=
d
.
x
;
this
.
n12
=
e
.
x
;
this
.
n13
=
g
.
x
;
this
.
n21
=
d
.
y
;
this
.
n22
=
e
.
y
;
this
.
n23
=
g
.
y
;
this
.
n31
=
d
.
z
;
this
.
n32
=
e
.
z
;
this
.
n33
=
g
.
z
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
e
;
...
...
build/custom/ThreeExtras.js
浏览文件 @
93468b00
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
93468b00
...
...
@@ -20,7 +20,7 @@ Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,k,i,l,j,m,n,p=a.geometry,q=p
j
=
n
.
dot
(
l
),
a
.
doubleSided
||
(
a
.
flipSided
?
j
>
0
:
j
<
0
)))
if
(
j
=
l
.
dot
((
new
THREE
.
Vector3
).
sub
(
f
,
m
))
/
j
,
m
=
m
.
addSelf
(
n
.
multiplyScalar
(
j
)),
g
instanceof
THREE
.
Face3
)
c
(
m
,
f
,
h
,
k
)
&&
(
g
=
{
distance
:
this
.
origin
.
distanceTo
(
m
),
point
:
m
,
face
:
g
,
object
:
a
},
v
.
push
(
g
));
else
if
(
g
instanceof
THREE
.
Face4
&&
(
c
(
m
,
f
,
h
,
i
)
||
c
(
m
,
h
,
k
,
i
)))
g
=
{
distance
:
this
.
origin
.
distanceTo
(
m
),
point
:
m
,
face
:
g
,
object
:
a
},
v
.
push
(
g
);
v
.
sort
(
function
(
a
,
b
){
return
a
.
distance
-
b
.
distance
});
return
v
}
else
return
[]}};
THREE
.
Rectangle
=
function
(){
function
a
(){
g
=
d
-
b
;
f
=
e
-
c
}
var
b
,
c
,
d
,
e
,
g
,
f
,
h
=!
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
d
};
this
.
getBottom
=
function
(){
return
e
};
this
.
set
=
function
(
f
,
g
,
l
,
j
){
h
=!
1
;
b
=
f
;
c
=
g
;
d
=
l
;
e
=
j
;
a
()};
this
.
addPoint
=
function
(
f
,
g
){
h
?(
h
=!
1
,
b
=
f
,
c
=
g
,
d
=
f
,
e
=
g
):(
b
=
b
<
f
?
b
:
f
,
c
=
c
<
g
?
c
:
g
,
d
=
d
>
f
?
d
:
f
,
e
=
e
>
g
?
e
:
g
);
a
()};
this
.
add3Points
=
function
(
f
,
g
,
l
,
j
,
m
,
n
){
h
?(
h
=!
1
,
b
=
f
<
l
?
f
<
m
?
f
:
m
:
l
<
m
?
l
:
m
,
c
=
g
<
j
?
g
<
n
?
g
:
n
:
j
<
n
?
j
:
n
,
d
=
f
>
l
?
f
>
m
?
f
:
m
:
l
>
m
?
l
:
m
,
e
=
g
>
j
?
g
>
n
?
g
:
n
:
j
>
n
?
j
:
n
):(
b
=
f
<
l
?
f
<
m
?
f
<
b
?
f
:
b
:
m
<
b
?
m
:
b
:
l
<
m
?
l
<
b
?
l
:
b
:
m
<
b
?
m
:
b
,
c
=
g
<
j
?
g
<
n
?
g
<
c
?
g
:
c
:
n
<
c
?
n
:
c
:
j
<
n
?
j
<
c
?
j
:
c
:
n
<
c
?
n
:
c
,
d
=
f
>
l
?
f
>
m
?
f
>
d
?
f
:
d
:
m
>
d
?
m
:
d
:
l
>
m
?
l
>
d
?
l
:
d
:
m
>
d
?
m
:
d
,
e
=
g
>
j
?
g
>
n
?
g
>
e
?
g
:
e
:
n
>
e
?
n
:
e
:
j
>
n
?
j
>
e
?
j
:
e
:
n
>
e
?
n
:
e
);
a
()};
this
.
addRectangle
=
function
(
f
){
h
?(
h
=!
1
,
b
=
f
.
getLeft
(),
c
=
f
.
getTop
(),
d
=
f
.
getRight
(),
e
=
f
.
getBottom
()):(
b
=
b
<
f
.
getLeft
()?
b
:
f
.
getLeft
(),
c
=
c
<
f
.
getTop
()?
c
:
f
.
getTop
(),
d
=
d
>
f
.
getRight
()?
d
:
f
.
getRight
(),
e
=
e
>
f
.
getBottom
()?
e
:
f
.
getBottom
());
a
()};
this
.
inflate
=
function
(
f
){
b
-=
f
;
c
-=
f
;
d
+=
f
;
e
+=
f
;
a
()};
this
.
minSelf
=
function
(
f
){
b
=
b
>
f
.
getLeft
()?
b
:
f
.
getLeft
();
c
=
c
>
f
.
getTop
()?
c
:
f
.
getTop
();
d
=
d
<
f
.
getRight
()?
d
:
f
.
getRight
();
e
=
e
<
f
.
getBottom
()?
e
:
f
.
getBottom
();
a
()};
this
.
in
s
tersects
=
function
(
a
){
return
Math
.
min
(
d
,
a
.
getRight
())
-
Math
.
max
(
b
,
a
.
getLeft
())
>=
0
&&
Math
.
min
(
e
,
a
.
getBottom
())
-
Math
.
max
(
c
,
a
.
getTop
())
>=
0
};
this
.
empty
=
function
(){
h
=!
0
;
e
=
d
=
c
=
b
=
0
;
a
()};
this
.
isEmpty
=
function
(){
return
h
}};
THREE
.
Matrix3
=
function
(){
this
.
m
=
[]};
f
.
getBottom
()?
e
:
f
.
getBottom
());
a
()};
this
.
inflate
=
function
(
f
){
b
-=
f
;
c
-=
f
;
d
+=
f
;
e
+=
f
;
a
()};
this
.
minSelf
=
function
(
f
){
b
=
b
>
f
.
getLeft
()?
b
:
f
.
getLeft
();
c
=
c
>
f
.
getTop
()?
c
:
f
.
getTop
();
d
=
d
<
f
.
getRight
()?
d
:
f
.
getRight
();
e
=
e
<
f
.
getBottom
()?
e
:
f
.
getBottom
();
a
()};
this
.
intersects
=
function
(
a
){
return
Math
.
min
(
d
,
a
.
getRight
())
-
Math
.
max
(
b
,
a
.
getLeft
())
>=
0
&&
Math
.
min
(
e
,
a
.
getBottom
())
-
Math
.
max
(
c
,
a
.
getTop
())
>=
0
};
this
.
empty
=
function
(){
h
=!
0
;
e
=
d
=
c
=
b
=
0
;
a
()};
this
.
isEmpty
=
function
(){
return
h
}};
THREE
.
Matrix3
=
function
(){
this
.
m
=
[]};
THREE
.
Matrix3
.
prototype
=
{
constructor
:
THREE
.
Matrix3
,
transpose
:
function
(){
var
a
,
b
=
this
.
m
;
a
=
b
[
1
];
b
[
1
]
=
b
[
3
];
b
[
3
]
=
a
;
a
=
b
[
2
];
b
[
2
]
=
b
[
6
];
b
[
6
]
=
a
;
a
=
b
[
5
];
b
[
5
]
=
b
[
7
];
b
[
7
]
=
a
;
return
this
},
transposeIntoArray
:
function
(
a
){
var
b
=
this
.
m
;
a
[
0
]
=
b
[
0
];
a
[
1
]
=
b
[
3
];
a
[
2
]
=
b
[
6
];
a
[
3
]
=
b
[
1
];
a
[
4
]
=
b
[
4
];
a
[
5
]
=
b
[
7
];
a
[
6
]
=
b
[
2
];
a
[
7
]
=
b
[
5
];
a
[
8
]
=
b
[
8
];
return
this
}};
THREE
.
Matrix4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
,
h
,
k
,
i
,
l
,
j
,
m
,
n
,
p
,
q
){
this
.
set
(
a
||
1
,
b
||
0
,
c
||
0
,
d
||
0
,
e
||
0
,
g
||
1
,
f
||
0
,
h
||
0
,
k
||
0
,
i
||
0
,
l
||
1
,
j
||
0
,
m
||
0
,
n
||
0
,
p
||
0
,
q
||
1
);
this
.
flat
=
Array
(
16
);
this
.
m33
=
new
THREE
.
Matrix3
};
THREE
.
Matrix4
.
prototype
=
{
constructor
:
THREE
.
Matrix4
,
set
:
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
,
h
,
k
,
i
,
l
,
j
,
m
,
n
,
p
,
q
){
this
.
n11
=
a
;
this
.
n12
=
b
;
this
.
n13
=
c
;
this
.
n14
=
d
;
this
.
n21
=
e
;
this
.
n22
=
g
;
this
.
n23
=
f
;
this
.
n24
=
h
;
this
.
n31
=
k
;
this
.
n32
=
i
;
this
.
n33
=
l
;
this
.
n34
=
j
;
this
.
n41
=
m
;
this
.
n42
=
n
;
this
.
n43
=
p
;
this
.
n44
=
q
;
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
d
=
THREE
.
Matrix4
.
__v1
,
e
=
THREE
.
Matrix4
.
__v2
,
g
=
THREE
.
Matrix4
.
__v3
;
g
.
sub
(
a
,
b
).
normalize
();
if
(
g
.
length
()
===
0
)
g
.
z
=
1
;
d
.
cross
(
c
,
g
).
normalize
();
d
.
length
()
===
0
&&
(
g
.
x
+=
1.0
E
-
4
,
d
.
cross
(
c
,
g
).
normalize
());
e
.
cross
(
g
,
d
).
normalize
();
this
.
n11
=
d
.
x
;
this
.
n12
=
e
.
x
;
this
.
n13
=
g
.
x
;
this
.
n21
=
d
.
y
;
this
.
n22
=
e
.
y
;
this
.
n23
=
g
.
y
;
this
.
n31
=
d
.
z
;
this
.
n32
=
e
.
z
;
this
.
n33
=
g
.
z
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
e
;
...
...
@@ -124,11 +124,11 @@ THREE.MeshDepthMaterial?(E=1-j.__2near/(j.__farPlusNear-i.z*j.__farMinusNear),t.
j
.
opacity
);
k
.
appendChild
(
A
)}
function
d
(
a
){
F
[
a
]
==
null
&&
(
F
[
a
]
=
document
.
createElementNS
(
"
http://www.w3.org/2000/svg
"
,
"
path
"
),
O
==
0
&&
F
[
a
].
setAttribute
(
"
shape-rendering
"
,
"
crispEdges
"
));
return
F
[
a
]}
function
e
(
a
){
a
=
(
a
+
1
)
*
0.5
;
return
a
<
0
?
0
:
a
>
1
?
1
:
a
}
var
g
=
this
,
f
=
null
,
h
=
new
THREE
.
Projector
,
k
=
document
.
createElementNS
(
"
http://www.w3.org/2000/svg
"
,
"
svg
"
),
i
,
l
,
j
,
m
,
n
,
p
,
q
,
v
,
u
=
new
THREE
.
Rectangle
,
C
=
new
THREE
.
Rectangle
,
K
=!
1
,
t
=
new
THREE
.
Color
(
16777215
),
w
=
new
THREE
.
Color
(
16777215
),
z
=
new
THREE
.
Color
(
0
),
y
=
new
THREE
.
Color
(
0
),
o
=
new
THREE
.
Color
(
0
),
E
,
D
=
new
THREE
.
Vector3
,
F
=
[],
G
=
[],
A
,
M
,
N
,
O
=
1
;
this
.
domElement
=
k
;
this
.
sortElements
=
this
.
sortObjects
=
this
.
autoClear
=!
0
;
this
.
data
=
{
vertices
:
0
,
faces
:
0
};
this
.
setQuality
=
function
(
a
){
switch
(
a
){
case
"
high
"
:
O
=
1
;
break
;
case
"
low
"
:
O
=
0
}};
this
.
setSize
=
function
(
a
,
b
){
i
=
a
;
l
=
b
;
j
=
i
/
2
;
m
=
l
/
2
;
k
.
setAttribute
(
"
viewBox
"
,
-
j
+
"
"
+-
m
+
"
"
+
i
+
"
"
+
l
);
k
.
setAttribute
(
"
width
"
,
i
);
k
.
setAttribute
(
"
height
"
,
l
);
u
.
set
(
-
j
,
-
m
,
j
,
m
)};
this
.
clear
=
function
(){
for
(;
k
.
childNodes
.
length
>
0
;)
k
.
removeChild
(
k
.
childNodes
[
0
])};
this
.
render
=
function
(
a
,
d
){
var
e
,
i
,
l
,
r
,
t
,
w
,
s
,
x
;
this
.
autoClear
&&
this
.
clear
();
g
.
data
.
vertices
=
0
;
g
.
data
.
faces
=
0
;
f
=
h
.
projectScene
(
a
,
d
,
this
.
sortElements
);
N
=
M
=
0
;
if
(
K
=
a
.
lights
.
length
>
0
){
s
=
a
.
lights
;
z
.
setRGB
(
0
,
0
,
0
);
y
.
setRGB
(
0
,
0
,
0
);
o
.
setRGB
(
0
,
0
,
0
);
e
=
0
;
for
(
i
=
s
.
length
;
e
<
i
;
e
++
)
l
=
s
[
e
],
r
=
l
.
color
,
l
instanceof
THREE
.
AmbientLight
?(
z
.
r
+=
r
.
r
,
z
.
g
+=
r
.
g
,
z
.
b
+=
r
.
b
):
l
instanceof
THREE
.
DirectionalLight
?(
y
.
r
+=
r
.
r
,
y
.
g
+=
r
.
g
,
y
.
b
+=
r
.
b
):
l
instanceof
THREE
.
PointLight
&&
(
o
.
r
+=
r
.
r
,
o
.
g
+=
r
.
g
,
o
.
b
+=
r
.
b
)}
e
=
0
;
for
(
i
=
f
.
length
;
e
<
i
;
e
++
)
if
(
s
=
f
[
e
],
C
.
empty
(),
s
instanceof
THREE
.
RenderableParticle
){
n
=
s
;
n
.
x
*=
j
;
n
.
y
*=-
m
;
l
=
0
;
for
(
r
=
s
.
materials
.
length
;
l
<
r
;)
l
++
}
else
if
(
s
instanceof
THREE
.
RenderableLine
){
if
(
n
=
s
.
v1
,
p
=
s
.
v2
,
n
.
positionScreen
.
x
*=
j
,
n
.
positionScreen
.
y
*=-
m
,
p
.
positionScreen
.
x
*=
j
,
p
.
positionScreen
.
y
*=-
m
,
C
.
addPoint
(
n
.
positionScreen
.
x
,
n
.
positionScreen
.
y
),
C
.
addPoint
(
p
.
positionScreen
.
x
,
p
.
positionScreen
.
y
),
u
.
in
s
tersects
(
C
)){
l
=
0
;
for
(
r
=
s
.
materials
.
length
;
l
<
r
;)
if
((
x
=
s
.
materials
[
l
++
])
&&
x
.
opacity
!=
0
){
t
=
n
;
w
=
p
;
var
B
=
N
++
;
G
[
B
]
==
null
&&
(
G
[
B
]
=
document
.
createElementNS
(
"
http://www.w3.org/2000/svg
"
,
s
instanceof
THREE
.
RenderableParticle
){
n
=
s
;
n
.
x
*=
j
;
n
.
y
*=-
m
;
l
=
0
;
for
(
r
=
s
.
materials
.
length
;
l
<
r
;)
l
++
}
else
if
(
s
instanceof
THREE
.
RenderableLine
){
if
(
n
=
s
.
v1
,
p
=
s
.
v2
,
n
.
positionScreen
.
x
*=
j
,
n
.
positionScreen
.
y
*=-
m
,
p
.
positionScreen
.
x
*=
j
,
p
.
positionScreen
.
y
*=-
m
,
C
.
addPoint
(
n
.
positionScreen
.
x
,
n
.
positionScreen
.
y
),
C
.
addPoint
(
p
.
positionScreen
.
x
,
p
.
positionScreen
.
y
),
u
.
intersects
(
C
)){
l
=
0
;
for
(
r
=
s
.
materials
.
length
;
l
<
r
;)
if
((
x
=
s
.
materials
[
l
++
])
&&
x
.
opacity
!=
0
){
t
=
n
;
w
=
p
;
var
B
=
N
++
;
G
[
B
]
==
null
&&
(
G
[
B
]
=
document
.
createElementNS
(
"
http://www.w3.org/2000/svg
"
,
"
line
"
),
O
==
0
&&
G
[
B
].
setAttribute
(
"
shape-rendering
"
,
"
crispEdges
"
));
A
=
G
[
B
];
A
.
setAttribute
(
"
x1
"
,
t
.
positionScreen
.
x
);
A
.
setAttribute
(
"
y1
"
,
t
.
positionScreen
.
y
);
A
.
setAttribute
(
"
x2
"
,
w
.
positionScreen
.
x
);
A
.
setAttribute
(
"
y2
"
,
w
.
positionScreen
.
y
);
x
instanceof
THREE
.
LineBasicMaterial
&&
(
A
.
setAttribute
(
"
style
"
,
"
fill: none; stroke:
"
+
x
.
color
.
getContextStyle
()
+
"
; stroke-width:
"
+
x
.
linewidth
+
"
; stroke-opacity:
"
+
x
.
opacity
+
"
; stroke-linecap:
"
+
x
.
linecap
+
"
; stroke-linejoin:
"
+
x
.
linejoin
),
k
.
appendChild
(
A
))}}}
else
if
(
s
instanceof
THREE
.
RenderableFace3
){
if
(
n
=
s
.
v1
,
p
=
s
.
v2
,
q
=
s
.
v3
,
n
.
positionScreen
.
x
*=
j
,
n
.
positionScreen
.
y
*=-
m
,
p
.
positionScreen
.
x
*=
j
,
p
.
positionScreen
.
y
*=-
m
,
q
.
positionScreen
.
x
*=
j
,
q
.
positionScreen
.
y
*=-
m
,
C
.
addPoint
(
n
.
positionScreen
.
x
,
n
.
positionScreen
.
y
),
C
.
addPoint
(
p
.
positionScreen
.
x
,
p
.
positionScreen
.
y
),
C
.
addPoint
(
q
.
positionScreen
.
x
,
q
.
positionScreen
.
y
),
u
.
in
s
tersects
(
C
)){
l
=
0
;
for
(
r
=
s
.
meshMaterials
.
length
;
l
<
r
;)
if
(
x
=
s
.
meshMaterials
[
l
++
],
x
instanceof
THREE
.
MeshFaceMaterial
){
t
=
0
;
for
(
w
=
s
.
faceMaterials
.
length
;
t
<
w
;)(
x
=
s
.
faceMaterials
[
t
++
])
&&
THREE
.
RenderableFace3
){
if
(
n
=
s
.
v1
,
p
=
s
.
v2
,
q
=
s
.
v3
,
n
.
positionScreen
.
x
*=
j
,
n
.
positionScreen
.
y
*=-
m
,
p
.
positionScreen
.
x
*=
j
,
p
.
positionScreen
.
y
*=-
m
,
q
.
positionScreen
.
x
*=
j
,
q
.
positionScreen
.
y
*=-
m
,
C
.
addPoint
(
n
.
positionScreen
.
x
,
n
.
positionScreen
.
y
),
C
.
addPoint
(
p
.
positionScreen
.
x
,
p
.
positionScreen
.
y
),
C
.
addPoint
(
q
.
positionScreen
.
x
,
q
.
positionScreen
.
y
),
u
.
intersects
(
C
)){
l
=
0
;
for
(
r
=
s
.
meshMaterials
.
length
;
l
<
r
;)
if
(
x
=
s
.
meshMaterials
[
l
++
],
x
instanceof
THREE
.
MeshFaceMaterial
){
t
=
0
;
for
(
w
=
s
.
faceMaterials
.
length
;
t
<
w
;)(
x
=
s
.
faceMaterials
[
t
++
])
&&
x
.
opacity
!=
0
&&
b
(
n
,
p
,
q
,
s
,
x
,
a
)}
else
x
&&
x
.
opacity
!=
0
&&
b
(
n
,
p
,
q
,
s
,
x
,
a
)}}
else
if
(
s
instanceof
THREE
.
RenderableFace4
&&
(
n
=
s
.
v1
,
p
=
s
.
v2
,
q
=
s
.
v3
,
v
=
s
.
v4
,
n
.
positionScreen
.
x
*=
j
,
n
.
positionScreen
.
y
*=-
m
,
p
.
positionScreen
.
x
*=
j
,
p
.
positionScreen
.
y
*=-
m
,
q
.
positionScreen
.
x
*=
j
,
q
.
positionScreen
.
y
*=-
m
,
v
.
positionScreen
.
x
*=
j
,
v
.
positionScreen
.
y
*=-
m
,
C
.
addPoint
(
n
.
positionScreen
.
x
,
n
.
positionScreen
.
y
),
C
.
addPoint
(
p
.
positionScreen
.
x
,
p
.
positionScreen
.
y
),
C
.
addPoint
(
q
.
positionScreen
.
x
,
q
.
positionScreen
.
y
),
C
.
addPoint
(
v
.
positionScreen
.
x
,
v
.
positionScreen
.
y
),
u
.
in
s
tersects
(
C
))){
l
=
0
;
for
(
r
=
s
.
meshMaterials
.
length
;
l
<
r
;)
if
(
x
=
s
.
meshMaterials
[
l
++
],
x
instanceof
THREE
.
MeshFaceMaterial
){
t
=
0
;
for
(
w
=
s
.
faceMaterials
.
length
;
t
<
w
;)(
x
=
s
.
faceMaterials
[
t
++
])
&&
x
.
opacity
!=
0
&&
c
(
n
,
p
,
q
,
v
,
s
,
x
,
a
)}
else
x
&&
x
.
opacity
!=
0
&&
c
(
n
,
p
,
q
,
v
,
s
,
x
,
a
)}}};
THREE
.
RenderableVertex
=
function
(){
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
visible
=!
0
};
THREE
.
RenderableVertex
.
prototype
.
copy
=
function
(
a
){
this
.
positionWorld
.
copy
(
a
.
positionWorld
);
this
.
positionScreen
.
copy
(
a
.
positionScreen
)};
u
.
intersects
(
C
))){
l
=
0
;
for
(
r
=
s
.
meshMaterials
.
length
;
l
<
r
;)
if
(
x
=
s
.
meshMaterials
[
l
++
],
x
instanceof
THREE
.
MeshFaceMaterial
){
t
=
0
;
for
(
w
=
s
.
faceMaterials
.
length
;
t
<
w
;)(
x
=
s
.
faceMaterials
[
t
++
])
&&
x
.
opacity
!=
0
&&
c
(
n
,
p
,
q
,
v
,
s
,
x
,
a
)}
else
x
&&
x
.
opacity
!=
0
&&
c
(
n
,
p
,
q
,
v
,
s
,
x
,
a
)}}};
THREE
.
RenderableVertex
=
function
(){
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
visible
=!
0
};
THREE
.
RenderableVertex
.
prototype
.
copy
=
function
(
a
){
this
.
positionWorld
.
copy
(
a
.
positionWorld
);
this
.
positionScreen
.
copy
(
a
.
positionScreen
)};
THREE
.
RenderableFace3
=
function
(){
this
.
v1
=
new
THREE
.
RenderableVertex
;
this
.
v2
=
new
THREE
.
RenderableVertex
;
this
.
v3
=
new
THREE
.
RenderableVertex
;
this
.
centroidWorld
=
new
THREE
.
Vector3
;
this
.
centroidScreen
=
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
vertexNormalsWorld
=
[
new
THREE
.
Vector3
,
new
THREE
.
Vector3
,
new
THREE
.
Vector3
];
this
.
faceMaterials
=
this
.
meshMaterials
=
null
;
this
.
overdraw
=!
1
;
this
.
uvs
=
[[]];
this
.
z
=
null
};
THREE
.
RenderableFace4
=
function
(){
this
.
v1
=
new
THREE
.
RenderableVertex
;
this
.
v2
=
new
THREE
.
RenderableVertex
;
this
.
v3
=
new
THREE
.
RenderableVertex
;
this
.
v4
=
new
THREE
.
RenderableVertex
;
this
.
centroidWorld
=
new
THREE
.
Vector3
;
this
.
centroidScreen
=
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
vertexNormalsWorld
=
[
new
THREE
.
Vector3
,
new
THREE
.
Vector3
,
new
THREE
.
Vector3
,
new
THREE
.
Vector3
];
this
.
faceMaterials
=
this
.
meshMaterials
=
null
;
this
.
overdraw
=!
1
;
this
.
uvs
=
[[]];
this
.
z
=
null
};
THREE
.
RenderableObject
=
function
(){
this
.
z
=
this
.
object
=
null
};
THREE
.
RenderableParticle
=
function
(){
this
.
rotation
=
this
.
z
=
this
.
y
=
this
.
x
=
null
;
this
.
scale
=
new
THREE
.
Vector2
;
this
.
materials
=
null
};
THREE
.
RenderableLine
=
function
(){
this
.
z
=
null
;
this
.
v1
=
new
THREE
.
RenderableVertex
;
this
.
v2
=
new
THREE
.
RenderableVertex
;
this
.
materials
=
null
};
build/custom/ThreeWebGL.js
浏览文件 @
93468b00
...
...
@@ -20,7 +20,7 @@ Math.max(b.scale.y,b.scale.z)))return[];var j,h,k,m,r,p,u,n,s,v,B=b.geometry,y=B
n
=
v
.
dot
(
u
),
b
.
doubleSided
||
(
b
.
flipSided
?
n
>
0
:
n
<
0
)))
if
(
n
=
u
.
dot
((
new
THREE
.
Vector3
).
sub
(
k
,
s
))
/
n
,
s
=
s
.
addSelf
(
v
.
multiplyScalar
(
n
)),
h
instanceof
THREE
.
Face3
)
d
(
s
,
k
,
m
,
r
)
&&
(
h
=
{
distance
:
this
.
origin
.
distanceTo
(
s
),
point
:
s
,
face
:
h
,
object
:
b
},
E
.
push
(
h
));
else
if
(
h
instanceof
THREE
.
Face4
&&
(
d
(
s
,
k
,
m
,
p
)
||
d
(
s
,
m
,
r
,
p
)))
h
=
{
distance
:
this
.
origin
.
distanceTo
(
s
),
point
:
s
,
face
:
h
,
object
:
b
},
E
.
push
(
h
);
E
.
sort
(
function
(
b
,
c
){
return
b
.
distance
-
c
.
distance
});
return
E
}
else
return
[]}};
THREE
.
Rectangle
=
function
(){
function
b
(){
h
=
e
-
c
;
k
=
j
-
d
}
var
c
,
d
,
e
,
j
,
h
,
k
,
m
=!
0
;
this
.
getX
=
function
(){
return
c
};
this
.
getY
=
function
(){
return
d
};
this
.
getWidth
=
function
(){
return
h
};
this
.
getHeight
=
function
(){
return
k
};
this
.
getLeft
=
function
(){
return
c
};
this
.
getTop
=
function
(){
return
d
};
this
.
getRight
=
function
(){
return
e
};
this
.
getBottom
=
function
(){
return
j
};
this
.
set
=
function
(
h
,
k
,
u
,
n
){
m
=!
1
;
c
=
h
;
d
=
k
;
e
=
u
;
j
=
n
;
b
()};
this
.
addPoint
=
function
(
h
,
k
){
m
?(
m
=!
1
,
c
=
h
,
d
=
k
,
e
=
h
,
j
=
k
):(
c
=
c
<
h
?
c
:
h
,
d
=
d
<
k
?
d
:
k
,
e
=
e
>
h
?
e
:
h
,
j
=
j
>
k
?
j
:
k
);
b
()};
this
.
add3Points
=
function
(
h
,
k
,
u
,
n
,
s
,
v
){
m
?(
m
=!
1
,
c
=
h
<
u
?
h
<
s
?
h
:
s
:
u
<
s
?
u
:
s
,
d
=
k
<
n
?
k
<
v
?
k
:
v
:
n
<
v
?
n
:
v
,
e
=
h
>
u
?
h
>
s
?
h
:
s
:
u
>
s
?
u
:
s
,
j
=
k
>
n
?
k
>
v
?
k
:
v
:
n
>
v
?
n
:
v
):(
c
=
h
<
u
?
h
<
s
?
h
<
c
?
h
:
c
:
s
<
c
?
s
:
c
:
u
<
s
?
u
<
c
?
u
:
c
:
s
<
c
?
s
:
c
,
d
=
k
<
n
?
k
<
v
?
k
<
d
?
k
:
d
:
v
<
d
?
v
:
d
:
n
<
v
?
n
<
d
?
n
:
d
:
v
<
d
?
v
:
d
,
e
=
h
>
u
?
h
>
s
?
h
>
e
?
h
:
e
:
s
>
e
?
s
:
e
:
u
>
s
?
u
>
e
?
u
:
e
:
s
>
e
?
s
:
e
,
j
=
k
>
n
?
k
>
v
?
k
>
j
?
k
:
j
:
v
>
j
?
v
:
j
:
n
>
v
?
n
>
j
?
n
:
j
:
v
>
j
?
v
:
j
);
b
()};
this
.
addRectangle
=
function
(
h
){
m
?(
m
=!
1
,
c
=
h
.
getLeft
(),
d
=
h
.
getTop
(),
e
=
h
.
getRight
(),
j
=
h
.
getBottom
()):(
c
=
c
<
h
.
getLeft
()?
c
:
h
.
getLeft
(),
d
=
d
<
h
.
getTop
()?
d
:
h
.
getTop
(),
e
=
e
>
h
.
getRight
()?
e
:
h
.
getRight
(),
j
=
j
>
h
.
getBottom
()?
j
:
h
.
getBottom
());
b
()};
this
.
inflate
=
function
(
h
){
c
-=
h
;
d
-=
h
;
e
+=
h
;
j
+=
h
;
b
()};
this
.
minSelf
=
function
(
h
){
c
=
c
>
h
.
getLeft
()?
c
:
h
.
getLeft
();
d
=
d
>
h
.
getTop
()?
d
:
h
.
getTop
();
e
=
e
<
h
.
getRight
()?
e
:
h
.
getRight
();
j
=
j
<
h
.
getBottom
()?
j
:
h
.
getBottom
();
b
()};
this
.
in
s
tersects
=
function
(
b
){
return
Math
.
min
(
e
,
b
.
getRight
())
-
Math
.
max
(
c
,
b
.
getLeft
())
>=
0
&&
Math
.
min
(
j
,
b
.
getBottom
())
-
Math
.
max
(
d
,
b
.
getTop
())
>=
0
};
this
.
empty
=
function
(){
m
=!
0
;
j
=
e
=
d
=
c
=
0
;
b
()};
this
.
isEmpty
=
function
(){
return
m
}};
THREE
.
Matrix3
=
function
(){
this
.
m
=
[]};
h
.
getBottom
()?
j
:
h
.
getBottom
());
b
()};
this
.
inflate
=
function
(
h
){
c
-=
h
;
d
-=
h
;
e
+=
h
;
j
+=
h
;
b
()};
this
.
minSelf
=
function
(
h
){
c
=
c
>
h
.
getLeft
()?
c
:
h
.
getLeft
();
d
=
d
>
h
.
getTop
()?
d
:
h
.
getTop
();
e
=
e
<
h
.
getRight
()?
e
:
h
.
getRight
();
j
=
j
<
h
.
getBottom
()?
j
:
h
.
getBottom
();
b
()};
this
.
intersects
=
function
(
b
){
return
Math
.
min
(
e
,
b
.
getRight
())
-
Math
.
max
(
c
,
b
.
getLeft
())
>=
0
&&
Math
.
min
(
j
,
b
.
getBottom
())
-
Math
.
max
(
d
,
b
.
getTop
())
>=
0
};
this
.
empty
=
function
(){
m
=!
0
;
j
=
e
=
d
=
c
=
0
;
b
()};
this
.
isEmpty
=
function
(){
return
m
}};
THREE
.
Matrix3
=
function
(){
this
.
m
=
[]};
THREE
.
Matrix3
.
prototype
=
{
constructor
:
THREE
.
Matrix3
,
transpose
:
function
(){
var
b
,
c
=
this
.
m
;
b
=
c
[
1
];
c
[
1
]
=
c
[
3
];
c
[
3
]
=
b
;
b
=
c
[
2
];
c
[
2
]
=
c
[
6
];
c
[
6
]
=
b
;
b
=
c
[
5
];
c
[
5
]
=
c
[
7
];
c
[
7
]
=
b
;
return
this
},
transposeIntoArray
:
function
(
b
){
var
c
=
this
.
m
;
b
[
0
]
=
c
[
0
];
b
[
1
]
=
c
[
3
];
b
[
2
]
=
c
[
6
];
b
[
3
]
=
c
[
1
];
b
[
4
]
=
c
[
4
];
b
[
5
]
=
c
[
7
];
b
[
6
]
=
c
[
2
];
b
[
7
]
=
c
[
5
];
b
[
8
]
=
c
[
8
];
return
this
}};
THREE
.
Matrix4
=
function
(
b
,
c
,
d
,
e
,
j
,
h
,
k
,
m
,
r
,
p
,
u
,
n
,
s
,
v
,
B
,
y
){
this
.
set
(
b
||
1
,
c
||
0
,
d
||
0
,
e
||
0
,
j
||
0
,
h
||
1
,
k
||
0
,
m
||
0
,
r
||
0
,
p
||
0
,
u
||
1
,
n
||
0
,
s
||
0
,
v
||
0
,
B
||
0
,
y
||
1
);
this
.
flat
=
Array
(
16
);
this
.
m33
=
new
THREE
.
Matrix3
};
THREE
.
Matrix4
.
prototype
=
{
constructor
:
THREE
.
Matrix4
,
set
:
function
(
b
,
c
,
d
,
e
,
j
,
h
,
k
,
m
,
r
,
p
,
u
,
n
,
s
,
v
,
B
,
y
){
this
.
n11
=
b
;
this
.
n12
=
c
;
this
.
n13
=
d
;
this
.
n14
=
e
;
this
.
n21
=
j
;
this
.
n22
=
h
;
this
.
n23
=
k
;
this
.
n24
=
m
;
this
.
n31
=
r
;
this
.
n32
=
p
;
this
.
n33
=
u
;
this
.
n34
=
n
;
this
.
n41
=
s
;
this
.
n42
=
v
;
this
.
n43
=
B
;
this
.
n44
=
y
;
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
(
b
){
this
.
set
(
b
.
n11
,
b
.
n12
,
b
.
n13
,
b
.
n14
,
b
.
n21
,
b
.
n22
,
b
.
n23
,
b
.
n24
,
b
.
n31
,
b
.
n32
,
b
.
n33
,
b
.
n34
,
b
.
n41
,
b
.
n42
,
b
.
n43
,
b
.
n44
);
return
this
},
lookAt
:
function
(
b
,
c
,
d
){
var
e
=
THREE
.
Matrix4
.
__v1
,
j
=
THREE
.
Matrix4
.
__v2
,
h
=
THREE
.
Matrix4
.
__v3
;
h
.
sub
(
b
,
c
).
normalize
();
if
(
h
.
length
()
===
0
)
h
.
z
=
1
;
e
.
cross
(
d
,
h
).
normalize
();
e
.
length
()
===
0
&&
(
h
.
x
+=
1.0
E
-
4
,
e
.
cross
(
d
,
h
).
normalize
());
j
.
cross
(
h
,
e
).
normalize
();
this
.
n11
=
e
.
x
;
this
.
n12
=
j
.
x
;
this
.
n13
=
h
.
x
;
this
.
n21
=
e
.
y
;
this
.
n22
=
j
.
y
;
this
.
n23
=
h
.
y
;
this
.
n31
=
e
.
z
;
this
.
n32
=
j
.
z
;
this
.
n33
=
h
.
z
;
return
this
},
multiplyVector3
:
function
(
b
){
var
c
=
b
.
x
,
d
=
b
.
y
,
e
=
b
.
z
,
j
=
1
/
(
this
.
n41
*
c
+
this
.
n42
*
d
+
this
.
n43
*
e
+
this
.
n44
);
b
.
x
=
(
this
.
n11
*
c
+
this
.
n12
*
d
+
this
.
n13
*
e
+
this
.
n14
)
*
j
;
...
...
examples/misc_lookat.html
浏览文件 @
93468b00
...
...
@@ -41,7 +41,7 @@
var
camera
,
scene
,
renderer
;
var
mesh
,
zmesh
,
lightMesh
,
geometry
,
target
;
var
mesh
,
zmesh
,
lightMesh
,
geometry
,
sphere
;
var
mouseX
=
0
,
mouseY
=
0
;
...
...
@@ -64,11 +64,13 @@
scene
=
new
THREE
.
Scene
();
var
geometry
=
new
THREE
.
CylinderGeometry
(
3
,
10
,
0.1
,
100
);
var
material
=
new
THREE
.
MeshNormalMaterial
(
{
shading
:
THREE
.
SmoothShading
}
);
sphere
=
new
THREE
.
Mesh
(
new
THREE
.
SphereGeometry
(
100
,
20
,
20
),
new
THREE
.
MeshNormalMaterial
(
{
shading
:
THREE
.
SmoothShading
}
)
);
scene
.
add
(
sphere
);
target
=
new
THREE
.
Mesh
(
new
THREE
.
SphereGeometry
(
100
,
20
,
20
),
material
);
scene
.
add
(
target
);
var
geometry
=
new
THREE
.
CylinderGeometry
(
0
,
10
,
100
,
3
);
THREE
.
GeometryUtils
.
applyMatrix
(
geometry
,
new
THREE
.
Matrix4
().
setRotationFromEuler
(
new
THREE
.
Vector3
(
Math
.
PI
/
2
,
Math
.
PI
,
0
)
)
);
var
material
=
new
THREE
.
MeshNormalMaterial
();
for
(
var
i
=
0
;
i
<
1000
;
i
++
)
{
...
...
@@ -121,13 +123,13 @@
var
time
=
new
Date
().
getTime
()
*
0.0005
;
target
.
position
.
x
=
Math
.
sin
(
time
*
0.7
)
*
2000
;
target
.
position
.
y
=
Math
.
cos
(
time
*
0.5
)
*
2000
;
target
.
position
.
z
=
Math
.
cos
(
time
*
0.3
)
*
2000
;
sphere
.
position
.
x
=
Math
.
sin
(
time
*
0.7
)
*
2000
;
sphere
.
position
.
y
=
Math
.
cos
(
time
*
0.5
)
*
2000
;
sphere
.
position
.
z
=
Math
.
cos
(
time
*
0.3
)
*
2000
;
for
(
var
i
=
0
,
l
=
scene
.
objects
.
length
;
i
<
l
;
i
++
)
{
scene
.
objects
[
i
].
lookAt
(
target
.
position
);
scene
.
objects
[
i
].
lookAt
(
sphere
.
position
);
}
...
...
examples/misc_ubiquity_test.html
浏览文件 @
93468b00
...
...
@@ -13,115 +13,7 @@
</head>
<body>
<!--
<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/Projector.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/core/Edge.js"
></script>
<script
type=
"text/javascript"
src=
"../src/cameras/Camera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/cameras/OrthoCamera.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/lights/SpotLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Material.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/textures/Texture.js"
></script>
<script
type=
"text/javascript"
src=
"../src/textures/DataTexture.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/LOD.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Sprite.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/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/WebGLRenderTarget.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/WebGLRenderTargetCube.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/RenderableFace4.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/ColorUtils.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/core/Curve.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/core/CurvePath.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/core/Path.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/core/Shape.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/core/TextPath.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/animation/AnimationHandler.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/animation/Animation.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/FirstPersonCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/PathCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/FlyCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/RollCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/TrackballCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/QuakeCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/CubeGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/CylinderGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/ExtrudeGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/IcosahedronGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/LatheGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/PlaneGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/SphereGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/TextGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/TorusGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/TorusKnotGeometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/Loader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/BinaryLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/ColladaLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/JSONLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/SceneLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/UTF8Loader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/objects/MarchingCubes.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/objects/Trident.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/physics/Collisions.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/physics/CollisionUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/renderers/AnaglyphWebGLRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/renderers/CrosseyedWebGLRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"obj/Qrcode.js"
></script>
...
...
@@ -171,7 +63,7 @@
var
cube
=
new
THREE
.
CubeGeometry
(
100
,
100
,
100
);
mesh
=
new
THREE
.
Mesh
(
cube
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x0000ff
,
opacity
:
0.5
}
)
);
mesh
=
new
THREE
.
Mesh
(
cube
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x0000ff
,
opacity
:
0.5
,
transparent
:
true
}
)
);
mesh
.
position
.
x
=
500
;
mesh
.
rotation
.
x
=
Math
.
random
();
mesh
.
rotation
.
y
=
Math
.
random
();
...
...
examples/webgl_materials_cars.html
浏览文件 @
93468b00
...
...
@@ -205,11 +205,12 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
}
),
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
100
000
,
100000
,
1000
00
,
1
,
1
,
1
,
null
,
true
),
material
);
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
100
,
100
,
1
00
,
1
,
1
,
1
,
null
,
true
),
material
);
sceneCube
.
add
(
mesh
);
//
...
...
examples/webgl_materials_cubemap.html
浏览文件 @
93468b00
...
...
@@ -126,7 +126,7 @@
}
),
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
10
,
10
,
1
0
,
1
,
1
,
1
,
null
,
true
),
material
);
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
10
0
,
100
,
10
0
,
1
,
1
,
1
,
null
,
true
),
material
);
sceneCube
.
add
(
mesh
);
//
...
...
examples/webgl_materials_cubemap_balls_reflection.html
浏览文件 @
93468b00
...
...
@@ -112,11 +112,12 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
}
),
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
100
000
,
100000
,
1000
00
,
1
,
1
,
1
,
null
,
true
),
material
);
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
100
,
100
,
1
00
,
1
,
1
,
1
,
null
,
true
),
material
);
sceneCube
.
add
(
mesh
);
//
...
...
examples/webgl_materials_cubemap_balls_refraction.html
浏览文件 @
93468b00
...
...
@@ -111,11 +111,12 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
}
),
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
100
000
,
100000
,
1000
00
,
1
,
1
,
1
,
null
,
true
),
material
);
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
100
,
100
,
1
00
,
1
,
1
,
1
,
null
,
true
),
material
);
sceneCube
.
add
(
mesh
);
//
...
...
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
浏览文件 @
93468b00
...
...
@@ -122,7 +122,7 @@
webglRenderer
=
new
THREE
.
CrosseyedWebGLRenderer
(
{
separation
:
90
}
);
webglRenderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
webglRenderer
.
domElement
);
document
.
addEventListener
(
'
keydown
'
,
onKeyDown
,
false
);
}
...
...
src/core/Rectangle.js
浏览文件 @
93468b00
...
...
@@ -163,17 +163,7 @@ THREE.Rectangle = function () {
};
/*
this.contains = function ( x, y ) {
return x > _left && x < _right && y > _top && y < _bottom;
};
*/
this
.
instersects
=
function
(
r
)
{
// return this.contains( r.getLeft(), r.getTop() ) || this.contains( r.getRight(), r.getTop() ) || this.contains( r.getLeft(), r.getBottom() ) || this.contains( r.getRight(), r.getBottom() );
this
.
intersects
=
function
(
r
)
{
return
Math
.
min
(
_right
,
r
.
getRight
()
)
-
Math
.
max
(
_left
,
r
.
getLeft
()
)
>=
0
&&
Math
.
min
(
_bottom
,
r
.
getBottom
()
)
-
Math
.
max
(
_top
,
r
.
getTop
()
)
>=
0
;
...
...
src/extras/GeometryUtils.js
浏览文件 @
93468b00
...
...
@@ -5,12 +5,43 @@
THREE
.
GeometryUtils
=
{
applyMatrix
:
function
(
geometry
,
matrix
)
{
var
matrixRotation
=
new
THREE
.
Matrix4
();
matrixRotation
.
extractRotation
(
matrix
,
new
THREE
.
Vector3
(
1
,
1
,
1
)
);
for
(
var
i
=
0
,
il
=
geometry
.
vertices
.
length
;
i
<
il
;
i
++
)
{
var
vertex
=
geometry
.
vertices
[
i
];
matrix
.
multiplyVector3
(
vertex
.
position
);
}
for
(
var
i
=
0
,
il
=
geometry
.
faces
.
length
;
i
<
il
;
i
++
)
{
var
face
=
geometry
.
faces
[
i
];
matrixRotation
.
multiplyVector3
(
face
.
normal
);
for
(
var
j
=
0
,
jl
=
face
.
vertexNormals
.
length
;
j
<
jl
;
j
++
)
{
matrixRotation
.
multiplyVector3
(
face
.
vertexNormals
[
j
]
);
}
matrix
.
multiplyVector3
(
face
.
centroid
);
}
},
merge
:
function
(
geometry1
,
object2
/* mesh | geometry */
)
{
var
isMesh
=
object2
instanceof
THREE
.
Mesh
,
var
matrix
,
matrixRotation
,
vertexOffset
=
geometry1
.
vertices
.
length
,
uvPosition
=
geometry1
.
faceVertexUvs
[
0
].
length
,
geometry2
=
is
Mesh
?
object2
.
geometry
:
object2
,
geometry2
=
object2
instanceof
THREE
.
Mesh
?
object2
.
geometry
:
object2
,
vertices1
=
geometry1
.
vertices
,
vertices2
=
geometry2
.
vertices
,
faces1
=
geometry1
.
faces
,
...
...
@@ -18,7 +49,15 @@ THREE.GeometryUtils = {
uvs1
=
geometry1
.
faceVertexUvs
[
0
],
uvs2
=
geometry2
.
faceVertexUvs
[
0
];
isMesh
&&
object2
.
matrixAutoUpdate
&&
object2
.
updateMatrix
();
if
(
object2
instanceof
THREE
.
Mesh
)
{
object2
.
matrixAutoUpdate
&&
object2
.
updateMatrix
();
matrix
=
object2
.
matrix
;
matrixRotation
=
new
THREE
.
Matrix4
();
matrixRotation
.
extractRotation
(
matrix
,
object2
.
scale
);
}
// vertices
...
...
@@ -28,7 +67,7 @@ THREE.GeometryUtils = {
var
vertexCopy
=
new
THREE
.
Vertex
(
vertex
.
position
.
clone
()
);
i
sMesh
&&
object2
.
matrix
.
multiplyVector3
(
vertexCopy
.
position
);
i
f
(
matrix
)
matrix
.
multiplyVector3
(
vertexCopy
.
position
);
vertices1
.
push
(
vertexCopy
);
...
...
@@ -54,10 +93,15 @@ THREE.GeometryUtils = {
faceCopy
.
normal
.
copy
(
face
.
normal
);
if
(
matrixRotation
)
matrixRotation
.
multiplyVector3
(
faceCopy
.
normal
);
for
(
var
j
=
0
,
jl
=
faceVertexNormals
.
length
;
j
<
jl
;
j
++
)
{
normal
=
faceVertexNormals
[
j
];
faceCopy
.
vertexNormals
.
push
(
normal
.
clone
()
);
normal
=
faceVertexNormals
[
j
].
clone
();
if
(
matrixRotation
)
matrixRotation
.
multiplyVector3
(
normal
);
faceCopy
.
vertexNormals
.
push
(
normal
);
}
...
...
@@ -73,6 +117,7 @@ THREE.GeometryUtils = {
faceCopy
.
materials
=
face
.
materials
.
slice
();
faceCopy
.
centroid
.
copy
(
face
.
centroid
);
if
(
matrix
)
matrix
.
multiplyVector3
(
faceCopy
.
centroid
);
faces1
.
push
(
faceCopy
);
...
...
src/extras/geometries/CylinderGeometry.js
浏览文件 @
93468b00
...
...
@@ -52,6 +52,8 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, segmentsRad
var
v3
=
vertices
[
y
+
1
][
x
+
1
];
var
v4
=
vertices
[
y
][
x
+
1
];
// FIXME: These normals aren't right for cones.
var
n1
=
this
.
vertices
[
v1
].
position
.
clone
().
setY
(
0
).
normalize
();
var
n2
=
this
.
vertices
[
v2
].
position
.
clone
().
setY
(
0
).
normalize
();
var
n3
=
this
.
vertices
[
v3
].
position
.
clone
().
setY
(
0
).
normalize
();
...
...
src/renderers/CanvasRenderer.js
浏览文件 @
93468b00
...
...
@@ -222,7 +222,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_bboxRect
.
addPoint
(
_v1
.
positionScreen
.
x
,
_v1
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
);
if
(
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
_clipRect
.
intersects
(
_bboxRect
)
)
{
m
=
0
;
ml
=
element
.
materials
.
length
;
...
...
@@ -256,7 +256,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
,
_v3
.
positionScreen
.
x
,
_v3
.
positionScreen
.
y
);
if
(
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
_clipRect
.
intersects
(
_bboxRect
)
)
{
m
=
0
;
ml
=
element
.
meshMaterials
.
length
;
...
...
@@ -313,7 +313,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_bboxRect
.
addPoint
(
_v3
.
positionScreen
.
x
,
_v3
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v4
.
positionScreen
.
x
,
_v4
.
positionScreen
.
y
);
if
(
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
_clipRect
.
intersects
(
_bboxRect
)
)
{
m
=
0
;
ml
=
element
.
meshMaterials
.
length
;
...
...
@@ -477,7 +477,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_bboxRect
.
set
(
v1
.
x
-
width
,
v1
.
y
-
height
,
v1
.
x
+
width
,
v1
.
y
+
height
);
if
(
!
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
return
;
...
...
@@ -513,7 +513,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_bboxRect
.
set
(
v1
.
x
-
width
,
v1
.
y
-
height
,
v1
.
x
+
width
,
v1
.
y
+
height
);
if
(
!
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
return
;
...
...
src/renderers/SVGRenderer.js
浏览文件 @
93468b00
...
...
@@ -127,7 +127,7 @@ THREE.SVGRenderer = function () {
_bboxRect
.
addPoint
(
_v1
.
positionScreen
.
x
,
_v1
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
);
if
(
!
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
continue
;
...
...
@@ -154,7 +154,7 @@ THREE.SVGRenderer = function () {
_bboxRect
.
addPoint
(
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v3
.
positionScreen
.
x
,
_v3
.
positionScreen
.
y
);
if
(
!
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
continue
;
...
...
@@ -199,7 +199,7 @@ THREE.SVGRenderer = function () {
_bboxRect
.
addPoint
(
_v3
.
positionScreen
.
x
,
_v3
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v4
.
positionScreen
.
x
,
_v4
.
positionScreen
.
y
);
if
(
!
_clipRect
.
in
s
tersects
(
_bboxRect
)
)
{
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录