Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
5294c417
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,发现更多精彩内容 >>
提交
5294c417
编写于
12月 14, 2016
作者:
M
Mr.doob
提交者:
GitHub
12月 14, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10335 from Mugen87/edge
EdgesGeometry: Update docs and minor clean up
上级
8aa5b832
6b0fc6e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
23 deletion
+8
-23
docs/api/geometries/EdgesGeometry.html
docs/api/geometries/EdgesGeometry.html
+4
-21
src/geometries/EdgesGeometry.js
src/geometries/EdgesGeometry.js
+4
-2
未找到文件。
docs/api/geometries/EdgesGeometry.html
浏览文件 @
5294c417
...
...
@@ -14,24 +14,6 @@
<div
class=
"desc"
>
This can be used as a helper object to view the edges of a [page:Geometry Geometry] object.
</div>
<!-- <iframe id="scene" src="scenes/geometry-browser.html#EdgeGeometry"></iframe>
<script>
// iOS iframe auto-resize workaround
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
var scene = document.getElementById( 'scene' );
scene.style.width = getComputedStyle( scene ).width;
scene.style.height = getComputedStyle( scene ).height;
scene.setAttribute( 'scrolling', 'no' );
}
</script> -->
<h2>
Example
</h2>
[example:webgl_helpers helpers]
...
...
@@ -39,15 +21,16 @@
<code>
var geometry = new THREE.BoxBufferGeometry( 100, 100, 100 );
var edges = new THREE.EdgesGeometry( geometry );
var line = new THREE.LineSegments( edges );
var line = new THREE.LineSegments( edges
, new THREE.LineBasicMaterial( { color: 0xffffff } )
);
scene.add( line );
</code>
<h2>
Constructor
</h2>
<h3>
[name]( [page:Geometry geometry] )
</h3>
<h3>
[name]( [page:Geometry geometry]
, [page:Integer thresholdAngle]
)
</h3>
<div>
geometry — any geometry object.
geometry — Any geometry object.
<br
/>
thresholdAngle — An edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.
</div>
<h2>
Source
</h2>
...
...
src/geometries/EdgesGeometry.js
浏览文件 @
5294c417
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
Float32
BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
Geometry
}
from
'
../core/Geometry
'
;
import
{
_Math
}
from
'
../math/Math
'
;
...
...
@@ -76,6 +76,8 @@ function EdgesGeometry( geometry, thresholdAngle ) {
var
h
=
hash
[
key
];
// An edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.
if
(
h
.
face2
===
undefined
||
faces
[
h
.
face1
].
normal
.
dot
(
faces
[
h
.
face2
].
normal
)
<=
thresholdDot
)
{
var
vertex
=
vertices
[
h
.
vert1
];
...
...
@@ -92,7 +94,7 @@ function EdgesGeometry( geometry, thresholdAngle ) {
}
this
.
addAttribute
(
'
position
'
,
new
BufferAttribute
(
new
Float32Array
(
coords
)
,
3
)
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
coords
,
3
)
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录