Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
246393eb
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,发现更多精彩内容 >>
提交
246393eb
编写于
1月 24, 2017
作者:
M
Marcel Greter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement LineLoop using `LINE_LOOP` rendering
上级
48b9efec
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
95 addition
and
0 deletion
+95
-0
docs/api/objects/LineLoop.html
docs/api/objects/LineLoop.html
+55
-0
docs/list.js
docs/list.js
+1
-0
examples/js/loaders/GLTFLoader.js
examples/js/loaders/GLTFLoader.js
+4
-0
src/Three.js
src/Three.js
+1
-0
src/loaders/ObjectLoader.js
src/loaders/ObjectLoader.js
+6
-0
src/objects/LineLoop.js
src/objects/LineLoop.js
+24
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+4
-0
未找到文件。
docs/api/objects/LineLoop.html
0 → 100644
浏览文件 @
246393eb
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<base
href=
"../../"
/>
<script
src=
"list.js"
></script>
<script
src=
"page.js"
></script>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"page.css"
/>
</head>
<body>
[page:Object3D]
→
[page:Line]
→
<h1>
[name]
</h1>
<div
class=
"desc"
>
A continuous line that connects back to the start.
<br
/><br
/>
This is nearly the same as [page:Line]; the only difference is that it is rendered using
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_LOOP]
instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP],
which draws a straight line to the next vertex, and connects the last vertex back to the first.
</div>
<h2>
Constructor
</h2>
<h3>
[name]( [page:Geometry geometry], [page:Material material] )
</h3>
<div>
[page:Geometry geometry] — List of vertices representing points on the line loop.
<br
/>
[page:Material material] — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].
</div>
<div>
If no material is supplied, a randomized line material will be created and assigned to the object.
</div>
<h2>
Properties
</h2>
<div>
See the base [page:Line] class for common properties.
</div>
<h3>
[property:Boolean isLineLoop]
</h3>
<div>
Used to check whether this or derived classes are line loops. Default is *true*.
<br
/><br
/>
You should not change this, as it used internally for optimisation.
</div>
<h2>
Methods
</h2>
<div>
See the base [page:Line] class for common methods.
</div>
<h2>
Source
</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
docs/list.js
浏览文件 @
246393eb
...
...
@@ -286,6 +286,7 @@ var list = {
[
"
Group
"
,
"
api/objects/Group
"
],
[
"
LensFlare
"
,
"
api/objects/LensFlare
"
],
[
"
Line
"
,
"
api/objects/Line
"
],
[
"
LineLoop
"
,
"
api/objects/LineLoop
"
],
[
"
LineSegments
"
,
"
api/objects/LineSegments
"
],
[
"
LOD
"
,
"
api/objects/LOD
"
],
[
"
Mesh
"
,
"
api/objects/Mesh
"
],
...
...
examples/js/loaders/GLTFLoader.js
浏览文件 @
246393eb
...
...
@@ -1940,6 +1940,10 @@ THREE.GLTFLoader = ( function () {
child
=
new
THREE
.
LineSegments
(
originalGeometry
,
material
);
break
;
case
'
LineLoop
'
:
child
=
new
THREE
.
LineLoop
(
originalGeometry
,
material
);
break
;
case
'
Line
'
:
child
=
new
THREE
.
Line
(
originalGeometry
,
material
);
break
;
...
...
src/Three.js
浏览文件 @
246393eb
...
...
@@ -19,6 +19,7 @@ export { Skeleton } from './objects/Skeleton.js';
export
{
Bone
}
from
'
./objects/Bone.js
'
;
export
{
Mesh
}
from
'
./objects/Mesh.js
'
;
export
{
LineSegments
}
from
'
./objects/LineSegments.js
'
;
export
{
LineLoop
}
from
'
./objects/LineLoop.js
'
;
export
{
Line
}
from
'
./objects/Line.js
'
;
export
{
Points
}
from
'
./objects/Points.js
'
;
export
{
Group
}
from
'
./objects/Group.js
'
;
...
...
src/loaders/ObjectLoader.js
浏览文件 @
246393eb
...
...
@@ -666,6 +666,12 @@ Object.assign( ObjectLoader.prototype, {
break
;
case
'
LineLoop
'
:
object
=
new
LineLoop
(
getGeometry
(
data
.
geometry
),
getMaterial
(
data
.
material
)
);
break
;
case
'
LineSegments
'
:
object
=
new
LineSegments
(
getGeometry
(
data
.
geometry
),
getMaterial
(
data
.
material
)
);
...
...
src/objects/LineLoop.js
0 → 100644
浏览文件 @
246393eb
import
{
Line
}
from
'
./Line
'
;
/**
* @author mgreter / http://github.com/mgreter
*/
function
LineLoop
(
geometry
,
material
)
{
Line
.
call
(
this
,
geometry
,
material
);
this
.
type
=
'
LineLoop
'
;
}
LineLoop
.
prototype
=
Object
.
assign
(
Object
.
create
(
Line
.
prototype
),
{
constructor
:
LineLoop
,
isLineLoop
:
true
,
}
);
export
{
LineLoop
};
src/renderers/WebGLRenderer.js
浏览文件 @
246393eb
...
...
@@ -855,6 +855,10 @@ function WebGLRenderer( parameters ) {
renderer
.
setMode
(
_gl
.
LINES
);
}
else
if
(
object
.
isLineLoop
)
{
renderer
.
setMode
(
_gl
.
LINE_LOOP
);
}
else
{
renderer
.
setMode
(
_gl
.
LINE_STRIP
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录