Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
2d2c2878
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,发现更多精彩内容 >>
提交
2d2c2878
编写于
7月 17, 2019
作者:
N
nicolo.carpignoli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: fixed ui style
上级
affe21e2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
137 addition
and
151 deletion
+137
-151
aframe/examples/marker-events.html
aframe/examples/marker-events.html
+1
-1
three.js/src/new-api/arjs-debugui.js
three.js/src/new-api/arjs-debugui.js
+136
-150
未找到文件。
aframe/examples/marker-events.html
浏览文件 @
2d2c2878
...
...
@@ -33,7 +33,7 @@
});
</script>
<body
style=
'margin : 0px; overflow: hidden; font-family: Monospace;'
><div
style=
'position: fixed; top: 10px;
width:100%
; text-align: center; z-index: 1;'
>
<body
style=
'margin : 0px; overflow: hidden; font-family: Monospace;'
><div
style=
'position: fixed; top: 10px;
left: 5px
; text-align: center; z-index: 1;'
>
<a
href=
"https://github.com/jeromeetienne/AR.js/"
target=
"_blank"
>
AR.js
</a>
- marker events example for a-frame - look at the js console
<br/>
Contact me any time at
<a
href=
'https://twitter.com/jerome_etienne'
target=
'_blank'
>
@jerome_etienne
</a>
...
...
three.js/src/new-api/arjs-debugui.js
浏览文件 @
2d2c2878
...
...
@@ -6,59 +6,50 @@ var ARjs = ARjs || {}
*
* @param {ARjs.Anchor} arAnchor - the anchor to user
*/
ARjs
.
SessionDebugUI
=
function
(
arSession
,
tangoPointCloud
){
var
trackingBackend
=
arSession
.
arContext
.
parameters
.
trackingBackend
this
.
domElement
=
document
.
createElement
(
'
div
'
)
this
.
domElement
.
style
.
color
=
'
rgba(0,0,0,0.9)
'
this
.
domElement
.
style
.
backgroundColor
=
'
rgba(127,127,127,0.5)
'
this
.
domElement
.
style
.
display
=
'
inline-block
'
this
.
domElement
.
style
.
padding
=
'
0.5em
'
this
.
domElement
.
style
.
margin
=
'
0.5em
'
this
.
domElement
.
style
.
textAlign
=
'
left
'
//////////////////////////////////////////////////////////////////////////////
// add title
//////////////////////////////////////////////////////////////////////////////
// var domElement = document.createElement('div')
// domElement.style.display = 'block'
// domElement.style.fontWeight = 'bold'
// domElement.style.fontSize = '120%'
// this.domElement.appendChild(domElement)
// domElement.innerHTML = 'AR.js Session Debug'
//////////////////////////////////////////////////////////////////////////////
// current-tracking-backend
//////////////////////////////////////////////////////////////////////////////
var
domElement
=
document
.
createElement
(
'
span
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
innerHTML
=
'
<b>trackingBackend</b> :
'
+
trackingBackend
//////////////////////////////////////////////////////////////////////////////
// toggle-point-cloud
//////////////////////////////////////////////////////////////////////////////
if
(
trackingBackend
===
'
tango
'
&&
tangoPointCloud
){
var
domElement
=
document
.
createElement
(
'
button
'
)
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonTangoTogglePointCloud
'
domElement
.
innerHTML
=
'
toggle-point-cloud
'
domElement
.
href
=
'
javascript:void(0)
'
domElement
.
addEventListener
(
'
click
'
,
function
(){
var
scene
=
arSession
.
parameters
.
scene
// TODO how tangoPointCloud, get connected here ???
// in arguments simply ?
if
(
tangoPointCloud
.
object3d
.
parent
){
scene
.
remove
(
tangoPointCloud
.
object3d
)
}
else
{
scene
.
add
(
tangoPointCloud
.
object3d
)
}
})
}
ARjs
.
SessionDebugUI
=
function
(
arSession
,
tangoPointCloud
)
{
var
trackingBackend
=
arSession
.
arContext
.
parameters
.
trackingBackend
this
.
domElement
=
document
.
createElement
(
'
div
'
)
this
.
domElement
.
style
.
color
=
'
rgba(0,0,0,0.9)
'
this
.
domElement
.
style
.
backgroundColor
=
'
rgba(127,127,127,0.5)
'
this
.
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
style
.
padding
=
'
0.5em
'
this
.
domElement
.
style
.
position
=
'
fixed
'
this
.
domElement
.
style
.
left
=
'
5px
'
this
.
domElement
.
style
.
bottom
=
'
10px
'
this
.
domElement
.
style
.
textAlign
=
'
right
'
//////////////////////////////////////////////////////////////////////////////
// current-tracking-backend
//////////////////////////////////////////////////////////////////////////////
var
domElement
=
document
.
createElement
(
'
span
'
)
domElement
.
style
.
display
=
'
block
'
domElement
.
innerHTML
=
'
<b>trackingBackend</b> :
'
+
trackingBackend
this
.
domElement
.
appendChild
(
domElement
)
//////////////////////////////////////////////////////////////////////////////
// toggle-point-cloud
//////////////////////////////////////////////////////////////////////////////
if
(
trackingBackend
===
'
tango
'
&&
tangoPointCloud
)
{
var
domElement
=
document
.
createElement
(
'
button
'
)
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonTangoTogglePointCloud
'
domElement
.
innerHTML
=
'
toggle-point-cloud
'
domElement
.
href
=
'
javascript:void(0)
'
domElement
.
addEventListener
(
'
click
'
,
function
()
{
var
scene
=
arSession
.
parameters
.
scene
if
(
tangoPointCloud
.
object3d
.
parent
)
{
scene
.
remove
(
tangoPointCloud
.
object3d
)
}
else
{
scene
.
add
(
tangoPointCloud
.
object3d
)
}
})
}
}
/**
...
...
@@ -71,108 +62,103 @@ ARjs.SessionDebugUI.AugmentedWebsiteURL = 'https://webxr.io/augmented-website'
// ARjs.AnchorDebugUI
//////////////////////////////////////////////////////////////////////////////
/**
* Create an debug UI for an ARjs.Anchor
*
* @param {ARjs.Anchor} arAnchor - the anchor to user
*/
ARjs
.
AnchorDebugUI
=
function
(
arAnchor
){
var
_this
=
this
var
arSession
=
arAnchor
.
arSession
var
trackingBackend
=
arSession
.
arContext
.
parameters
.
trackingBackend
this
.
domElement
=
document
.
createElement
(
'
div
'
)
this
.
domElement
.
style
.
color
=
'
rgba(0,0,0,0.9)
'
this
.
domElement
.
style
.
backgroundColor
=
'
rgba(127,127,127,0.5)
'
this
.
domElement
.
style
.
display
=
'
inline-block
'
this
.
domElement
.
style
.
padding
=
'
0.5em
'
this
.
domElement
.
style
.
margin
=
'
0.5em
'
this
.
domElement
.
style
.
textAlign
=
'
left
'
//////////////////////////////////////////////////////////////////////////////
// add title
//////////////////////////////////////////////////////////////////////////////
// var domElement = document.createElement('div')
// domElement.style.display = 'block'
// domElement.style.fontWeight = 'bold'
// domElement.style.fontSize = '120%'
// this.domElement.appendChild(domElement)
// domElement.innerHTML = 'Anchor Marker Debug'
//////////////////////////////////////////////////////////////////////////////
// current-tracking-backend
//////////////////////////////////////////////////////////////////////////////
var
domElement
=
document
.
createElement
(
'
span
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
innerHTML
=
'
<b>markersAreaEnabled</b> :
'
+
arAnchor
.
parameters
.
markersAreaEnabled
//////////////////////////////////////////////////////////////////////////////
// toggle-marker-helper
//////////////////////////////////////////////////////////////////////////////
if
(
arAnchor
.
parameters
.
markersAreaEnabled
){
var
domElement
=
document
.
createElement
(
'
button
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonToggleMarkerHelpers
'
domElement
.
innerHTML
=
'
toggle-marker-helper
'
domElement
.
href
=
'
javascript:void(0)
'
var
subMarkerHelpersVisible
=
false
domElement
.
addEventListener
(
'
click
'
,
function
(){
subMarkerHelpersVisible
=
subMarkerHelpersVisible
?
false
:
true
arAnchor
.
markersArea
.
setSubMarkersVisibility
(
subMarkerHelpersVisible
)
})
}
//////////////////////////////////////////////////////////////////////////////
// Learn-new-marker-area
//////////////////////////////////////////////////////////////////////////////
if
(
arAnchor
.
parameters
.
markersAreaEnabled
){
var
domElement
=
document
.
createElement
(
'
button
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonMarkersAreaLearner
'
domElement
.
innerHTML
=
'
Learn-new-marker-area
'
domElement
.
href
=
'
javascript:void(0)
'
domElement
.
addEventListener
(
'
click
'
,
function
(){
if
(
ARjs
.
AnchorDebugUI
.
MarkersAreaLearnerURL
!==
null
){
var
learnerURL
=
ARjs
.
AnchorDebugUI
.
MarkersAreaLearnerURL
}
else
{
var
learnerURL
=
ARjs
.
Context
.
baseURL
+
'
examples/multi-markers/examples/learner.html
'
}
ARjs
.
MarkersAreaUtils
.
navigateToLearnerPage
(
learnerURL
,
trackingBackend
)
})
}
//////////////////////////////////////////////////////////////////////////////
// Reset-marker-area
//////////////////////////////////////////////////////////////////////////////
if
(
arAnchor
.
parameters
.
markersAreaEnabled
){
var
domElement
=
document
.
createElement
(
'
button
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonMarkersAreaReset
'
domElement
.
innerHTML
=
'
Reset-marker-area
'
domElement
.
href
=
'
javascript:void(0)
'
domElement
.
addEventListener
(
'
click
'
,
function
(){
ARjs
.
MarkersAreaUtils
.
storeDefaultMultiMarkerFile
(
trackingBackend
)
location
.
reload
()
})
}
ARjs
.
AnchorDebugUI
=
function
(
arAnchor
)
{
var
arSession
=
arAnchor
.
arSession
var
trackingBackend
=
arSession
.
arContext
.
parameters
.
trackingBackend
this
.
domElement
=
document
.
createElement
(
'
div
'
)
this
.
domElement
.
style
.
color
=
'
rgba(0,0,0,0.9)
'
this
.
domElement
.
style
.
backgroundColor
=
'
rgba(127,127,127,0.5)
'
this
.
domElement
.
style
.
display
=
'
inline-block
'
this
.
domElement
.
style
.
padding
=
'
0.5em
'
this
.
domElement
.
style
.
margin
=
'
0.5em
'
this
.
domElement
.
style
.
textAlign
=
'
left
'
//////////////////////////////////////////////////////////////////////////////
// current-tracking-backend
//////////////////////////////////////////////////////////////////////////////
var
domElement
=
document
.
createElement
(
'
span
'
)
domElement
.
style
.
display
=
'
block
'
domElement
.
style
.
padding
=
'
0.5em
'
domElement
.
style
.
color
=
'
rgba(0,0,0,0.9)
'
domElement
.
style
.
backgroundColor
=
'
rgba(127,127,127,0.5)
'
domElement
.
style
.
position
=
'
fixed
'
domElement
.
style
.
left
=
'
5px
'
domElement
.
style
.
bottom
=
'
40px
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
innerHTML
=
'
<b>markersAreaEnabled</b> :
'
+
arAnchor
.
parameters
.
markersAreaEnabled
//////////////////////////////////////////////////////////////////////////////
// toggle-marker-helper
//////////////////////////////////////////////////////////////////////////////
if
(
arAnchor
.
parameters
.
markersAreaEnabled
)
{
var
domElement
=
document
.
createElement
(
'
button
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
style
.
padding
=
'
0.5em
'
this
.
domElement
.
style
.
position
=
'
fixed
'
this
.
domElement
.
style
.
textAlign
=
'
left
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonToggleMarkerHelpers
'
domElement
.
innerHTML
=
'
toggle-marker-helper
'
domElement
.
href
=
'
javascript:void(0)
'
var
subMarkerHelpersVisible
=
false
domElement
.
addEventListener
(
'
click
'
,
function
()
{
subMarkerHelpersVisible
=
subMarkerHelpersVisible
?
false
:
true
arAnchor
.
markersArea
.
setSubMarkersVisibility
(
subMarkerHelpersVisible
)
})
}
//////////////////////////////////////////////////////////////////////////////
// Learn-new-marker-area
//////////////////////////////////////////////////////////////////////////////
if
(
arAnchor
.
parameters
.
markersAreaEnabled
)
{
var
domElement
=
document
.
createElement
(
'
button
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonMarkersAreaLearner
'
domElement
.
innerHTML
=
'
Learn-new-marker-area
'
domElement
.
href
=
'
javascript:void(0)
'
domElement
.
addEventListener
(
'
click
'
,
function
()
{
if
(
ARjs
.
AnchorDebugUI
.
MarkersAreaLearnerURL
!==
null
)
{
var
learnerURL
=
ARjs
.
AnchorDebugUI
.
MarkersAreaLearnerURL
}
else
{
var
learnerURL
=
ARjs
.
Context
.
baseURL
+
'
examples/multi-markers/examples/learner.html
'
}
ARjs
.
MarkersAreaUtils
.
navigateToLearnerPage
(
learnerURL
,
trackingBackend
)
})
}
//////////////////////////////////////////////////////////////////////////////
// Reset-marker-area
//////////////////////////////////////////////////////////////////////////////
if
(
arAnchor
.
parameters
.
markersAreaEnabled
)
{
var
domElement
=
document
.
createElement
(
'
button
'
)
domElement
.
style
.
display
=
'
block
'
this
.
domElement
.
appendChild
(
domElement
)
domElement
.
id
=
'
buttonMarkersAreaReset
'
domElement
.
innerHTML
=
'
Reset-marker-area
'
domElement
.
href
=
'
javascript:void(0)
'
domElement
.
addEventListener
(
'
click
'
,
function
()
{
ARjs
.
MarkersAreaUtils
.
storeDefaultMultiMarkerFile
(
trackingBackend
)
location
.
reload
()
})
}
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录