Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0738ebed
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,发现更多精彩内容 >>
提交
0738ebed
编写于
9月 23, 2015
作者:
E
Elijah Snyder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial commit for webgl_loader_amf.html
上级
c31c81dd
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
31461 addition
and
0 deletion
+31461
-0
examples/models/amf/rook.amf
examples/models/amf/rook.amf
+31324
-0
examples/webgl_loader_amf.html
examples/webgl_loader_amf.html
+137
-0
未找到文件。
examples/models/amf/rook.amf
0 → 100644
浏览文件 @
0738ebed
此差异已折叠。
点击以展开。
examples/webgl_loader_amf.html
0 → 100644
浏览文件 @
0738ebed
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - AMF
</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
}
.button
{
background
:
#999
;
color
:
#eee
;
padding
:
0.2em
0.5em
;
cursor
:
pointer
}
.highlight
{
background
:
orange
;
color
:
#fff
;
}
span
{
display
:
inline-block
;
width
:
60px
;
float
:
left
;
text-align
:
center
;
}
</style>
</head>
<body>
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
>
three.js
</a>
<a
href=
"http://amf.wikispaces.com"
target=
"_blank"
>
AMF File format
</a>
<div>
AMF loader test by
<a
href=
"https://github.com/tamarintech"
>
tamarintech
</a></div>
<div>
Rook manufacturing file from
<a
href=
"http://amf.wikispaces.com/AMF+test+files"
>
AMF test files
</a></div>
</div>
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/loaders/AMFLoader.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/controls/OrbitControls.js"
></script>
<script>
if
(
!
Detector
.
webgl
)
Detector
.
addGetWebGLMessage
();
var
container
;
var
camera
,
controls
,
scene
,
renderer
,
grid
;
var
loader
;
init
();
function
init
()
{
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
scene
=
new
THREE
.
Scene
();
scene
.
add
(
new
THREE
.
AmbientLight
(
0x999999
)
);
camera
=
new
THREE
.
PerspectiveCamera
(
35
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
25
);
scene
.
fog
=
new
THREE
.
Fog
(
0x999999
,
0
,
25
);
// Normally Z is up for objects intended to be 3D printed.
// This rook is sideways ;)
camera
.
up
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
camera
.
position
.
set
(
1
,
6
,
9
);
camera
.
add
(
new
THREE
.
DirectionalLight
(
0xffffff
,
0.8
)
);
scene
.
add
(
camera
);
grid
=
new
THREE
.
GridHelper
(
25
,
1.0
);
grid
.
setColors
(
0xffffff
,
0x555555
);
scene
.
add
(
grid
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
.
setClearColor
(
0x999999
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
loader
=
new
THREE
.
AMFLoader
();
loader
.
load
(
'
./models/amf/rook.amf
'
,
function
(
amfobject
)
{
scene
.
add
(
amfobject
);
render
();
}
);
controls
=
new
THREE
.
OrbitControls
(
camera
,
renderer
.
domElement
);
controls
.
target
.
set
(
1
,
1.2
,
0
);
controls
.
update
();
controls
.
addEventListener
(
'
change
'
,
render
);
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
loader
=
new
THREE
.
AMFLoader
();
}
function
onWindowResize
()
{
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
render
();
}
function
render
()
{
renderer
.
render
(
scene
,
camera
);
}
</script>
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录