Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
1fea9391
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,发现更多精彩内容 >>
提交
1fea9391
编写于
1月 26, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added very simple user interface for checking what's inside the scene (in scene loader example).
Click on small [+] in the upper left corner.
上级
b4a177f3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
127 addition
and
0 deletion
+127
-0
examples/scene_test.html
examples/scene_test.html
+127
-0
未找到文件。
examples/scene_test.html
浏览文件 @
1fea9391
...
...
@@ -83,6 +83,48 @@
a
{
color
:
red
}
canvas
{
pointer-events
:
none
;
z-index
:
10
;
}
#log
{
position
:
absolute
;
top
:
0
;
display
:
block
;
text-align
:
left
;
z-index
:
1000
;
pointer-events
:
none
;
}
#scene_explorer
{
background
:
transparent
;
color
:
#fff
;
width
:
200px
;
position
:
absolute
;
text-align
:
left
;
top
:
0px
;
z-index
:
200
;
overflow
:
auto
;
}
#section_exp
{
background
:
rgba
(
0
,
0
,
50
,
0.5
);
padding
:
0.5em
0
;
display
:
none
;
}
#scene_explorer
h3
{
font-size
:
1em
;
padding
:
0
;
margin
:
0
;
color
:
orange
;
}
#scene_explorer
a
{
color
:
#555
;
font-weight
:
bold
;
text-decoration
:
none
;
font-size
:
1.2em
;
font-family
:
Monospace
;
}
#scene_explorer
a
:hover
{
background
:
#555
;
color
:
rgba
(
0
,
0
,
50
,
1
);
}
.part
{
display
:
none
;
padding
:
0
0
0.5em
2em
;
}
</style>
</head>
...
...
@@ -91,6 +133,11 @@
<a
href=
"http://github.com/mrdoob/three.js"
>
three.js
</a>
- scene loader test
</div>
<div
id=
"scene_explorer"
>
<a
id=
"plus_exp"
href=
"#"
>
[+]
</a>
<div
id=
"section_exp"
></div>
</div>
<div
id=
"progress"
>
<span
id=
"message"
>
Loading ...
</span>
...
...
@@ -173,6 +220,8 @@
*/
refreshSceneView
(
result
);
}
var
callback_async
=
function
(
result
)
{
...
...
@@ -193,6 +242,8 @@
$
(
"
start
"
).
style
.
display
=
"
block
"
;
$
(
"
start
"
).
className
=
"
enabled
"
;
refreshSceneView
(
result
);
}
$
(
"
progress
"
).
style
.
display
=
"
block
"
;
...
...
@@ -201,9 +252,12 @@
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
stats
.
domElement
.
style
.
right
=
'
0px
'
;
stats
.
domElement
.
style
.
zIndex
=
100
;
container
.
appendChild
(
stats
.
domElement
);
$
(
"
plus_exp
"
).
addEventListener
(
'
click
'
,
createToggle
(
"
exp
"
),
false
);
}
function
setButtonActive
(
id
)
{
...
...
@@ -291,6 +345,79 @@
}
// Scene explorer user interface
function
toggle
(
id
)
{
var
scn
=
$
(
"
section_
"
+
id
).
style
,
btn
=
$
(
"
plus_
"
+
id
);
if
(
scn
.
display
==
"
block
"
)
{
scn
.
display
=
"
none
"
;
btn
.
innerHTML
=
"
[+]
"
;
}
else
{
scn
.
display
=
"
block
"
;
btn
.
innerHTML
=
"
[-]
"
;
}
}
function
createToggle
(
label
)
{
return
function
()
{
toggle
(
label
)
}
};
function
refreshSceneView
(
result
)
{
$
(
"
section_exp
"
).
innerHTML
=
generateSceneView
(
result
);
var
config
=
[
"
obj
"
,
"
geo
"
,
"
mat
"
,
"
tex
"
,
"
lit
"
,
"
cam
"
];
for
(
var
i
=
0
;
i
<
config
.
length
;
i
++
)
$
(
"
plus_
"
+
config
[
i
]
).
addEventListener
(
'
click
'
,
createToggle
(
config
[
i
]
),
false
);
}
function
generateSection
(
label
,
id
,
objects
)
{
var
html
=
""
;
html
+=
"
<h3><a id='plus_
"
+
id
+
"
' href='#'>[+]</a>
"
+
label
+
"
</h3>
"
;
html
+=
"
<div id='section_
"
+
id
+
"
' class='part'>
"
;
for
(
var
o
in
objects
)
{
html
+=
o
+
"
<br/>
"
;
}
html
+=
"
</div>
"
;
return
html
;
}
function
generateSceneView
(
result
)
{
var
config
=
[
[
"
Objects
"
,
"
obj
"
,
result
.
objects
],
[
"
Geometries
"
,
"
geo
"
,
result
.
geometries
],
[
"
Materials
"
,
"
mat
"
,
result
.
materials
],
[
"
Textures
"
,
"
tex
"
,
result
.
textures
],
[
"
Lights
"
,
"
lit
"
,
result
.
lights
],
[
"
Cameras
"
,
"
cam
"
,
result
.
cameras
]
];
var
html
=
""
;
for
(
var
i
=
0
;
i
<
config
.
length
;
i
++
)
html
+=
generateSection
(
config
[
i
][
0
],
config
[
i
][
1
],
config
[
i
][
2
]
);
return
html
;
}
</script>
</body>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录