Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
29faf7ff
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,发现更多精彩内容 >>
提交
29faf7ff
编写于
9月 01, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GUI: Outliner working. Not recursive yet.
上级
fa8d6f0c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
69 addition
and
15 deletion
+69
-15
gui/index.html
gui/index.html
+1
-0
gui/js/UI.js
gui/js/UI.js
+10
-6
gui/js/ui/Sidebar.Outliner.js
gui/js/ui/Sidebar.Outliner.js
+41
-3
gui/js/ui/Sidebar.Properties.Material.js
gui/js/ui/Sidebar.Properties.Material.js
+11
-1
gui/js/ui/Viewport.js
gui/js/ui/Viewport.js
+6
-5
未找到文件。
gui/index.html
浏览文件 @
29faf7ff
...
...
@@ -47,6 +47,7 @@
var
signals
=
{
sceneChanged
:
new
SIGNALS
.
Signal
(),
objectAdded
:
new
SIGNALS
.
Signal
(),
objectSelected
:
new
SIGNALS
.
Signal
(),
objectChanged
:
new
SIGNALS
.
Signal
(),
...
...
gui/js/UI.js
浏览文件 @
29faf7ff
...
...
@@ -283,8 +283,6 @@ UI.Select = function ( position ) {
this
.
dom
.
addEventListener
(
'
change
'
,
function
(
event
)
{
// console.log( scope.dom.selectedIndex, scope.dom.value );
if
(
scope
.
onChangeCallback
)
scope
.
onChangeCallback
();
},
false
);
...
...
@@ -305,11 +303,17 @@ UI.Select.prototype.setMultiple = function ( boolean ) {
UI
.
Select
.
prototype
.
setOptions
=
function
(
options
)
{
for
(
var
i
=
0
;
i
<
options
.
length
;
i
++
)
{
while
(
this
.
dom
.
children
.
length
>
0
)
{
this
.
dom
.
removeChild
(
this
.
dom
.
firstChild
);
}
for
(
var
key
in
options
)
{
var
option
=
document
.
createElement
(
'
option
'
);
option
.
value
=
options
[
i
]
;
option
.
appendChild
(
document
.
createTextNode
(
option
.
value
)
);
option
.
value
=
key
;
option
.
appendChild
(
document
.
createTextNode
(
option
s
[
key
]
)
);
this
.
dom
.
appendChild
(
option
);
}
...
...
@@ -347,7 +351,7 @@ UI.Boolean = function ( position ) {
UI
.
Select
.
call
(
this
,
position
);
this
.
setOptions
(
[
'
true
'
,
'
false
'
]
);
this
.
setOptions
(
{
'
true
'
:
'
true
'
,
'
false
'
:
'
false
'
}
);
return
this
;
...
...
gui/js/ui/Sidebar.Outliner.js
浏览文件 @
29faf7ff
...
...
@@ -9,17 +9,55 @@ Sidebar.Outliner = function ( signals ) {
container
.
add
(
new
UI
.
Text
().
setValue
(
'
SCENE
'
).
setColor
(
'
#666
'
)
);
container
.
add
(
new
UI
.
Break
(),
new
UI
.
Break
()
);
var
scene
=
new
UI
.
Select
().
setMultiple
(
true
).
setOptions
(
[
'
test
'
,
'
test
'
]
).
setWidth
(
'
100%
'
).
setHeight
(
'
140px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
onChange
(
update
);
container
.
add
(
scene
);
var
scene
Graph
=
new
UI
.
Select
().
setMultiple
(
true
).
setWidth
(
'
100%
'
).
setHeight
(
'
140px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
onChange
(
update
);
container
.
add
(
scene
Graph
);
container
.
add
(
new
UI
.
Break
(),
new
UI
.
Break
()
);
var
scene
=
null
;
function
update
()
{
console
.
log
(
scene
.
getValue
()
);
var
id
=
parseInt
(
sceneGraph
.
getValue
()
);
for
(
var
i
in
scene
.
children
)
{
var
object
=
scene
.
children
[
i
];
if
(
object
.
id
===
id
)
{
signals
.
objectSelected
.
dispatch
(
object
);
return
;
}
}
}
signals
.
sceneChanged
.
add
(
function
(
object
)
{
scene
=
object
;
var
options
=
{};
for
(
var
i
in
scene
.
children
)
{
var
object
=
scene
.
children
[
i
];
options
[
object
.
id
]
=
'
-
'
+
object
.
name
;
}
sceneGraph
.
setOptions
(
options
);
}
);
signals
.
objectSelected
.
add
(
function
(
object
)
{
sceneGraph
.
setValue
(
object
!==
null
?
object
.
id
:
null
);
}
);
return
container
;
}
gui/js/ui/Sidebar.Properties.Material.js
浏览文件 @
29faf7ff
...
...
@@ -36,7 +36,17 @@ Sidebar.Properties.Material = function ( signals ) {
// class
var
materialClassRow
=
new
UI
.
Panel
();
var
materialClass
=
new
UI
.
Select
(
'
absolute
'
).
setOptions
(
[
'
LineBasicMaterial
'
,
'
MeshBasicMaterial
'
,
'
MeshDepthMaterial
'
,
'
MeshFaceMaterial
'
,
'
MeshLambertMaterial
'
,
'
MeshNormalMaterial
'
,
'
MeshPhongMaterial
'
,
'
ParticleBasicMaterial
'
,
'
ParticleCanvasMaterial
'
,
'
ParticleDOMMaterial
'
,
'
ShaderMaterial
'
]
).
setLeft
(
'
90px
'
).
setWidth
(
'
180px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
onChange
(
update
);
var
materialClass
=
new
UI
.
Select
(
'
absolute
'
).
setOptions
(
{
'
LineBasicMaterial
'
:
'
LineBasicMaterial
'
,
'
MeshBasicMaterial
'
:
'
MeshBasicMaterial
'
,
'
MeshDepthMaterial
'
:
'
MeshDepthMaterial
'
,
'
MeshFaceMaterial
'
:
'
MeshFaceMaterial
'
,
'
MeshLambertMaterial
'
:
'
MeshLambertMaterial
'
,
'
MeshNormalMaterial
'
:
'
MeshNormalMaterial
'
,
'
MeshPhongMaterial
'
:
'
MeshPhongMaterial
'
}
).
setLeft
(
'
90px
'
).
setWidth
(
'
180px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
onChange
(
update
);
materialClassRow
.
add
(
new
UI
.
HorizontalRule
(),
new
UI
.
Text
().
setValue
(
'
Class
'
).
setColor
(
'
#666
'
)
);
materialClassRow
.
add
(
materialClass
);
...
...
gui/js/ui/Viewport.js
浏览文件 @
29faf7ff
...
...
@@ -44,7 +44,6 @@ var Viewport = function ( signals ) {
var
camera
=
new
THREE
.
PerspectiveCamera
(
50
,
1
,
1
,
5000
);
camera
.
position
.
set
(
500
,
250
,
500
);
camera
.
lookAt
(
scene
.
position
);
scene
.
add
(
camera
);
var
controls
=
new
THREE
.
TrackballControls
(
camera
,
container
.
dom
);
controls
.
rotateSpeed
=
1.0
;
...
...
@@ -117,6 +116,8 @@ var Viewport = function ( signals ) {
scene
.
add
(
object
);
render
();
signals
.
sceneChanged
.
dispatch
(
scene
);
}
);
signals
.
objectChanged
.
add
(
function
(
object
)
{
...
...
@@ -125,13 +126,13 @@ var Viewport = function ( signals ) {
}
);
signals
.
objectSelected
.
add
(
function
(
object
)
{
var
selected
=
null
;
if
(
object
===
null
)
{
signals
.
objectSelected
.
add
(
function
(
object
)
{
selectionBox
.
visible
=
false
;
selectionBox
.
visible
=
false
;
}
else
if
(
object
.
geometry
)
{
if
(
object
!==
null
&&
object
.
geometry
)
{
var
geometry
=
object
.
geometry
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录