Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
4533e978
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,发现更多精彩内容 >>
提交
4533e978
编写于
6月 24, 2016
作者:
W
WestLangley
提交者:
Mr.doob
6月 24, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed UVs from geometry (#9220)
上级
14a0091e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
29 deletion
+6
-29
examples/js/geometries/ConvexGeometry.js
examples/js/geometries/ConvexGeometry.js
+6
-29
未找到文件。
examples/js/geometries/ConvexGeometry.js
浏览文件 @
4533e978
...
...
@@ -21,7 +21,7 @@ THREE.ConvexGeometry = function( vertices ) {
THREE
.
Geometry
.
call
(
this
);
var
faces
=
[
[
0
,
1
,
2
],
[
0
,
2
,
1
]
];
var
faces
=
[
[
0
,
1
,
2
],
[
0
,
2
,
1
]
];
for
(
var
i
=
3
;
i
<
vertices
.
length
;
i
++
)
{
...
...
@@ -93,7 +93,7 @@ THREE.ConvexGeometry = function( vertices ) {
// construct the new faces formed by the edges of the hole and the vertex
for
(
var
h
=
0
;
h
<
hole
.
length
;
h
++
)
{
faces
.
push
(
[
faces
.
push
(
[
hole
[
h
][
0
],
hole
[
h
][
1
],
vertexId
...
...
@@ -117,7 +117,7 @@ THREE.ConvexGeometry = function( vertices ) {
// distance from face to origin
var
dist
=
n
.
dot
(
va
);
return
n
.
dot
(
vertex
)
>=
dist
;
return
n
.
dot
(
vertex
)
>=
dist
;
}
...
...
@@ -146,7 +146,7 @@ THREE.ConvexGeometry = function( vertices ) {
*/
function
equalEdge
(
ea
,
eb
)
{
return
ea
[
0
]
===
eb
[
1
]
&&
ea
[
1
]
===
eb
[
0
];
return
ea
[
0
]
===
eb
[
1
]
&&
ea
[
1
]
===
eb
[
0
];
}
...
...
@@ -159,17 +159,6 @@ THREE.ConvexGeometry = function( vertices ) {
}
/**
* XXX: Not sure if this is the correct approach. Need someone to review.
*/
function
vertexUv
(
vertex
)
{
var
mag
=
vertex
.
length
();
return
new
THREE
.
Vector2
(
vertex
.
x
/
mag
,
vertex
.
y
/
mag
);
}
// Push vertices into `this.vertices`, skipping those inside the hull
var
id
=
0
;
var
newId
=
new
Array
(
vertices
.
length
);
// map from old vertex id to new id
...
...
@@ -196,7 +185,7 @@ THREE.ConvexGeometry = function( vertices ) {
// Convert faces into instances of THREE.Face3
for
(
var
i
=
0
;
i
<
faces
.
length
;
i
++
)
{
this
.
faces
.
push
(
new
THREE
.
Face3
(
this
.
faces
.
push
(
new
THREE
.
Face3
(
faces
[
i
][
0
],
faces
[
i
][
1
],
faces
[
i
][
2
]
...
...
@@ -204,19 +193,6 @@ THREE.ConvexGeometry = function( vertices ) {
}
// Compute UVs
for
(
var
i
=
0
;
i
<
this
.
faces
.
length
;
i
++
)
{
var
face
=
this
.
faces
[
i
];
this
.
faceVertexUvs
[
0
].
push
(
[
vertexUv
(
this
.
vertices
[
face
.
a
]
),
vertexUv
(
this
.
vertices
[
face
.
b
]
),
vertexUv
(
this
.
vertices
[
face
.
c
]
)
]
);
}
this
.
computeFaceNormals
();
this
.
computeVertexNormals
();
...
...
@@ -224,3 +200,4 @@ THREE.ConvexGeometry = function( vertices ) {
THREE
.
ConvexGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
ConvexGeometry
.
prototype
.
constructor
=
THREE
.
ConvexGeometry
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录