Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
7b772598
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,发现更多精彩内容 >>
提交
7b772598
编写于
11月 30, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BufferGeometryUtils: convertToTriangles() -> toTrianglesDrawMode().
上级
59d2a9bf
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
16 deletion
+16
-16
docs/examples/en/utils/BufferGeometryUtils.html
docs/examples/en/utils/BufferGeometryUtils.html
+1
-1
docs/examples/zh/utils/BufferGeometryUtils.html
docs/examples/zh/utils/BufferGeometryUtils.html
+1
-1
examples/js/utils/BufferGeometryUtils.js
examples/js/utils/BufferGeometryUtils.js
+5
-5
examples/jsm/utils/BufferGeometryUtils.d.ts
examples/jsm/utils/BufferGeometryUtils.d.ts
+1
-1
examples/jsm/utils/BufferGeometryUtils.js
examples/jsm/utils/BufferGeometryUtils.js
+5
-5
test/unit/example/utils/BufferGeometryUtils.tests.js
test/unit/example/utils/BufferGeometryUtils.tests.js
+3
-3
未找到文件。
docs/examples/en/utils/BufferGeometryUtils.html
浏览文件 @
7b772598
...
...
@@ -73,7 +73,7 @@
</p>
<h3>
[method:BufferGeometry
convertToTriangles
]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )
</h3>
<h3>
[method:BufferGeometry
toTrianglesDrawMode
]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )
</h3>
<p>
geometry -- Instance of [page:BufferGeometry BufferGeometry].
<br
/>
drawMode -- The draw mode of the given geometry.
<br
/><br
/>
...
...
docs/examples/zh/utils/BufferGeometryUtils.html
浏览文件 @
7b772598
...
...
@@ -73,7 +73,7 @@
</p>
<h3>
[method:BufferGeometry
convertToTriangles
]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )
</h3>
<h3>
[method:BufferGeometry
toTrianglesDrawMode
]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )
</h3>
<p>
geometry -- Instance of [page:BufferGeometry BufferGeometry].
<br
/>
drawMode -- The draw mode of the given geometry.
<br
/><br
/>
...
...
examples/js/utils/BufferGeometryUtils.js
浏览文件 @
7b772598
...
...
@@ -629,11 +629,11 @@ THREE.BufferGeometryUtils = {
* @param {number} drawMode
* @return {THREE.BufferGeometry>}
*/
convertToTriangles
:
function
(
geometry
,
drawMode
)
{
toTrianglesDrawMode
:
function
(
geometry
,
drawMode
)
{
if
(
drawMode
===
THREE
.
TrianglesDrawMode
)
{
console
.
warn
(
'
THREE.BufferGeometryUtils.
convertToTriangles
(): Geometry already defined as triangles.
'
);
console
.
warn
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode
(): Geometry already defined as triangles.
'
);
return
geometry
;
}
...
...
@@ -663,7 +663,7 @@ THREE.BufferGeometryUtils = {
}
else
{
console
.
error
(
'
THREE.BufferGeometryUtils.
convertToTriangles(): Undefined position attribute. Unable to perform conversion
.
'
);
console
.
error
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode(): Undefined position attribute. Processing not possible
.
'
);
return
geometry
;
}
...
...
@@ -714,7 +714,7 @@ THREE.BufferGeometryUtils = {
if
(
(
newIndices
.
length
/
3
)
!==
numberOfTriangles
)
{
console
.
error
(
'
THREE.BufferGeometryUtils.
convertToTriangles
(): Unable to generate correct amount of triangles.
'
);
console
.
error
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode
(): Unable to generate correct amount of triangles.
'
);
}
...
...
@@ -728,7 +728,7 @@ THREE.BufferGeometryUtils = {
}
else
{
console
.
error
(
'
THREE.BufferGeometryUtils.
convertToTriangles
(): Unknown draw mode:
'
,
drawMode
);
console
.
error
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode
(): Unknown draw mode:
'
,
drawMode
);
return
geometry
;
}
...
...
examples/jsm/utils/BufferGeometryUtils.d.ts
浏览文件 @
7b772598
...
...
@@ -7,5 +7,5 @@ export namespace BufferGeometryUtils {
export
function
interleaveAttributes
(
attributes
:
BufferAttribute
[]
):
InterleavedBufferAttribute
;
export
function
estimateBytesUsed
(
geometry
:
BufferGeometry
):
number
;
export
function
mergeVertices
(
geometry
:
BufferGeometry
,
tolerance
?:
number
):
BufferGeometry
;
export
function
convertToTriangles
(
geometry
:
BufferGeometry
,
drawMode
:
TrianglesDrawModes
):
BufferGeometry
;
export
function
toTrianglesDrawMode
(
geometry
:
BufferGeometry
,
drawMode
:
TrianglesDrawModes
):
BufferGeometry
;
}
examples/jsm/utils/BufferGeometryUtils.js
浏览文件 @
7b772598
...
...
@@ -641,11 +641,11 @@ var BufferGeometryUtils = {
* @param {number} drawMode
* @return {BufferGeometry>}
*/
convertToTriangles
:
function
(
geometry
,
drawMode
)
{
toTrianglesDrawMode
:
function
(
geometry
,
drawMode
)
{
if
(
drawMode
===
TrianglesDrawMode
)
{
console
.
warn
(
'
THREE.BufferGeometryUtils.
convertToTriangles
(): Geometry already defined as triangles.
'
);
console
.
warn
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode
(): Geometry already defined as triangles.
'
);
return
geometry
;
}
...
...
@@ -675,7 +675,7 @@ var BufferGeometryUtils = {
}
else
{
console
.
error
(
'
THREE.BufferGeometryUtils.
convertToTriangles(): Undefined position attribute. Unable to perform conversion
.
'
);
console
.
error
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode(): Undefined position attribute. Processing not possible
.
'
);
return
geometry
;
}
...
...
@@ -726,7 +726,7 @@ var BufferGeometryUtils = {
if
(
(
newIndices
.
length
/
3
)
!==
numberOfTriangles
)
{
console
.
error
(
'
THREE.BufferGeometryUtils.
convertToTriangles
(): Unable to generate correct amount of triangles.
'
);
console
.
error
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode
(): Unable to generate correct amount of triangles.
'
);
}
...
...
@@ -740,7 +740,7 @@ var BufferGeometryUtils = {
}
else
{
console
.
error
(
'
THREE.BufferGeometryUtils.
convertToTriangles
(): Unknown draw mode:
'
,
drawMode
);
console
.
error
(
'
THREE.BufferGeometryUtils.
toTrianglesDrawMode
(): Unknown draw mode:
'
,
drawMode
);
return
geometry
;
}
...
...
test/unit/example/utils/BufferGeometryUtils.tests.js
浏览文件 @
7b772598
...
...
@@ -130,7 +130,7 @@ export default QUnit.module( 'BufferGeometryUtils', () => {
}
);
QUnit
.
test
(
'
convertToTriangles
()
'
,
(
assert
)
=>
{
QUnit
.
test
(
'
toTrianglesDrawMode
()
'
,
(
assert
)
=>
{
// TRIANGLE_STRIP
...
...
@@ -146,7 +146,7 @@ export default QUnit.module( 'BufferGeometryUtils', () => {
var
geometry1
=
new
BufferGeometry
();
geometry1
.
setAttribute
(
'
position
'
,
new
BufferAttribute
(
new
Float32Array
(
vertices1
),
3
)
);
geometry1
=
BufferGeometryUtils
.
convertToTriangles
(
geometry1
,
TriangleStripDrawMode
);
geometry1
=
BufferGeometryUtils
.
toTrianglesDrawMode
(
geometry1
,
TriangleStripDrawMode
);
assert
.
deepEqual
(
geometry1
.
index
.
array
,
new
Uint16Array
(
[
0
,
1
,
2
,
3
,
2
,
1
,
2
,
3
,
4
,
5
,
4
,
3
]
),
'
correct triangle indices from triangle strip
'
);
...
...
@@ -164,7 +164,7 @@ export default QUnit.module( 'BufferGeometryUtils', () => {
var
geometry2
=
new
BufferGeometry
();
geometry2
.
setAttribute
(
'
position
'
,
new
BufferAttribute
(
new
Float32Array
(
vertices2
),
3
)
);
geometry2
=
BufferGeometryUtils
.
convertToTriangles
(
geometry2
,
TriangleFanDrawMode
);
geometry2
=
BufferGeometryUtils
.
toTrianglesDrawMode
(
geometry2
,
TriangleFanDrawMode
);
assert
.
deepEqual
(
geometry2
.
index
.
array
,
new
Uint16Array
(
[
0
,
1
,
2
,
0
,
2
,
3
,
0
,
3
,
4
,
0
,
4
,
5
]
),
'
correct triangle indices from triangle fan
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录