Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
f55c657f
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,发现更多精彩内容 >>
提交
f55c657f
编写于
3月 07, 2014
作者:
P
Pierre Lepers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup AWDLoader + added sample page with simple AWD scene
上级
d330b527
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
445 addition
and
389 deletion
+445
-389
examples/js/loaders/AWDLoader.js
examples/js/loaders/AWDLoader.js
+291
-389
examples/models/awd/simple/simple.awd
examples/models/awd/simple/simple.awd
+0
-0
examples/webgl_loader_awd.html
examples/webgl_loader_awd.html
+154
-0
未找到文件。
examples/js/loaders/AWDLoader.js
浏览文件 @
f55c657f
此差异已折叠。
点击以展开。
examples/models/awd/simple/simple.awd
0 → 100644
浏览文件 @
f55c657f
文件已添加
examples/webgl_loader_awd.html
0 → 100644
浏览文件 @
f55c657f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - collada
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
body
{
font-family
:
Monospace
;
background-color
:
#000000
;
margin
:
0px
;
overflow
:
hidden
;
}
#info
{
color
:
#fff
;
position
:
absolute
;
top
:
10px
;
width
:
100%
;
text-align
:
center
;
z-index
:
100
;
display
:
block
;
}
a
{
color
:
skyblue
}
</style>
</head>
<body>
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
>
three.js
</a>
-
simple AWD loader
</div>
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/loaders/AWDLoader.js"
></script>
<script
src=
"js/controls/OrbitControls.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/libs/stats.min.js"
></script>
<script>
if
(
!
Detector
.
webgl
)
Detector
.
addGetWebGLMessage
();
var
container
,
stats
;
var
camera
,
scene
,
renderer
,
objects
,
controls
;
var
particleLight
,
pointLight
;
var
trunk
;
var
loader
=
new
THREE
.
AWDLoader
();
loader
.
materialFactory
=
createMaterial
;
loader
.
load
(
'
./models/awd/simple/simple.awd
'
,
function
(
_trunk
)
{
trunk
=
_trunk
;
init
();
render
();
}
);
function
createMaterial
(
name
){
console
.
log
(
name
);
var
mat
=
new
THREE
.
MeshPhongMaterial
({
color
:
0xaaaaaa
,
shininess
:
20
});
return
mat
;
}
function
init
()
{
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2000
);
camera
.
position
.
set
(
70
,
50
,
-
100
);
controls
=
new
THREE
.
OrbitControls
(
camera
);
scene
=
new
THREE
.
Scene
();
// Add the AWD SCENE
scene
.
add
(
trunk
);
// Lights
scene
.
add
(
new
THREE
.
AmbientLight
(
0x606060
)
);
var
directionalLight
=
new
THREE
.
DirectionalLight
(
/*Math.random() * 0xffffff*/
0xeeeeee
);
directionalLight
.
position
.
x
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
y
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
z
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
normalize
();
scene
.
add
(
directionalLight
);
pointLight
=
new
THREE
.
PointLight
(
0xffffff
,
.
6
);
scene
.
add
(
pointLight
);
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
container
.
appendChild
(
stats
.
domElement
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
render
()
{
requestAnimationFrame
(
render
);
var
timer
=
Date
.
now
()
*
0.0005
;
pointLight
.
position
.
x
=
Math
.
sin
(
timer
*
4
)
*
3000
;
pointLight
.
position
.
y
=
600
pointLight
.
position
.
z
=
Math
.
cos
(
timer
*
4
)
*
3000
;
renderer
.
render
(
scene
,
camera
);
stats
.
update
();
}
</script>
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录