Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
6272fc1e
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,发现更多精彩内容 >>
提交
6272fc1e
编写于
1月 12, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved GLTFLoader example.
上级
4d2f46e7
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
43 addition
and
84 deletion
+43
-84
examples/webgl_loader_gltf.html
examples/webgl_loader_gltf.html
+43
-84
未找到文件。
examples/webgl_loader_gltf.html
浏览文件 @
6272fc1e
...
@@ -31,94 +31,61 @@
...
@@ -31,94 +31,61 @@
}
}
#controls
{
#controls
{
position
:
absolute
;
position
:
absolute
;
width
:
250px
;
width
:
200px
;
bottom
:
0%
;
bottom
:
0px
;
right
:
0%
;
left
:
0px
;
height
:
132px
;
padding
:
10px
;
background-color
:
White
;
background-color
:
White
;
opacity
:
.9
;
font
:
13px
"Lucida Grande"
,
Lucida
,
Verdana
,
sans-serif
;
font
:
13px
/
1.231
"Lucida Grande"
,
Lucida
,
Verdana
,
sans-serif
;
}
#status
{
position
:
absolute
;
width
:
25%
;
left
:
2%
;
top
:
95%
;
height
:
5%
;
opacity
:
.9
;
font
:
13px
/
1.231
"Lucida Grande"
,
Lucida
,
Verdana
,
sans-serif
;
}
.control
{
position
:
absolute
;
margin-left
:
12px
;
width
:
100%
;
font-weight
:
bold
;
}
.controlValue
{
position
:
absolute
;
left
:
36%
;
top
:
0%
;
}
#scenes_control
{
position
:
absolute
;
top
:
8px
;
}
}
#cameras_control
{
#controls
>
div
{
position
:
absolute
;
margin-bottom
:
8px
;
top
:
40px
;
}
}
#animations_control
{
#controls
hr
{
position
:
absolute
;
border
:
0px
;
top
:
72px
;
height
:
1px
;
margin-bottom
:
10px
;
background-color
:
#bbb
;
}
}
#extensions_control
{
#info
a
,
.button
{
position
:
absolute
;
color
:
#f00
;
top
:
104px
;
font-weight
:
bold
;
text-decoration
:
underline
;
cursor
:
pointer
}
}
#info
a
,
.button
{
color
:
#f00
;
font-weight
:
bold
;
text-decoration
:
underline
;
cursor
:
pointer
}
</style>
</style>
</head>
</head>
<body>
<body>
<div
id=
"info"
>
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
>
three.js
</a>
-
<a
href=
"http://threejs.org"
target=
"_blank"
>
three.js
</a>
-
<a
href=
"https://github.com/KhronosGroup/glTF"
target=
"_blank"
>
glTF
</a>
loader
-
<a
href=
"https://github.com/KhronosGroup/glTF"
target=
"_blank"
>
glTF
</a>
loader
<br>
<br>
monster by
<a
href=
"http://www.3drt.com/downloads.htm"
target=
"_blank"
>
3drt
</a>
-
monster by
<a
href=
"http://www.3drt.com/downloads.htm"
target=
"_blank"
>
3drt
</a>
- COLLADA duck by Sony -
COLLADA duck by Sony - Cesium models courtesy
<a
href=
"http://cesiumjs.org/"
target=
"_blank"
>
Cesium
</a>
Cesium models by
<a
href=
"http://cesiumjs.org/"
target=
"_blank"
>
Cesium
</a>
</div>
<div
id=
"container"
>
</div>
<div
id=
"status"
>
</div>
</div>
<div
id=
"container"
></div>
<div
id=
"controls"
>
<div
id=
"controls"
>
<div
class=
"control"
id=
"scenes_control"
>
<div
id=
"status"
>
Loading...
</div>
<hr
/>
<div>
Model
Model
<select
class=
"controlValue"
id=
"scenes_list"
size=
"1"
onchange=
"selectScene();"
ondblclick=
"selectScene();"
>
<select
id=
"scenes_list"
size=
"1"
onchange=
"selectScene();"
ondblclick=
"selectScene();"
></select>
</select>
</div>
</div>
<div>
<div
class=
"control"
id=
"cameras_control"
>
Camera
Camera
<select
class=
"controlValue"
id=
"cameras_list"
size=
"1"
onchange=
"selectCamera();"
ondblclick=
"selectCamera();"
>
<select
id=
"cameras_list"
size=
"1"
onchange=
"selectCamera();"
ondblclick=
"selectCamera();"
></select>
</select>
</div>
</div>
<div
class=
"control"
id=
"animations_control"
>
<div>
Animations
Animations
<div
class=
"controlValue"
><input
type=
"checkbox"
checked
onclick=
"toggleAnimations();"
>
Play
</input></div
>
<input
type=
"checkbox"
checked
onclick=
"toggleAnimations();"
>
Play
</input
>
</div>
</div>
<div
class=
"control"
id=
"extensions_control"
>
<div>
Extension
Extension
<div
class=
"controlValue"
>
<select
id=
"extensions_list"
onchange=
"selectExtension();"
>
<select
id=
"extensions_list"
onchange=
"selectExtension();"
>
<option
value=
"glTF"
>
None
</option>
<option
value=
"glTF"
>
None
</option>
<option
value=
"glTF-MaterialsCommon"
>
Built-in shaders
</option>
<option
value=
"glTF-MaterialsCommon"
>
Built-in shaders
</option>
...
@@ -126,8 +93,6 @@
...
@@ -126,8 +93,6 @@
</select>
</select>
</div>
</div>
</div>
</div>
</div>
<script
src=
"../build/three.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/controls/OrbitControls.js"
></script>
<script
src=
"js/controls/OrbitControls.js"
></script>
<script
src=
"js/loaders/GLTFLoader.js"
></script>
<script
src=
"js/loaders/GLTFLoader.js"
></script>
...
@@ -239,9 +204,6 @@
...
@@ -239,9 +204,6 @@
THREE
.
GLTFLoader
.
Shaders
.
removeAll
();
// remove all previous shaders
THREE
.
GLTFLoader
.
Shaders
.
removeAll
();
// remove all previous shaders
loader
=
new
THREE
.
GLTFLoader
;
loader
=
new
THREE
.
GLTFLoader
;
var
loadStartTime
=
Date
.
now
();
var
status
=
document
.
getElementById
(
"
status
"
);
status
.
innerHTML
=
"
Loading...
"
;
for
(
var
i
=
0
;
i
<
extensionSelect
.
children
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
extensionSelect
.
children
.
length
;
i
++
)
{
var
child
=
extensionSelect
.
children
[
i
];
var
child
=
extensionSelect
.
children
[
i
];
...
@@ -259,20 +221,17 @@
...
@@ -259,20 +221,17 @@
url
=
url
.
replace
(
'
.gltf
'
,
'
.glb
'
);
url
=
url
.
replace
(
'
.gltf
'
,
'
.glb
'
);
}
}
var
loadStartTime
=
Dat
e
.
now
();
var
loadStartTime
=
performanc
e
.
now
();
var
status
=
document
.
getElementById
(
"
status
"
);
var
status
=
document
.
getElementById
(
"
status
"
);
status
.
innerHTML
=
"
Loading...
"
;
status
.
innerHTML
=
"
Loading...
"
;
loader
.
load
(
url
,
function
(
data
)
{
loader
.
load
(
url
,
function
(
data
)
{
gltf
=
data
;
gltf
=
data
;
var
object
=
gltf
.
scene
!==
undefined
?
gltf
.
scene
:
gltf
.
scenes
[
0
];
var
object
=
gltf
.
scene
!==
undefined
?
gltf
.
scene
:
gltf
.
scenes
[
0
];
var
loadEndTime
=
Date
.
now
();
status
.
innerHTML
=
"
Load time:
"
+
(
performance
.
now
()
-
loadStartTime
).
toFixed
(
2
)
+
"
ms.
"
;
var
loadTime
=
(
loadEndTime
-
loadStartTime
)
/
1000
;
status
.
innerHTML
=
"
Load time:
"
+
loadTime
.
toFixed
(
2
)
+
"
seconds.
"
;
if
(
sceneInfo
.
cameraPos
)
if
(
sceneInfo
.
cameraPos
)
defaultCamera
.
position
.
copy
(
sceneInfo
.
cameraPos
);
defaultCamera
.
position
.
copy
(
sceneInfo
.
cameraPos
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录