Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
1878279f
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,发现更多精彩内容 >>
提交
1878279f
编写于
9月 11, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
e4b76322
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
0 deletion
+61
-0
build/three.js
build/three.js
+58
-0
build/three.min.js
build/three.min.js
+2
-0
utils/build/includes/extras.json
utils/build/includes/extras.json
+1
-0
未找到文件。
build/three.js
浏览文件 @
1878279f
...
...
@@ -32926,6 +32926,64 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) {
THREE.PolyhedronGeometry.prototype = Object.create( THREE.Geometry.prototype );
// File:src/extras/geometries/DodecahedronGeometry.js
/**
* @author Abe Pazos / https://hamoid.com
*/
THREE.DodecahedronGeometry = function ( radius, detail ) {
this.parameters = {
radius: radius,
detail: detail
};
var t = ( 1 + Math.sqrt( 5 ) ) / 2;
var r = 1 / t;
var vertices = [
// (±1, ±1, ±1)
-1, -1, -1, -1, -1, 1,
-1, 1, -1, -1, 1, 1,
1, -1, -1, 1, -1, 1,
1, 1, -1, 1, 1, 1,
// (0, ±1/φ, ±φ)
0, -r, -t, 0, -r, t,
0, r, -t, 0, r, t,
// (±1/φ, ±φ, 0)
-r, -t, 0, -r, t, 0,
r, -t, 0, r, t, 0,
// (±φ, 0, ±1/φ)
-t, 0, -r, t, 0, -r,
-t, 0, r, t, 0, r
];
var indices = [
3, 11, 7, 3, 7, 15, 3, 15, 13,
7, 19, 17, 7, 17, 6, 7, 6, 15,
17, 4, 8, 17, 8, 10, 17, 10, 6,
8, 0, 16, 8, 16, 2, 8, 2, 10,
0, 12, 1, 0, 1, 18, 0, 18, 16,
6, 10, 2, 6, 2, 13, 6, 13, 15,
2, 16, 18, 2, 18, 3, 2, 3, 13,
18, 1, 9, 18, 9, 11, 18, 11, 3,
4, 14, 12, 4, 12, 0, 4, 0, 8,
11, 9, 5, 11, 5, 19, 11, 19, 7,
19, 5, 14, 19, 14, 4, 19, 4, 17,
1, 12, 14, 1, 14, 5, 1, 5, 9
];
THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail );
};
THREE.DodecahedronGeometry.prototype = Object.create( THREE.Geometry.prototype );
// File:src/extras/geometries/IcosahedronGeometry.js
/**
...
...
build/three.min.js
浏览文件 @
1878279f
...
...
@@ -754,6 +754,8 @@ THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clo
Math
.
pow
(
2
,
b
);
Math
.
pow
(
4
,
b
);
for
(
var
d
=
e
(
k
.
vertices
[
a
.
a
]),
g
=
e
(
k
.
vertices
[
a
.
b
]),
h
=
e
(
k
.
vertices
[
a
.
c
]),
m
=
[],
n
=
0
;
n
<=
c
;
n
++
){
m
[
n
]
=
[];
for
(
var
p
=
e
(
d
.
clone
().
lerp
(
h
,
n
/
c
)),
r
=
e
(
g
.
clone
().
lerp
(
h
,
n
/
c
)),
q
=
c
-
n
,
s
=
0
;
s
<=
q
;
s
++
)
m
[
n
][
s
]
=
0
==
s
&&
n
==
c
?
p
:
e
(
p
.
clone
().
lerp
(
r
,
s
/
q
))}
for
(
n
=
0
;
n
<
c
;
n
++
)
for
(
s
=
0
;
s
<
2
*
(
c
-
n
)
-
1
;
s
++
)
d
=
Math
.
floor
(
s
/
2
),
0
==
s
%
2
?
f
(
m
[
n
][
d
+
1
],
m
[
n
+
1
][
d
],
m
[
n
][
d
]):
f
(
m
[
n
][
d
+
1
],
m
[
n
+
1
][
d
+
1
],
m
[
n
+
1
][
d
])}
function
h
(
a
,
b
,
c
){
0
>
c
&&
1
===
a
.
x
&&
(
a
=
new
THREE
.
Vector2
(
a
.
x
-
1
,
a
.
y
));
0
===
b
.
x
&&
0
===
b
.
z
&&
(
a
=
new
THREE
.
Vector2
(
c
/
2
/
Math
.
PI
+
0.5
,
a
.
y
));
return
a
.
clone
()}
THREE
.
Geometry
.
call
(
this
);
this
.
type
=
"
PolyhedronGeometry
"
;
this
.
parameters
=
{
vertices
:
a
,
indices
:
b
,
radius
:
c
,
detail
:
d
};
c
=
c
||
1
;
d
=
d
||
0
;
for
(
var
k
=
this
,
m
=
0
,
n
=
a
.
length
;
m
<
n
;
m
+=
3
)
e
(
new
THREE
.
Vector3
(
a
[
m
],
a
[
m
+
1
],
a
[
m
+
2
]));
a
=
this
.
vertices
;
for
(
var
q
=
[],
s
=
m
=
0
,
n
=
b
.
length
;
m
<
n
;
m
+=
3
,
s
++
){
var
t
=
a
[
b
[
m
]],
r
=
a
[
b
[
m
+
1
]],
p
=
a
[
b
[
m
+
2
]];
q
[
s
]
=
new
THREE
.
Face3
(
t
.
index
,
r
.
index
,
p
.
index
,[
t
.
clone
(),
r
.
clone
(),
p
.
clone
()])}
for
(
var
v
=
new
THREE
.
Vector3
,
m
=
0
,
n
=
q
.
length
;
m
<
n
;
m
++
)
g
(
q
[
m
],
d
);
m
=
0
;
for
(
n
=
this
.
faceVertexUvs
[
0
].
length
;
m
<
n
;
m
++
)
b
=
this
.
faceVertexUvs
[
0
][
m
],
d
=
b
[
0
].
x
,
a
=
b
[
1
].
x
,
q
=
b
[
2
].
x
,
s
=
Math
.
max
(
d
,
Math
.
max
(
a
,
q
)),
t
=
Math
.
min
(
d
,
Math
.
min
(
a
,
q
)),
0.9
<
s
&&
0.1
>
t
&&
(
0.2
>
d
&&
(
b
[
0
].
x
+=
1
),
0.2
>
a
&&
(
b
[
1
].
x
+=
1
),
0.2
>
q
&&
(
b
[
2
].
x
+=
1
));
m
=
0
;
for
(
n
=
this
.
vertices
.
length
;
m
<
n
;
m
++
)
this
.
vertices
[
m
].
multiplyScalar
(
c
);
this
.
mergeVertices
();
this
.
computeFaceNormals
();
this
.
boundingSphere
=
new
THREE
.
Sphere
(
new
THREE
.
Vector3
,
c
)};
THREE
.
PolyhedronGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
DodecahedronGeometry
=
function
(
a
,
b
){
this
.
parameters
=
{
radius
:
a
,
detail
:
b
};
var
c
=
(
1
+
Math
.
sqrt
(
5
))
/
2
,
d
=
1
/
c
;
THREE
.
PolyhedronGeometry
.
call
(
this
,[
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
-
1
,
1
,
1
,
1
,
-
1
,
-
1
,
1
,
-
1
,
1
,
1
,
1
,
-
1
,
1
,
1
,
1
,
0
,
-
d
,
-
c
,
0
,
-
d
,
c
,
0
,
d
,
-
c
,
0
,
d
,
c
,
-
d
,
-
c
,
0
,
-
d
,
c
,
0
,
d
,
-
c
,
0
,
d
,
c
,
0
,
-
c
,
0
,
-
d
,
c
,
0
,
-
d
,
-
c
,
0
,
d
,
c
,
0
,
d
],[
3
,
11
,
7
,
3
,
7
,
15
,
3
,
15
,
13
,
7
,
19
,
17
,
7
,
17
,
6
,
7
,
6
,
15
,
17
,
4
,
8
,
17
,
8
,
10
,
17
,
10
,
6
,
8
,
0
,
16
,
8
,
16
,
2
,
8
,
2
,
10
,
0
,
12
,
1
,
0
,
1
,
18
,
0
,
18
,
16
,
6
,
10
,
2
,
6
,
2
,
13
,
6
,
13
,
15
,
2
,
16
,
18
,
2
,
18
,
3
,
2
,
3
,
13
,
18
,
1
,
9
,
18
,
9
,
11
,
18
,
11
,
3
,
4
,
14
,
12
,
4
,
12
,
0
,
4
,
0
,
8
,
11
,
9
,
5
,
11
,
5
,
19
,
11
,
19
,
7
,
19
,
5
,
14
,
19
,
14
,
4
,
19
,
4
,
17
,
1
,
12
,
14
,
1
,
14
,
5
,
1
,
5
,
9
],
a
,
b
)};
THREE
.
DodecahedronGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
IcosahedronGeometry
=
function
(
a
,
b
){
var
c
=
(
1
+
Math
.
sqrt
(
5
))
/
2
;
THREE
.
PolyhedronGeometry
.
call
(
this
,[
-
1
,
c
,
0
,
1
,
c
,
0
,
-
1
,
-
c
,
0
,
1
,
-
c
,
0
,
0
,
-
1
,
c
,
0
,
1
,
c
,
0
,
-
1
,
-
c
,
0
,
1
,
-
c
,
c
,
0
,
-
1
,
c
,
0
,
1
,
-
c
,
0
,
-
1
,
-
c
,
0
,
1
],[
0
,
11
,
5
,
0
,
5
,
1
,
0
,
1
,
7
,
0
,
7
,
10
,
0
,
10
,
11
,
1
,
5
,
9
,
5
,
11
,
4
,
11
,
10
,
2
,
10
,
7
,
6
,
7
,
1
,
8
,
3
,
9
,
4
,
3
,
4
,
2
,
3
,
2
,
6
,
3
,
6
,
8
,
3
,
8
,
9
,
4
,
9
,
5
,
2
,
4
,
11
,
6
,
2
,
10
,
8
,
6
,
7
,
9
,
8
,
1
],
a
,
b
);
this
.
type
=
"
IcosahedronGeometry
"
;
this
.
parameters
=
{
radius
:
a
,
detail
:
b
}};
THREE
.
IcosahedronGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
OctahedronGeometry
=
function
(
a
,
b
){
this
.
parameters
=
{
radius
:
a
,
detail
:
b
};
THREE
.
PolyhedronGeometry
.
call
(
this
,[
1
,
0
,
0
,
-
1
,
0
,
0
,
0
,
1
,
0
,
0
,
-
1
,
0
,
0
,
0
,
1
,
0
,
0
,
-
1
],[
0
,
2
,
4
,
0
,
4
,
3
,
0
,
3
,
5
,
0
,
5
,
2
,
1
,
2
,
5
,
1
,
5
,
3
,
1
,
3
,
4
,
1
,
4
,
2
],
a
,
b
);
this
.
type
=
"
OctahedronGeometry
"
;
this
.
parameters
=
{
radius
:
a
,
detail
:
b
}};
THREE
.
OctahedronGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
TetrahedronGeometry
=
function
(
a
,
b
){
THREE
.
PolyhedronGeometry
.
call
(
this
,[
1
,
1
,
1
,
-
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
-
1
],[
2
,
1
,
0
,
0
,
3
,
2
,
1
,
3
,
0
,
2
,
3
,
1
],
a
,
b
);
this
.
type
=
"
TetrahedronGeometry
"
;
this
.
parameters
=
{
radius
:
a
,
detail
:
b
}};
THREE
.
TetrahedronGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
...
...
utils/build/includes/extras.json
浏览文件 @
1878279f
...
...
@@ -41,6 +41,7 @@
"src/extras/geometries/TorusKnotGeometry.js"
,
"src/extras/geometries/TubeGeometry.js"
,
"src/extras/geometries/PolyhedronGeometry.js"
,
"src/extras/geometries/DodecahedronGeometry.js"
,
"src/extras/geometries/IcosahedronGeometry.js"
,
"src/extras/geometries/OctahedronGeometry.js"
,
"src/extras/geometries/TetrahedronGeometry.js"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录