Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
a0df3438
A
AR.js
项目概览
cqiang1993
/
AR.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AR.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a0df3438
编写于
5月 22, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean up + initial load/save markerScenes
上级
d648b85b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
74 addition
and
11 deletion
+74
-11
three.js/examples/webar-playground/TODO.md
three.js/examples/webar-playground/TODO.md
+6
-1
three.js/examples/webar-playground/demo.html
three.js/examples/webar-playground/demo.html
+57
-1
three.js/examples/webar-playground/js/threex-demoscenes.js
three.js/examples/webar-playground/js/threex-demoscenes.js
+11
-9
未找到文件。
three.js/examples/webar-playground/TODO.md
浏览文件 @
a0df3438
...
...
@@ -8,9 +8,14 @@
# Demo.html
-
get unique name when creating object
-
make it possible to save/load scene from json - put json in url - thus shareable
-
each markerScene got a name/type/position/orientation/scale
-
a fullScene is an array of those
-
need to be able to build a json from current structure
-
need to be able to parse this json and create the matching scene tree
-
remove the sceneName='' in the url - just store the whole scene
-
get unique name when creating object
-
DONE add holographic message
-
picking doesnt work on mobile
...
...
three.js/examples/webar-playground/demo.html
浏览文件 @
a0df3438
...
...
@@ -219,7 +219,6 @@
document
.
querySelector
(
'
#recordButton
'
).
addEventListener
(
'
click
'
,
function
(){
urlOptions
.
areaSource
=
'
localStorage
'
urlOptionsUpdate
()
...
...
@@ -229,6 +228,63 @@
}
location
.
href
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
examples/multi-markers/examples/learner.html#
'
+
JSON
.
stringify
(
learnerParameters
)
})
window
.
fullSceneToJSON
=
fullSceneToJSON
function
markerScenesUpdated
(){
}
function
fullSceneToJSON
(){
var
jsonData
=
{
markerScenes
:
[]
}
markerScenes
.
forEach
(
function
(
markerScene
){
var
parentObject3D
=
markerScene
.
parent
jsonData
.
markerScenes
.
push
({
type
:
markerScene
.
userData
.
sceneType
,
position
:
{
x
:
parentObject3D
.
position
.
x
,
y
:
parentObject3D
.
position
.
y
,
z
:
parentObject3D
.
position
.
z
,
},
quaternion
:
{
x
:
parentObject3D
.
quaternion
.
x
,
y
:
parentObject3D
.
quaternion
.
y
,
z
:
parentObject3D
.
quaternion
.
z
,
w
:
parentObject3D
.
quaternion
.
w
,
},
scale
:
{
x
:
parentObject3D
.
scale
.
x
,
y
:
parentObject3D
.
scale
.
y
,
z
:
parentObject3D
.
scale
.
z
,
},
})
})
return
jsonData
}
function
fullSceneFromJSON
(
jsonData
){
jsonData
.
markerScenes
.
forEach
(
function
(
item
){
createScene
(
item
.
type
)
var
parentObject3D
=
selectedMarkerScene
.
parent
parentObject3D
.
position
.
x
=
item
.
position
.
x
parentObject3D
.
position
.
y
=
item
.
position
.
y
parentObject3D
.
position
.
z
=
item
.
position
.
z
parentObject3D
.
quaternion
.
x
=
item
.
quaternion
.
x
parentObject3D
.
quaternion
.
y
=
item
.
quaternion
.
y
parentObject3D
.
quaternion
.
z
=
item
.
quaternion
.
z
parentObject3D
.
quaternion
.
w
=
item
.
quaternion
.
w
parentObject3D
.
scale
.
x
=
item
.
scale
.
x
parentObject3D
.
scale
.
y
=
item
.
scale
.
y
parentObject3D
.
scale
.
z
=
item
.
scale
.
z
})
}
////////////////////////////////////////////////////////////////////////////////
// handle urlOptions
...
...
three.js/examples/webar-playground/js/threex-demoscenes.js
浏览文件 @
a0df3438
...
...
@@ -23,27 +23,29 @@ THREEx.ARjsDemoScenes.prototype.dispose = function (delta) {
}
THREEx
.
ARjsDemoScenes
.
prototype
.
createMarkerScene
=
function
(
sceneName
)
{
var
markerScene
=
null
if
(
sceneName
===
'
torus
'
){
return
this
.
_createTorus
()
markerScene
=
this
.
_createTorus
()
}
else
if
(
sceneName
===
'
glassTorus
'
){
return
this
.
_createGlassTorus
()
markerScene
=
this
.
_createGlassTorus
()
}
else
if
(
sceneName
===
'
holeTorus
'
){
return
this
.
_createHoleTorus
()
markerScene
=
this
.
_createHoleTorus
()
}
else
if
(
sceneName
===
'
holePortal
'
){
return
this
.
_createHolePortal
()
markerScene
=
this
.
_createHolePortal
()
}
else
if
(
sceneName
===
'
holePool
'
){
return
this
.
_createHolePool
()
markerScene
=
this
.
_createHolePool
()
}
else
if
(
sceneName
===
'
minecraft
'
){
return
this
.
_createMinecraft
()
markerScene
=
this
.
_createMinecraft
()
}
else
if
(
sceneName
===
'
shaddowTorusKnot
'
){
return
this
.
_createShaddowTorusKnot
()
markerScene
=
this
.
_createShaddowTorusKnot
()
}
else
if
(
sceneName
===
'
holographicMessage
'
){
return
this
.
_createHolographicMessage
()
markerScene
=
this
.
_createHolographicMessage
()
}
else
{
console
.
assert
(
false
)
}
return
null
markerScene
.
userData
.
sceneType
=
sceneName
return
markerScene
}
//////////////////////////////////////////////////////////////////////////////
// Code Separator
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录