Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
9bec22d5
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,发现更多精彩内容 >>
提交
9bec22d5
编写于
9月 26, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated build.
上级
2a826b2e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
build/three.min.js
build/three.min.js
+1
-1
examples/canvas_geometry_shapes.html
examples/canvas_geometry_shapes.html
+2
-2
examples/webgl_geometry_shapes.html
examples/webgl_geometry_shapes.html
+2
-2
未找到文件。
build/three.min.js
浏览文件 @
9bec22d5
...
...
@@ -691,7 +691,7 @@ THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,f,e){b=a.
g
=
a
.
vertices
[
g
].
z
,
n
=
a
.
vertices
[
h
].
x
,
m
=
a
.
vertices
[
h
].
y
,
a
=
a
.
vertices
[
h
].
z
;
return
Math
.
abs
(
c
-
i
)
<
0.01
?[
new
THREE
.
UV
(
b
,
1
-
f
),
new
THREE
.
UV
(
d
,
1
-
e
),
new
THREE
.
UV
(
j
,
1
-
g
),
new
THREE
.
UV
(
n
,
1
-
a
)]:[
new
THREE
.
UV
(
c
,
1
-
f
),
new
THREE
.
UV
(
i
,
1
-
e
),
new
THREE
.
UV
(
l
,
1
-
g
),
new
THREE
.
UV
(
m
,
1
-
a
)]}};
THREE
.
ExtrudeGeometry
.
__v1
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v2
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v3
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v4
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v5
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v6
=
new
THREE
.
Vector2
;
THREE
.
ShapeGeometry
=
function
(
a
,
b
){
THREE
.
Geometry
.
call
(
this
);
a
instanceof
Array
===
false
&&
(
a
=
[
a
]);
this
.
shapebb
=
a
[
a
.
length
-
1
].
getBoundingBox
();
this
.
addShapeList
(
a
,
b
);
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
ShapeGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
ShapeGeometry
.
prototype
.
addShapeList
=
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
)
this
.
addShape
(
a
[
c
],
b
);
return
this
};
THREE
.
ShapeGeometry
.
prototype
.
addShape
=
function
(
a
,
b
){
b
===
void
0
&&
(
b
=
{});
var
c
=
b
.
material
,
d
=
b
.
UVGenerator
===
void
0
?
THREE
.
ExtrudeGeometry
.
WorldUVGenerator
:
b
.
UVGenerator
,
f
,
e
,
g
,
h
=
this
.
vertices
.
length
;
f
=
a
.
extractPoints
();
var
i
=
f
.
shape
,
j
=
f
.
holes
;
if
(
!
THREE
.
Shape
.
Utils
.
isClockWise
(
i
)){
i
=
i
.
reverse
();
f
=
0
;
for
(
e
=
j
.
length
;
f
<
e
;
f
++
){
g
=
j
[
f
];
THREE
.
Shape
.
Utils
.
isClockWise
(
g
)
&&
(
j
[
f
]
=
g
.
reverse
())}}
var
l
=
THREE
.
Shape
.
Utils
.
triangulateShape
(
i
,
j
);
f
=
0
;
for
(
e
=
j
.
length
;
f
<
e
;
f
++
){
g
=
j
[
f
];
i
=
i
.
concat
(
g
)}
j
=
i
.
length
;
e
=
l
.
length
;
for
(
f
=
0
;
f
<
j
;
f
++
){
g
=
i
[
f
];
this
.
vertices
.
push
(
new
THREE
.
Vector3
(
g
.
x
,
g
.
y
,
0
))}
for
(
f
=
0
;
f
<
e
;
f
++
){
j
=
l
[
f
];
i
=
j
[
2
]
+
h
;
g
=
j
[
1
]
+
h
;
j
=
j
[
0
]
+
h
;
this
.
faces
.
push
(
new
THREE
.
Face3
(
i
,
g
,
j
,
null
,
null
,
c
));
this
.
faceVertexUvs
[
0
].
push
(
d
.
generateBottomUV
(
this
,
a
,
b
,
i
,
g
,
j
))}};
0
;
f
<
j
;
f
++
){
g
=
i
[
f
];
this
.
vertices
.
push
(
new
THREE
.
Vector3
(
g
.
x
,
g
.
y
,
0
))}
for
(
f
=
0
;
f
<
e
;
f
++
){
j
=
l
[
f
];
i
=
j
[
0
]
+
h
;
g
=
j
[
1
]
+
h
;
j
=
j
[
2
]
+
h
;
this
.
faces
.
push
(
new
THREE
.
Face3
(
i
,
g
,
j
,
null
,
null
,
c
));
this
.
faceVertexUvs
[
0
].
push
(
d
.
generateBottomUV
(
this
,
a
,
b
,
i
,
g
,
j
))}};
THREE
.
LatheGeometry
=
function
(
a
,
b
,
c
){
THREE
.
Geometry
.
call
(
this
);
for
(
var
b
=
b
||
12
,
c
=
c
||
2
*
Math
.
PI
,
d
=
[],
f
=
(
new
THREE
.
Matrix4
).
makeRotationZ
(
c
/
b
),
e
=
0
;
e
<
a
.
length
;
e
++
){
d
[
e
]
=
a
[
e
].
clone
();
this
.
vertices
.
push
(
d
[
e
])}
for
(
var
g
=
b
+
1
,
c
=
0
;
c
<
g
;
c
++
)
for
(
e
=
0
;
e
<
d
.
length
;
e
++
){
d
[
e
]
=
f
.
multiplyVector3
(
d
[
e
].
clone
());
this
.
vertices
.
push
(
d
[
e
])}
for
(
c
=
0
;
c
<
b
;
c
++
){
d
=
0
;
for
(
f
=
a
.
length
;
d
<
f
-
1
;
d
++
){
this
.
faces
.
push
(
new
THREE
.
Face4
(
c
*
f
+
d
,(
c
+
1
)
%
g
*
f
+
d
,(
c
+
1
)
%
g
*
f
+
(
d
+
1
)
%
f
,
c
*
f
+
(
d
+
1
)
%
f
));
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
1
-
c
/
b
,
d
/
f
),
new
THREE
.
UV
(
1
-
(
c
+
1
)
/
b
,
d
/
f
),
new
THREE
.
UV
(
1
-
(
c
+
1
)
/
b
,(
d
+
1
)
/
f
),
new
THREE
.
UV
(
1
-
c
/
b
,(
d
+
1
)
/
f
)])}}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
LatheGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
PlaneGeometry
=
function
(
a
,
b
,
c
,
d
){
THREE
.
Geometry
.
call
(
this
);
for
(
var
f
=
a
/
2
,
e
=
b
/
2
,
c
=
c
||
1
,
d
=
d
||
1
,
g
=
c
+
1
,
h
=
d
+
1
,
i
=
a
/
c
,
j
=
b
/
d
,
l
=
new
THREE
.
Vector3
(
0
,
0
,
1
),
a
=
0
;
a
<
h
;
a
++
)
for
(
b
=
0
;
b
<
g
;
b
++
)
this
.
vertices
.
push
(
new
THREE
.
Vector3
(
b
*
i
-
f
,
-
(
a
*
j
-
e
),
0
));
for
(
a
=
0
;
a
<
d
;
a
++
)
for
(
b
=
0
;
b
<
c
;
b
++
){
f
=
new
THREE
.
Face4
(
b
+
g
*
a
,
b
+
g
*
(
a
+
1
),
b
+
1
+
g
*
(
a
+
1
),
b
+
1
+
g
*
a
);
f
.
normal
.
copy
(
l
);
f
.
vertexNormals
.
push
(
l
.
clone
(),
l
.
clone
(),
l
.
clone
(),
l
.
clone
());
this
.
faces
.
push
(
f
);
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
b
/
c
,
1
-
a
/
d
),
new
THREE
.
UV
(
b
/
c
,
1
-
(
a
+
1
)
/
d
),
new
THREE
.
UV
((
b
+
...
...
examples/canvas_geometry_shapes.html
浏览文件 @
9bec22d5
...
...
@@ -67,7 +67,7 @@
// flat shape
var
geometry
=
new
THREE
.
ShapeGeometry
(
shape
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
color
,
side
:
THREE
.
DoubleSide
,
overdraw
:
true
}
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
color
,
overdraw
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
set
(
x
,
y
,
z
);
...
...
@@ -277,7 +277,7 @@
addShape
(
triangleShape
,
0xffee00
,
-
180
,
0
,
0
,
0
,
0
,
0
,
1
);
addShape
(
roundedRectShape
,
0x005500
,
-
150
,
150
,
0
,
0
,
0
,
0
,
1
);
addShape
(
squareShape
,
0x0055ff
,
150
,
100
,
0
,
0
,
0
,
0
,
1
);
addShape
(
heartShape
,
0xff1100
,
4
0
,
100
,
0
,
0
,
0
,
Math
.
PI
,
1
);
addShape
(
heartShape
,
0xff1100
,
6
0
,
100
,
0
,
0
,
0
,
Math
.
PI
,
1
);
addShape
(
circleShape
,
0x00ff11
,
120
,
250
,
0
,
0
,
0
,
0
,
1
);
addShape
(
fishShape
,
0x222222
,
-
60
,
200
,
0
,
0
,
0
,
0
,
1
);
addShape
(
smileyShape
,
0xee00ff
,
-
200
,
250
,
0
,
0
,
0
,
Math
.
PI
,
1
);
...
...
examples/webgl_geometry_shapes.html
浏览文件 @
9bec22d5
...
...
@@ -342,10 +342,10 @@
addShape
(
triangleShape
,
extrudeSettings
,
0xffee00
,
-
180
,
0
,
0
,
0
,
0
,
0
,
1
);
addShape
(
roundedRectShape
,
extrudeSettings
,
0x005500
,
-
150
,
150
,
0
,
0
,
0
,
0
,
1
);
addShape
(
squareShape
,
extrudeSettings
,
0x0055ff
,
150
,
100
,
0
,
0
,
0
,
0
,
1
);
addShape
(
heartShape
,
extrudeSettings
,
0xff1100
,
0
,
100
,
0
,
Math
.
PI
,
0
,
0
,
1
);
addShape
(
heartShape
,
extrudeSettings
,
0xff1100
,
60
,
100
,
0
,
0
,
0
,
Math
.
PI
,
1
);
addShape
(
circleShape
,
extrudeSettings
,
0x00ff11
,
120
,
250
,
0
,
0
,
0
,
0
,
1
);
addShape
(
fishShape
,
extrudeSettings
,
0x222222
,
-
60
,
200
,
0
,
0
,
0
,
0
,
1
);
addShape
(
smileyShape
,
extrudeSettings
,
0xee00ff
,
-
2
70
,
250
,
0
,
Math
.
PI
,
0
,
0
,
1
);
addShape
(
smileyShape
,
extrudeSettings
,
0xee00ff
,
-
2
00
,
250
,
0
,
0
,
0
,
Math
.
PI
,
1
);
addShape
(
arcShape
,
extrudeSettings
,
0xbb4422
,
150
,
0
,
0
,
0
,
0
,
0
,
1
);
extrudeSettings
.
extrudePath
=
apath
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录