Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
8e176e83
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,发现更多精彩内容 >>
提交
8e176e83
编写于
3月 12, 2017
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ConvexGeometry: Clean up
上级
2ddb73b2
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
0 addition
and
77 deletion
+0
-77
src/Three.js
src/Three.js
+0
-1
src/geometries/ConvexGeometry.js
src/geometries/ConvexGeometry.js
+0
-75
src/geometries/Geometries.js
src/geometries/Geometries.js
+0
-1
未找到文件。
src/Three.js
浏览文件 @
8e176e83
...
...
@@ -100,7 +100,6 @@ export { QuaternionLinearInterpolant } from './math/interpolants/QuaternionLinea
export
{
LinearInterpolant
}
from
'
./math/interpolants/LinearInterpolant.js
'
;
export
{
DiscreteInterpolant
}
from
'
./math/interpolants/DiscreteInterpolant.js
'
;
export
{
CubicInterpolant
}
from
'
./math/interpolants/CubicInterpolant.js
'
;
export
{
QuickHull3
}
from
'
./math/convexhull/QuickHull3.js
'
;
export
{
Interpolant
}
from
'
./math/Interpolant.js
'
;
export
{
Triangle
}
from
'
./math/Triangle.js
'
;
export
{
_Math
as
Math
}
from
'
./math/Math.js
'
;
...
...
src/geometries/ConvexGeometry.js
已删除
100644 → 0
浏览文件 @
2ddb73b2
/**
* @author Mugen87 / https://github.com/Mugen87
*/
import
{
Geometry
}
from
'
../core/Geometry
'
;
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
Float32BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
QuickHull3
}
from
'
../math/convexhull/QuickHull3
'
;
function
ConvexGeometry
(
points
)
{
Geometry
.
call
(
this
);
this
.
type
=
'
ConvexGeometry
'
;
this
.
fromBufferGeometry
(
new
ConvexBufferGeometry
(
points
)
);
this
.
mergeVertices
();
}
ConvexGeometry
.
prototype
=
Object
.
create
(
Geometry
.
prototype
);
ConvexGeometry
.
prototype
.
constructor
=
ConvexGeometry
;
function
ConvexBufferGeometry
(
points
)
{
BufferGeometry
.
call
(
this
);
this
.
type
=
'
ConvexBufferGeometry
'
;
// buffers
var
vertices
=
[];
var
normals
=
[];
// execute QuickHull
var
quickHull
=
new
THREE
.
QuickHull3
().
setFromPoints
(
points
);
// generate vertices and normals
var
faces
=
quickHull
.
faces
;
for
(
var
i
=
0
;
i
<
faces
.
length
;
i
++
)
{
var
face
=
faces
[
i
];
var
edge
=
face
.
edge
;
// we move along a doubly-connected edge list to access all face points (see HalfEdge docs)
do
{
var
point
=
edge
.
head
().
point
;
vertices
.
push
(
point
.
x
,
point
.
y
,
point
.
z
);
normals
.
push
(
face
.
normal
.
x
,
face
.
normal
.
y
,
face
.
normal
.
z
);
edge
=
edge
.
next
;
}
while
(
edge
!==
face
.
edge
);
}
// build geometry
this
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32BufferAttribute
(
normals
,
3
)
);
}
ConvexBufferGeometry
.
prototype
=
Object
.
create
(
BufferGeometry
.
prototype
);
ConvexBufferGeometry
.
prototype
.
constructor
=
ConvexBufferGeometry
;
export
{
ConvexGeometry
,
ConvexBufferGeometry
};
src/geometries/Geometries.js
浏览文件 @
8e176e83
...
...
@@ -20,4 +20,3 @@ export { ConeGeometry, ConeBufferGeometry } from './ConeGeometry.js';
export
{
CylinderGeometry
,
CylinderBufferGeometry
}
from
'
./CylinderGeometry.js
'
;
export
{
CircleGeometry
,
CircleBufferGeometry
}
from
'
./CircleGeometry.js
'
;
export
{
BoxGeometry
,
BoxBufferGeometry
}
from
'
./BoxGeometry.js
'
;
export
{
ConvexGeometry
,
ConvexBufferGeometry
}
from
'
./ConvexGeometry.js
'
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录