Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0e809493
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0e809493
编写于
11月 14, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
2dffa613
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
2 deletion
+4
-2
build/three.js
build/three.js
+2
-0
build/three.min.js
build/three.min.js
+2
-2
未找到文件。
build/three.js
浏览文件 @
0e809493
...
...
@@ -32962,11 +32962,13 @@ THREE.SphereGeometry = function ( radius, widthSegments, heightSegments, phiStar
if ( Math.abs( this.vertices[ v1 ].y ) === this.radius ) {
uv1.x = ( uv1.x + uv2.x ) / 2;
this.faces.push( new THREE.Face3( v1, v3, v4, [ n1, n3, n4 ] ) );
this.faceVertexUvs[ 0 ].push( [ uv1, uv3, uv4 ] );
} else if ( Math.abs( this.vertices[ v3 ].y ) === this.radius ) {
uv3.x = ( uv3.x + uv4.x ) / 2;
this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ] ) );
this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] );
...
...
build/three.min.js
浏览文件 @
0e809493
...
...
@@ -619,8 +619,8 @@ s),new THREE.Vector2(r,s),new THREE.Vector2(n,q)]);this.faces.push(new THREE.Fac
d
),
n
=
new
THREE
.
Vector2
((
b
+
1
)
/
c
,
1
-
(
a
+
1
)
/
d
),
s
=
new
THREE
.
Vector2
((
b
+
1
)
/
c
,
1
-
a
/
d
),
l
=
new
THREE
.
Face3
(
l
,
e
,
g
);
l
.
normal
.
copy
(
m
);
l
.
vertexNormals
.
push
(
m
.
clone
(),
m
.
clone
(),
m
.
clone
());
this
.
faces
.
push
(
l
);
this
.
faceVertexUvs
[
0
].
push
([
i
,
k
,
s
]);
l
=
new
THREE
.
Face3
(
e
,
f
,
g
);
l
.
normal
.
copy
(
m
);
l
.
vertexNormals
.
push
(
m
.
clone
(),
m
.
clone
(),
m
.
clone
());
this
.
faces
.
push
(
l
);
this
.
faceVertexUvs
[
0
].
push
([
k
.
clone
(),
n
,
s
.
clone
()])}
this
.
computeCentroids
()};
THREE
.
PlaneGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
RingGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
THREE
.
Geometry
.
call
(
this
);
for
(
var
a
=
a
||
0
,
b
=
b
||
50
,
e
=
void
0
!==
e
?
e
:
0
,
f
=
void
0
!==
f
?
f
:
2
*
Math
.
PI
,
c
=
void
0
!==
c
?
Math
.
max
(
3
,
c
):
8
,
d
=
void
0
!==
d
?
Math
.
max
(
3
,
d
):
8
,
h
,
g
=
[],
i
=
a
,
k
=
(
b
-
a
)
/
d
,
a
=
0
;
a
<=
d
;
a
++
){
for
(
h
=
0
;
h
<=
c
;
h
++
){
var
m
=
new
THREE
.
Vector3
,
l
=
e
+
h
/
c
*
f
;
m
.
x
=
i
*
Math
.
cos
(
l
);
m
.
y
=
i
*
Math
.
sin
(
l
);
this
.
vertices
.
push
(
m
);
g
.
push
(
new
THREE
.
Vector2
((
m
.
x
/
b
+
1
)
/
2
,(
m
.
y
/
b
+
1
)
/
2
))}
i
+=
k
}
b
=
new
THREE
.
Vector3
(
0
,
0
,
1
);
for
(
a
=
0
;
a
<
d
;
a
++
){
e
=
a
*
c
;
for
(
h
=
0
;
h
<=
c
;
h
++
)
l
=
h
+
e
,
f
=
l
+
a
,
k
=
l
+
c
+
a
,
m
=
l
+
c
+
1
+
a
,
this
.
faces
.
push
(
new
THREE
.
Face3
(
f
,
k
,
m
,[
b
.
clone
(),
b
.
clone
(),
b
.
clone
()])),
this
.
faceVertexUvs
[
0
].
push
([
g
[
f
].
clone
(),
g
[
k
].
clone
(),
g
[
m
].
clone
()]),
f
=
l
+
a
,
k
=
l
+
c
+
1
+
a
,
m
=
l
+
1
+
a
,
this
.
faces
.
push
(
new
THREE
.
Face3
(
f
,
k
,
m
,[
b
.
clone
(),
b
.
clone
(),
b
.
clone
()])),
this
.
faceVertexUvs
[
0
].
push
([
g
[
f
].
clone
(),
g
[
k
].
clone
(),
g
[
m
].
clone
()])}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
boundingSphere
=
new
THREE
.
Sphere
(
new
THREE
.
Vector3
,
i
)};
THREE
.
RingGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
SphereGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
h
){
THREE
.
Geometry
.
call
(
this
);
this
.
radius
=
a
=
a
||
50
;
this
.
widthSegments
=
b
=
Math
.
max
(
3
,
Math
.
floor
(
b
)
||
8
);
this
.
heightSegments
=
c
=
Math
.
max
(
2
,
Math
.
floor
(
c
)
||
6
);
this
.
phiStart
=
d
=
void
0
!==
d
?
d
:
0
;
this
.
phiLength
=
e
=
void
0
!==
e
?
e
:
2
*
Math
.
PI
;
this
.
thetaStart
=
f
=
void
0
!==
f
?
f
:
0
;
this
.
thetaLength
=
h
=
void
0
!==
h
?
h
:
Math
.
PI
;
var
g
,
i
,
k
=
[],
m
=
[];
for
(
i
=
0
;
i
<=
c
;
i
++
){
var
l
=
[],
n
=
[];
for
(
g
=
0
;
g
<=
b
;
g
++
){
var
s
=
g
/
b
,
r
=
i
/
c
,
q
=
new
THREE
.
Vector3
;
q
.
x
=-
a
*
Math
.
cos
(
d
+
s
*
e
)
*
Math
.
sin
(
f
+
r
*
h
);
q
.
y
=
a
*
Math
.
cos
(
f
+
r
*
h
);
q
.
z
=
a
*
Math
.
sin
(
d
+
s
*
e
)
*
Math
.
sin
(
f
+
r
*
h
);
this
.
vertices
.
push
(
q
);
l
.
push
(
this
.
vertices
.
length
-
1
);
n
.
push
(
new
THREE
.
Vector2
(
s
,
1
-
r
))}
k
.
push
(
l
);
m
.
push
(
n
)}
for
(
i
=
0
;
i
<
this
.
heightSegments
;
i
++
)
for
(
g
=
0
;
g
<
this
.
widthSegments
;
g
++
){
var
b
=
k
[
i
][
g
+
1
],
c
=
k
[
i
][
g
],
d
=
k
[
i
+
1
][
g
],
e
=
k
[
i
+
1
][
g
+
1
],
f
=
this
.
vertices
[
b
].
clone
().
normalize
(),
h
=
this
.
vertices
[
c
].
clone
().
normalize
(),
l
=
this
.
vertices
[
d
].
clone
().
normalize
(),
n
=
this
.
vertices
[
e
].
clone
().
normalize
(),
s
=
m
[
i
][
g
+
1
].
clone
(),
r
=
m
[
i
][
g
].
clone
(),
q
=
m
[
i
+
1
][
g
].
clone
(),
p
=
m
[
i
+
1
][
g
+
1
].
clone
();
Math
.
abs
(
this
.
vertices
[
b
].
y
)
===
this
.
radius
?(
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
d
,
e
,[
f
,
l
,
n
])),
this
.
faceVertexUvs
[
0
].
push
([
s
,
q
,
p
])):
Math
.
abs
(
this
.
vertices
[
d
].
y
)
===
this
.
radius
?(
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
d
,[
f
,
h
,
l
])),
this
.
faceVertexUvs
[
0
].
push
([
s
,
r
,
q
])):(
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
e
,[
f
,
h
,
n
])),
this
.
faceVertexUvs
[
0
].
push
([
s
,
r
,
p
]),
this
.
faces
.
push
(
new
THREE
.
Face3
(
c
,
d
,
e
,[
h
.
clone
(),
l
,
n
.
clone
()])),
this
.
faceVertexUvs
[
0
].
push
([
r
.
clone
(),
q
,
p
.
clone
()]))}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
boundingSphere
=
new
THREE
.
Sphere
(
new
THREE
.
Vector3
,
a
)};
THREE
.
SphereGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
TextGeometry
=
function
(
a
,
b
){
var
b
=
b
||
{},
c
=
THREE
.
FontUtils
.
generateShapes
(
a
,
b
);
b
.
amount
=
void
0
!==
b
.
height
?
b
.
height
:
50
;
void
0
===
b
.
bevelThickness
&&
(
b
.
bevelThickness
=
10
);
void
0
===
b
.
bevelSize
&&
(
b
.
bevelSize
=
8
);
void
0
===
b
.
bevelEnabled
&&
(
b
.
bevelEnabled
=!
1
);
THREE
.
ExtrudeGeometry
.
call
(
this
,
c
,
b
)};
THREE
.
TextGeometry
.
prototype
=
Object
.
create
(
THREE
.
ExtrudeGeometry
.
prototype
);
THREE
.
TorusGeometry
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Geometry
.
call
(
this
);
this
.
radius
=
a
||
100
;
this
.
tube
=
b
||
40
;
this
.
radialSegments
=
c
||
8
;
this
.
tubularSegments
=
d
||
6
;
this
.
arc
=
e
||
2
*
Math
.
PI
;
e
=
new
THREE
.
Vector3
;
a
=
[];
b
=
[];
for
(
c
=
0
;
c
<=
this
.
radialSegments
;
c
++
)
for
(
d
=
0
;
d
<=
this
.
tubularSegments
;
d
++
){
var
f
=
d
/
this
.
tubularSegments
*
this
.
arc
,
h
=
2
*
c
/
this
.
radialSegments
*
Math
.
PI
;
e
.
x
=
this
.
radius
*
Math
.
cos
(
f
);
e
.
y
=
this
.
radius
*
Math
.
sin
(
f
);
var
g
=
new
THREE
.
Vector3
;
g
.
x
=
(
this
.
radius
+
this
.
tube
*
Math
.
cos
(
h
))
*
Math
.
cos
(
f
);
g
.
y
=
(
this
.
radius
+
this
.
tube
*
this
.
radius
?(
s
.
x
=
(
s
.
x
+
r
.
x
)
/
2
,
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
d
,
e
,[
f
,
l
,
n
])),
this
.
faceVertexUvs
[
0
].
push
([
s
,
q
,
p
])):
Math
.
abs
(
this
.
vertices
[
d
].
y
)
===
this
.
radius
?(
q
.
x
=
(
q
.
x
+
p
.
x
)
/
2
,
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
d
,[
f
,
h
,
l
])),
this
.
faceVertexUvs
[
0
].
push
([
s
,
r
,
q
])):(
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
e
,[
f
,
h
,
n
])),
this
.
faceVertexUvs
[
0
].
push
([
s
,
r
,
p
]),
this
.
faces
.
push
(
new
THREE
.
Face3
(
c
,
d
,
e
,[
h
.
clone
(),
l
,
n
.
clone
()])),
this
.
faceVertexUvs
[
0
].
push
([
r
.
clone
(),
q
,
p
.
clone
()]))}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
boundingSphere
=
new
THREE
.
Sphere
(
new
THREE
.
Vector3
,
a
)};
THREE
.
SphereGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
TextGeometry
=
function
(
a
,
b
){
var
b
=
b
||
{},
c
=
THREE
.
FontUtils
.
generateShapes
(
a
,
b
);
b
.
amount
=
void
0
!==
b
.
height
?
b
.
height
:
50
;
void
0
===
b
.
bevelThickness
&&
(
b
.
bevelThickness
=
10
);
void
0
===
b
.
bevelSize
&&
(
b
.
bevelSize
=
8
);
void
0
===
b
.
bevelEnabled
&&
(
b
.
bevelEnabled
=!
1
);
THREE
.
ExtrudeGeometry
.
call
(
this
,
c
,
b
)};
THREE
.
TextGeometry
.
prototype
=
Object
.
create
(
THREE
.
ExtrudeGeometry
.
prototype
);
THREE
.
TorusGeometry
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Geometry
.
call
(
this
);
this
.
radius
=
a
||
100
;
this
.
tube
=
b
||
40
;
this
.
radialSegments
=
c
||
8
;
this
.
tubularSegments
=
d
||
6
;
this
.
arc
=
e
||
2
*
Math
.
PI
;
e
=
new
THREE
.
Vector3
;
a
=
[];
b
=
[];
for
(
c
=
0
;
c
<=
this
.
radialSegments
;
c
++
)
for
(
d
=
0
;
d
<=
this
.
tubularSegments
;
d
++
){
var
f
=
d
/
this
.
tubularSegments
*
this
.
arc
,
h
=
2
*
c
/
this
.
radialSegments
*
Math
.
PI
;
e
.
x
=
this
.
radius
*
Math
.
cos
(
f
);
e
.
y
=
this
.
radius
*
Math
.
sin
(
f
);
var
g
=
new
THREE
.
Vector3
;
g
.
x
=
(
this
.
radius
+
this
.
tube
*
Math
.
cos
(
h
))
*
Math
.
cos
(
f
);
g
.
y
=
(
this
.
radius
+
this
.
tube
*
Math
.
cos
(
h
))
*
Math
.
sin
(
f
);
g
.
z
=
this
.
tube
*
Math
.
sin
(
h
);
this
.
vertices
.
push
(
g
);
a
.
push
(
new
THREE
.
Vector2
(
d
/
this
.
tubularSegments
,
c
/
this
.
radialSegments
));
b
.
push
(
g
.
clone
().
sub
(
e
).
normalize
())}
for
(
c
=
1
;
c
<=
this
.
radialSegments
;
c
++
)
for
(
d
=
1
;
d
<=
this
.
tubularSegments
;
d
++
){
var
e
=
(
this
.
tubularSegments
+
1
)
*
c
+
d
-
1
,
f
=
(
this
.
tubularSegments
+
1
)
*
(
c
-
1
)
+
d
-
1
,
h
=
(
this
.
tubularSegments
+
1
)
*
(
c
-
1
)
+
d
,
g
=
(
this
.
tubularSegments
+
1
)
*
c
+
d
,
i
=
new
THREE
.
Face3
(
e
,
f
,
g
,[
b
[
e
],
b
[
f
],
b
[
g
]]);
i
.
normal
.
add
(
b
[
e
]);
i
.
normal
.
add
(
b
[
f
]);
i
.
normal
.
add
(
b
[
g
]);
i
.
normal
.
normalize
();
this
.
faces
.
push
(
i
);
this
.
faceVertexUvs
[
0
].
push
([
a
[
e
].
clone
(),
a
[
f
].
clone
(),
a
[
g
].
clone
()]);
i
=
new
THREE
.
Face3
(
f
,
h
,
g
,[
b
[
f
],
b
[
h
],
b
[
g
]]);
i
.
normal
.
add
(
b
[
f
]);
i
.
normal
.
add
(
b
[
h
]);
i
.
normal
.
add
(
b
[
g
]);
i
.
normal
.
normalize
();
this
.
faces
.
push
(
i
);
this
.
faceVertexUvs
[
0
].
push
([
a
[
f
].
clone
(),
a
[
h
].
clone
(),
a
[
g
].
clone
()])}
this
.
computeCentroids
()};
THREE
.
TorusGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
TorusKnotGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
h
){
function
g
(
a
,
b
,
c
,
d
,
e
){
var
f
=
Math
.
cos
(
a
),
g
=
Math
.
sin
(
a
),
a
=
b
/
c
*
a
,
b
=
Math
.
cos
(
a
),
f
=
0.5
*
(
d
*
(
2
+
b
))
*
f
,
g
=
0.5
*
d
*
(
2
+
b
)
*
g
,
d
=
0.5
*
e
*
d
*
Math
.
sin
(
a
);
return
new
THREE
.
Vector3
(
f
,
g
,
d
)}
THREE
.
Geometry
.
call
(
this
);
this
.
radius
=
a
||
100
;
this
.
tube
=
b
||
40
;
this
.
radialSegments
=
c
||
64
;
this
.
tubularSegments
=
d
||
8
;
this
.
p
=
e
||
2
;
this
.
q
=
f
||
3
;
this
.
heightScale
=
h
||
1
;
this
.
grid
=
Array
(
this
.
radialSegments
);
c
=
new
THREE
.
Vector3
;
d
=
new
THREE
.
Vector3
;
e
=
new
THREE
.
Vector3
;
for
(
a
=
0
;
a
<
this
.
radialSegments
;
++
a
){
this
.
grid
[
a
]
=
Array
(
this
.
tubularSegments
);
b
=
2
*
(
a
/
this
.
radialSegments
)
*
this
.
p
*
Math
.
PI
;
f
=
g
(
b
,
this
.
q
,
this
.
p
,
this
.
radius
,
this
.
heightScale
);
b
=
g
(
b
+
0.01
,
this
.
q
,
this
.
p
,
this
.
radius
,
this
.
heightScale
);
c
.
subVectors
(
b
,
f
);
d
.
addVectors
(
b
,
f
);
e
.
crossVectors
(
c
,
d
);
d
.
crossVectors
(
e
,
c
);
e
.
normalize
();
d
.
normalize
();
for
(
b
=
0
;
b
<
this
.
tubularSegments
;
++
b
){
var
i
=
2
*
(
b
/
this
.
tubularSegments
)
*
Math
.
PI
,
h
=-
this
.
tube
*
Math
.
cos
(
i
),
i
=
this
.
tube
*
Math
.
sin
(
i
),
k
=
new
THREE
.
Vector3
;
k
.
x
=
f
.
x
+
h
*
d
.
x
+
i
*
e
.
x
;
k
.
y
=
f
.
y
+
h
*
d
.
y
+
i
*
e
.
y
;
k
.
z
=
f
.
z
+
h
*
d
.
z
+
i
*
e
.
z
;
this
.
grid
[
a
][
b
]
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录