Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
02fddda5
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,发现更多精彩内容 >>
提交
02fddda5
编写于
4月 29, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more work
上级
eccf0d1a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
118 addition
and
98 deletion
+118
-98
README.md
README.md
+1
-2
TODO.md
TODO.md
+0
-1
three.js/examples/multi-markers/ALGO.md
three.js/examples/multi-markers/ALGO.md
+0
-71
three.js/examples/multi-markers/README.md
three.js/examples/multi-markers/README.md
+75
-0
three.js/examples/multi-markers/TODO.md
three.js/examples/multi-markers/TODO.md
+15
-21
three.js/examples/multi-markers/examples/learner.html
three.js/examples/multi-markers/examples/learner.html
+2
-0
three.js/examples/multi-markers/examples/player.html
three.js/examples/multi-markers/examples/player.html
+0
-2
three.js/threex-arbasecontrols.js
three.js/threex-arbasecontrols.js
+24
-0
three.js/threex-arsmoothedcontrols.js
three.js/threex-arsmoothedcontrols.js
+1
-1
未找到文件。
README.md
浏览文件 @
02fddda5
...
...
@@ -106,8 +106,7 @@ by
```
html
<script
src=
"https://aframe.io/releases/0.5.0/aframe.min.js"
></script>
<script
src=
"https://rawgit.com/jeromeetienne/ar.js/master/aframe/build/aframe-ar.js"
></script>
<script>
THREEx
.
ArToolkitContext
.
baseURL
=
'
https://rawgit.com/jeromeetienne/ar.js/master/three.js/
'
</script>
<script
src=
"https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"
></script>
<body
style=
'margin : 0px; overflow: hidden;'
>
<a-scene
embedded
artoolkit=
'sourceType: webcam;'
>
<a-box
position=
'0 0 0.5'
material=
'opacity: 0.5;'
></a-box>
...
...
TODO.md
浏览文件 @
02fddda5
-
do a webvr demo with a hole in the ground. - good for tango
-
possible demo: hole in the wall, refraction, liquid marker but on all the wall
-
release soon and start doing dev/master
-
create a dev branch
-
release AR.js as 1.2
...
...
three.js/examples/multi-markers/ALGO.md
已删除
100644 → 0
浏览文件 @
eccf0d1a
# High Level Description
The workflow is splitted into 3 steps :
1.
collect statistics about the relative position of each marker couple
1.
generation of multi-marker description
1.
using the multi-marker
So we first have a learning phase to collect data and generating result, then
we have a usage phase, where the multi-marker is used in a AR application.
So in short, you put all your markers where you like them. Then you scan them
with your phone to collect statistics about their relative position.
When you are done, you start using the AR application with this multi-marker.
# Definitions
-
a multi-marker is several markers acting as one
-
a markerA is said to be a sub-marker of a multi-marker
# Learning Algo description
-
every time i see markerA and markerB at the same time, i store statistics on their relative position
-
such couple is called a seen-couple
-
the statistics collected are simply an average of position/quaternion/scale
-
this statistics can be trivially expressed as a transformation matrix
# Generation of Multi-Marker description
-
when the learning is considered completed, we generate a multi marker description
-
it is a json file in which each sub-markers has a transformation matrix relative to the origin sub-marker
-
the first sub-marker is the anchor/root sub-marker.
-
The origin position of the multi-marker is the origin sub-marker
-
the origin sub-marker MUST be seen at least once during the learning phase
## Description Format
-
the description format is simple:
-
it is a list with one item for each sub-markers
-
it contains a description of the sub-markers (e.g. marker barcode 3)
-
and a poseMatrix which is the transformation matrix relative to the origin sub-markers
-
the first item is the origin sub-marker
---
# Computation of the average matrix for each sub-marker
Once statistics are collected, we need to produce a description of this new
area. This is a json structure describing each sub-marker and their respective
position.
Here are the algo which can be used
## Minimal Algo - assume origin always visible
-
Assume that the origin sub-marker is ALWAYS visible
-
Look on all the seen-couple of the origin sub-marker
-
for each sub-markers, you got the relative position with the origin sub-marker
-
just generate the transformation matrix for it
This is the one implemented
## Minimal Algo - origin may sometime be invisible
-
do first pass where you compute all couple which contain the origin submarkers
-
so you computed the transformation matrix for each sub-marker which has been
visible with the origin marker
-
you computed the level 1 of transformation matrices
-
the level 0 would the transformation matrix of the origin sub-marker. But it is
always the identity matrix.
-
you do an iterative process, where each iterations compute one more level.
Algo for one iteration
1.
for each sub-markers, check all the seen couple it appears in
2.
if at least one already has a transformation matrix, compute the transformation
3.
Loop until all sub-markers got computed
three.js/examples/multi-markers/README.md
浏览文件 @
02fddda5
...
...
@@ -35,3 +35,78 @@ Thus even if only one sub-marker is visible, multi-marker position will still be
I tried to workaround those issues, but it rapidely became a pain.
So i prefered to devote my energy at building a good version instead of
working around those bugs.
---
# High Level Description
The workflow is splitted into 3 steps
:
1. collect statistics about the relative position of each marker couple
1. generation of multi-marker description
1. using the multi-marker
So we first have a learning phase to collect data and generating result, then
we have a usage phase, where the multi-marker is used in a AR application.
So in short, you put all your markers where you like them. Then you scan them
with your phone to collect statistics about their relative position.
When you are done, you start using the AR application with this multi-marker.
# Definitions
-
a multi-marker is several markers acting as one
-
a markerA is said to be a sub-marker of a multi-marker
# Learning Algo description
-
every time i see markerA and markerB at the same time, i store statistics on their relative position
-
such couple is called a seen-couple
-
the statistics collected are simply an average of position/quaternion/scale
-
this statistics can be trivially expressed as a transformation matrix
# Generation of Multi-Marker description
-
when the learning is considered completed, we generate a multi marker description
- it is a json file in which each sub-markers has a transformation matrix relative to the origin sub-marker
-
the first sub-marker is the anchor/root sub-marker.
-
The origin position of the multi-marker is the origin sub-marker
-
the origin sub-marker MUST be seen at least once during the learning phase
## Description Format
-
the description format is simple
:
-
it is a list with one item for each sub-markers
- it contains a description of the sub-markers (e.g. marker barcode 3)
- and a poseMatrix which is the transformation matrix relative to the origin sub-markers
- the first item is the origin sub-marker
---
# Computation of the average matrix for each sub-marker
Once statistics are collected, we need to produce a description of this new
area. This is a json structure describing each sub-marker and their respective
position.
Here are the algo which can be used
## Minimal Algo - assume origin always visible
-
Assume that the origin sub-marker is ALWAYS visible
-
Look on all the seen-couple of the origin sub-marker
-
for each sub-markers, you got the relative position with the origin sub-marker
-
just generate the transformation matrix for it
This is the one implemented
## Minimal Algo - origin may sometime be invisible
-
do first pass where you compute all couple which contain the origin submarkers
-
so you computed the transformation matrix for each sub-marker which has been
visible with the origin marker
-
you computed the level 1 of transformation matrices
-
the level 0 would the transformation matrix of the origin sub-marker. But it is
always the identity matrix.
-
you do an iterative process, where each iterations compute one more level.
Algo for one iteration
1.
for each sub-markers, check all the seen couple it appears in
2.
if at least one already has a transformation matrix, compute the transformation
3.
Loop until all sub-markers got computed
three.js/examples/multi-markers/TODO.md
浏览文件 @
02fddda5
-
what to do with the official multimarker support
-
make an example for it, and keep supporting it
-
make all markers children of a parent THREEx.ArBaseControls()
-
GOAL: make it explicit what is expected from a AR controls
-
emit event
-
have id
-
anything which is common
-
TODO put a smoother on sub-marker while learning ? as a way to remove noise ?
-
do it and hide it behind a flags
-
in relation with THREEx.ArBaseControls
-
do an apps which does something with it
-
a minecraft going from
markers to
markers
-
a minecraft going from
submarkers to sub
markers
-
add a-frame support
-
support for learning new area
-
support for learning new area
- can i just use the area-learner.html
-
support of multi-marker description
-
do a post about multimarker
-
how to use them,
-
workflow: learning then using
-
pro: larger area can be coverded by
-
what to do with the official multimarker support
-
make an example for it, and keep supporting it
# How to compute the result of the learning
-
we got statistics on the position/orientation/scale between each marker seen simultaneously
-
we want a transposition matrix relative to the origin markersControls
-
do a post about multimarker - https://medium.com/p/4bcafc785dfd/edit
-
step1 - build the transposition matrix relative the origin marker controls
-
store it in the userData
-
use similar format as local matrix
-
step2 - generate the file
-
LATER: how to get more robust statistics?
-
DONE merge it all in the README.md
three.js/examples/multi-markers/examples/learner.html
浏览文件 @
02fddda5
...
...
@@ -164,6 +164,8 @@
markerControls
.
object3d
.
add
(
markerHelper
.
object3d
)
}
// TODO here put a THREEx.ArSmoothedControls behind a flag - could be useful for tunning
// store it in the parameters
subMarkersControls
.
push
(
markerControls
)
})
...
...
three.js/examples/multi-markers/examples/player.html
浏览文件 @
02fddda5
...
...
@@ -302,8 +302,6 @@
multiMarkerPlay
(
JSON
.
stringify
(
multiMarkerFile
))
}
//////////////////////////////////////////////////////////////////////////////////
// render the whole thing on the page
...
...
three.js/threex-arbasecontrols.js
0 → 100644
浏览文件 @
02fddda5
var
THREEx
=
THREEx
||
{}
THREEx
.
ArBaseControls
=
function
(
object3d
){
this
.
id
=
THREEx
.
ArBaseControls
.
id
++
this
.
object3d
=
object3d
// Events to honor
// this.dispatchEvent({ type: 'becameVisible' })
// this.dispatchEvent({ type: 'becameUnVisible' })
}
THREEx
.
ArBaseControls
.
id
=
0
Object
.
assign
(
THREEx
.
ArBaseControls
.
prototype
,
THREE
.
EventDispatcher
.
prototype
);
//////////////////////////////////////////////////////////////////////////////
// Functions
//////////////////////////////////////////////////////////////////////////////
/**
* error catching function for update()
*/
THREEx
.
ArBaseControls
.
prototype
.
update
=
function
(){
console
.
assert
(
false
,
'
you need to implement your own update
'
)
}
three.js/threex-arsmoothedcontrols.js
浏览文件 @
02fddda5
...
...
@@ -103,7 +103,7 @@ THREEx.ArSmoothedControls.prototype.update = function(targetObject3d){
object3d
.
scale
.
lerp
(
targetObject3d
.
scale
,
parameters
.
lerpScale
)
}
// disable
d
the lerp by directly copying targetObject3d position/quaternion/scale
// disable the lerp by directly copying targetObject3d position/quaternion/scale
// if( false ){
// this.object3d.position.copy( targetObject3d.position )
// this.object3d.quaternion.copy( targetObject3d.quaternion )
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录