Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
2a907fec
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,发现更多精彩内容 >>
提交
2a907fec
编写于
3月 14, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added GridHelper.
上级
ac830902
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
21 deletion
+31
-21
editor/js/ui/Viewport.js
editor/js/ui/Viewport.js
+1
-21
src/extras/helpers/GridHelper.js
src/extras/helpers/GridHelper.js
+29
-0
utils/build/includes/extras.json
utils/build/includes/extras.json
+1
-0
未找到文件。
editor/js/ui/Viewport.js
浏览文件 @
2a907fec
...
@@ -6,7 +6,6 @@ var Viewport = function ( signals ) {
...
@@ -6,7 +6,6 @@ var Viewport = function ( signals ) {
var
objects
=
[];
var
objects
=
[];
// helpers
// helpers
var
helpersToObjects
=
{};
var
helpersToObjects
=
{};
...
@@ -14,26 +13,7 @@ var Viewport = function ( signals ) {
...
@@ -14,26 +13,7 @@ var Viewport = function ( signals ) {
var
sceneHelpers
=
new
THREE
.
Scene
();
var
sceneHelpers
=
new
THREE
.
Scene
();
var
size
=
500
,
step
=
25
;
var
grid
=
new
THREE
.
GridHelper
(
500
,
25
);
var
geometry
=
new
THREE
.
Geometry
();
var
material
=
new
THREE
.
LineBasicMaterial
(
{
vertexColors
:
THREE
.
VertexColors
}
);
var
color1
=
new
THREE
.
Color
(
0x444444
),
color2
=
new
THREE
.
Color
(
0x888888
);
for
(
var
i
=
-
size
;
i
<=
size
;
i
+=
step
)
{
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
-
size
,
0
,
i
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
size
,
0
,
i
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
i
,
0
,
-
size
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
i
,
0
,
size
)
);
var
color
=
i
===
0
?
color1
:
color2
;
geometry
.
colors
.
push
(
color
,
color
,
color
,
color
);
}
var
grid
=
new
THREE
.
Line
(
geometry
,
material
,
THREE
.
LinePieces
);
sceneHelpers
.
add
(
grid
);
sceneHelpers
.
add
(
grid
);
var
selectionBox
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
1
,
1
,
1
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffff00
,
wireframe
:
true
,
fog
:
false
}
)
);
var
selectionBox
=
new
THREE
.
Mesh
(
new
THREE
.
CubeGeometry
(
1
,
1
,
1
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffff00
,
wireframe
:
true
,
fog
:
false
}
)
);
...
...
src/extras/helpers/GridHelper.js
0 → 100644
浏览文件 @
2a907fec
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
GridHelper
=
function
(
size
,
step
)
{
var
geometry
=
new
THREE
.
Geometry
();
var
material
=
new
THREE
.
LineBasicMaterial
(
{
vertexColors
:
THREE
.
VertexColors
}
);
var
color1
=
new
THREE
.
Color
(
0x444444
),
color2
=
new
THREE
.
Color
(
0x888888
);
for
(
var
i
=
-
size
;
i
<=
size
;
i
+=
step
)
{
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
-
size
,
0
,
i
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
size
,
0
,
i
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
i
,
0
,
-
size
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
i
,
0
,
size
)
);
var
color
=
i
===
0
?
color1
:
color2
;
geometry
.
colors
.
push
(
color
,
color
,
color
,
color
);
}
THREE
.
Line
.
call
(
this
,
geometry
,
material
,
THREE
.
LinePieces
);
};
THREE
.
GridHelper
.
prototype
=
Object
.
create
(
THREE
.
Line
.
prototype
);
utils/build/includes/extras.json
浏览文件 @
2a907fec
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
"src/extras/helpers/ArrowHelper.js"
,
"src/extras/helpers/ArrowHelper.js"
,
"src/extras/helpers/CameraHelper.js"
,
"src/extras/helpers/CameraHelper.js"
,
"src/extras/helpers/DirectionalLightHelper.js"
,
"src/extras/helpers/DirectionalLightHelper.js"
,
"src/extras/helpers/GridHelper.js"
,
"src/extras/helpers/HemisphereLightHelper.js"
,
"src/extras/helpers/HemisphereLightHelper.js"
,
"src/extras/helpers/PointLightHelper.js"
,
"src/extras/helpers/PointLightHelper.js"
,
"src/extras/helpers/SpotLightHelper.js"
,
"src/extras/helpers/SpotLightHelper.js"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录