Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
3ecb176e
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,发现更多精彩内容 >>
提交
3ecb176e
编写于
7月 20, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
working on aframe tango
上级
20c4edae
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
1049 addition
and
525 deletion
+1049
-525
TODO.md
TODO.md
+5
-0
aframe/aframe-ar-new.js
aframe/aframe-ar-new.js
+373
-0
aframe/aframe-ar.js
aframe/aframe-ar.js
+3
-3
aframe/build/aframe-ar.js
aframe/build/aframe-ar.js
+217
-173
aframe/examples/basic.html
aframe/examples/basic.html
+1
-1
aframe/examples/minimal.html
aframe/examples/minimal.html
+1
-1
aframe/examples/mobile-performance.html
aframe/examples/mobile-performance.html
+1
-1
aframe/examples/multiple-independent-markers.html
aframe/examples/multiple-independent-markers.html
+3
-3
aframe/examples/test-runner.html
aframe/examples/test-runner.html
+1
-1
aframe/examples/tracking-tango.html
aframe/examples/tracking-tango.html
+44
-0
three.js/build/ar.js
three.js/build/ar.js
+210
-169
three.js/examples/dev.html
three.js/examples/dev.html
+3
-3
three.js/threex-artoolkitsource.js
three.js/threex-artoolkitsource.js
+5
-2
webvr-polyfill/build/artoolkit-webvr-polyfill.js
webvr-polyfill/build/artoolkit-webvr-polyfill.js
+182
-168
未找到文件。
TODO.md
浏览文件 @
3ecb176e
...
@@ -10,6 +10,11 @@
...
@@ -10,6 +10,11 @@
-
```arglCameraFrustum(&((arc->paramLT)->param), arc->nearPlane, arc->farPlane, arc->cameraLens);```
-
```arglCameraFrustum(&((arc->paramLT)->param), arc->nearPlane, arc->farPlane, arc->cameraLens);```
-
this should be called in setNearPlane
-
this should be called in setNearPlane
-
do test with a special webrtc emulation layer
-
so i can download video and/or image - better for testing
-
handle pwa stuff - useful for phone
-
https://twitter.com/jerome_etienne/status/888008537984708608
# aframe-ar.js new
# aframe-ar.js new
-
there is a resize every 1/60 seconds ??
-
there is a resize every 1/60 seconds ??
-
test on mobile
-
test on mobile
...
...
aframe/aframe-ar-new.js
0 → 100644
浏览文件 @
3ecb176e
//////////////////////////////////////////////////////////////////////////////
// Code Separator
//////////////////////////////////////////////////////////////////////////////
// to keep backward compatibility with deprecated code
// AFRAME.registerComponent('arjs', buildSystemParameter())
// AFRAME.registerComponent('artoolkit', buildSystemParameter())
// function buildSystemParameter(){ return {
// AFRAME.registerSystem('arjs', {
AFRAME
.
registerSystem
(
'
arjs
'
,
{
schema
:
{
trackingBackend
:
{
type
:
'
string
'
,
default
:
'
artoolkit
'
,
},
areaLearningButton
:
{
type
:
'
boolean
'
,
default
:
true
,
},
performanceProfile
:
{
type
:
'
string
'
,
default
:
'
default
'
,
},
// old parameters
debug
:
{
type
:
'
boolean
'
,
default
:
false
},
detectionMode
:
{
type
:
'
string
'
,
default
:
''
,
},
matrixCodeType
:
{
type
:
'
string
'
,
default
:
''
,
},
cameraParametersUrl
:
{
type
:
'
string
'
,
default
:
''
,
},
maxDetectionRate
:
{
type
:
'
number
'
,
default
:
-
1
},
sourceType
:
{
type
:
'
string
'
,
default
:
''
,
},
sourceUrl
:
{
type
:
'
string
'
,
default
:
''
,
},
sourceWidth
:
{
type
:
'
number
'
,
default
:
-
1
},
sourceHeight
:
{
type
:
'
number
'
,
default
:
-
1
},
displayWidth
:
{
type
:
'
number
'
,
default
:
-
1
},
displayHeight
:
{
type
:
'
number
'
,
default
:
-
1
},
canvasWidth
:
{
type
:
'
number
'
,
default
:
-
1
},
canvasHeight
:
{
type
:
'
number
'
,
default
:
-
1
},
},
//////////////////////////////////////////////////////////////////////////////
// Code Separator
//////////////////////////////////////////////////////////////////////////////
init
:
function
()
{
var
_this
=
this
// setup artoolkitProfile
var
artoolkitProfile
=
new
THREEx
.
ArToolkitProfile
()
artoolkitProfile
.
sourceWebcam
()
artoolkitProfile
.
trackingBackend
(
this
.
data
.
trackingBackend
)
artoolkitProfile
.
performance
(
this
.
data
.
performanceProfile
)
//////////////////////////////////////////////////////////////////////////////
// honor this.data
//////////////////////////////////////////////////////////////////////////////
// honor this.data and push what has been modified into artoolkitProfile
if
(
this
.
data
.
debug
!==
false
)
artoolkitProfile
.
contextParameters
.
debug
=
this
.
data
.
debug
if
(
this
.
data
.
detectionMode
!==
''
)
artoolkitProfile
.
contextParameters
.
detectionMode
=
this
.
data
.
detectionMode
if
(
this
.
data
.
matrixCodeType
!==
''
)
artoolkitProfile
.
contextParameters
.
matrixCodeType
=
this
.
data
.
matrixCodeType
if
(
this
.
data
.
cameraParametersUrl
!==
''
)
artoolkitProfile
.
contextParameters
.
cameraParametersUrl
=
this
.
data
.
cameraParametersUrl
if
(
this
.
data
.
maxDetectionRate
!==
-
1
)
artoolkitProfile
.
contextParameters
.
maxDetectionRate
=
this
.
data
.
maxDetectionRate
if
(
this
.
data
.
sourceType
!==
''
)
artoolkitProfile
.
contextParameters
.
sourceType
=
this
.
data
.
sourceType
if
(
this
.
data
.
sourceUrl
!==
''
)
artoolkitProfile
.
contextParameters
.
sourceUrl
=
this
.
data
.
sourceUrl
if
(
this
.
data
.
sourceWidth
!==
-
1
)
artoolkitProfile
.
contextParameters
.
sourceWidth
=
this
.
data
.
sourceWidth
if
(
this
.
data
.
sourceHeight
!==
-
1
)
artoolkitProfile
.
contextParameters
.
sourceHeight
=
this
.
data
.
sourceHeight
if
(
this
.
data
.
displayWidth
!==
-
1
)
artoolkitProfile
.
contextParameters
.
displayWidth
=
this
.
data
.
displayWidth
if
(
this
.
data
.
displayHeight
!==
-
1
)
artoolkitProfile
.
contextParameters
.
displayHeight
=
this
.
data
.
displayHeight
if
(
this
.
data
.
canvasWidth
!==
-
1
)
artoolkitProfile
.
contextParameters
.
canvasWidth
=
this
.
data
.
canvasWidth
if
(
this
.
data
.
canvasHeight
!==
-
1
)
artoolkitProfile
.
contextParameters
.
canvasHeight
=
this
.
data
.
canvasHeight
////////////////////////////////////////////////////////////////////////////////
// handle arToolkitSource
////////////////////////////////////////////////////////////////////////////////
var
arToolkitSource
=
new
THREEx
.
ArToolkitSource
(
artoolkitProfile
.
sourceParameters
)
this
.
arToolkitSource
=
arToolkitSource
arToolkitSource
.
init
(
function
onReady
(){
// handle resize of renderer
onResize
()
// kludge to write a 'resize' event - use exponentialBackoff delay
var
startedAt
=
Date
.
now
()
var
exponentialBackoffDelay
=
1000
/
60
setTimeout
(
function
callback
(){
if
(
Date
.
now
()
-
startedAt
>
5
*
1000
)
return
// update delay
exponentialBackoffDelay
*=
1.2
;
exponentialBackoffDelay
=
Math
.
min
(
exponentialBackoffDelay
,
1
*
1000
)
setTimeout
(
callback
,
exponentialBackoffDelay
)
// trigger a resize
window
.
dispatchEvent
(
new
Event
(
'
resize
'
));
console
.
log
(
'
trigger a resize
'
,
exponentialBackoffDelay
)
},
exponentialBackoffDelay
)
})
// handle resize
window
.
addEventListener
(
'
resize
'
,
onResize
)
function
onResize
(){
// ugly kludge to get resize on aframe... not even sure it works
arToolkitSource
.
onResizeElement
()
arToolkitSource
.
copyElementSizeTo
(
document
.
body
)
var
buttonElement
=
document
.
querySelector
(
'
.a-enter-vr
'
)
if
(
buttonElement
){
buttonElement
.
style
.
position
=
'
fixed
'
}
}
////////////////////////////////////////////////////////////////////////////////
// initialize arToolkitContext
////////////////////////////////////////////////////////////////////////////////
// create atToolkitContext
var
arToolkitContext
=
new
THREEx
.
ArToolkitContext
(
artoolkitProfile
.
contextParameters
)
this
.
arToolkitContext
=
arToolkitContext
// initialize it
arToolkitContext
.
init
(
function
onCompleted
(){
// // copy projection matrix to camera
// var projectionMatrixArr = arToolkitContext.arController.getCameraMatrix();
// _this.sceneEl.camera.projectionMatrix.fromArray(projprojectionMatrixArrectionMatrix);
})
//////////////////////////////////////////////////////////////////////////////
// area learning
//////////////////////////////////////////////////////////////////////////////
// export function to navigateToLearnerPage
this
.
navigateToLearnerPage
=
function
(){
var
learnerURL
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
examples/multi-markers/examples/learner.html
'
THREEx
.
ArMultiMarkerUtils
.
navigateToLearnerPage
(
learnerURL
,
_this
.
data
.
trackingBackend
)
}
// export function to initAreaLearningButton
this
.
initAreaLearningButton
=
function
(){
// honor arjsSystem.data.areaLearningButton
if
(
this
.
data
.
areaLearningButton
===
false
)
return
// if there is already a button, do nothing
if
(
document
.
querySelector
(
'
#arjsAreaLearningButton
'
)
!==
null
)
return
// create the img
var
imgElement
=
document
.
createElement
(
'
img
'
)
imgElement
.
id
=
'
arjsAreaLearningButton
'
imgElement
.
style
.
position
=
'
fixed
'
imgElement
.
style
.
bottom
=
'
16px
'
imgElement
.
style
.
left
=
'
16px
'
imgElement
.
style
.
width
=
'
48px
'
imgElement
.
style
.
height
=
'
48px
'
imgElement
.
style
.
zIndex
=
1
imgElement
.
src
=
THREEx
.
ArToolkitContext
.
baseURL
+
"
examples/multi-markers/examples/images/record-start.png
"
document
.
body
.
appendChild
(
imgElement
)
imgElement
.
addEventListener
(
'
click
'
,
function
(){
_this
.
navigateToLearnerPage
()
})
}
},
tick
:
function
(
now
,
delta
){
if
(
this
.
arToolkitSource
.
ready
===
false
)
return
// copy projection matrix to camera
if
(
this
.
arToolkitContext
.
arController
!==
null
){
this
.
el
.
sceneEl
.
camera
.
projectionMatrix
.
copy
(
this
.
arToolkitContext
.
getProjectionMatrix
()
);
}
this
.
arToolkitContext
.
update
(
this
.
arToolkitSource
.
domElement
)
},
})
//////////////////////////////////////////////////////////////////////////////
// arjsmarker
//////////////////////////////////////////////////////////////////////////////
AFRAME
.
registerComponent
(
'
arjsmarker
'
,
{
dependencies
:
[
'
arjs
'
,
'
artoolkit
'
],
schema
:
{
preset
:
{
type
:
'
string
'
,
},
markerhelpers
:
{
// IIF preset === 'area'
type
:
'
boolean
'
,
default
:
false
,
},
// controls parameters
size
:
{
type
:
'
number
'
,
default
:
1
},
type
:
{
type
:
'
string
'
,
},
patternUrl
:
{
type
:
'
string
'
,
},
barcodeValue
:
{
type
:
'
number
'
},
changeMatrixMode
:
{
type
:
'
string
'
,
default
:
'
modelViewMatrix
'
,
},
minConfidence
:
{
type
:
'
number
'
,
default
:
0.6
,
},
},
init
:
function
()
{
var
_this
=
this
// actually init arMarkerControls
var
arjsSystem
=
this
.
el
.
sceneEl
.
systems
.
arjs
||
this
.
el
.
sceneEl
.
systems
.
artoolkit
var
artoolkitContext
=
arjsSystem
.
arToolkitContext
var
scene
=
this
.
el
.
sceneEl
.
object3D
// honor this.data.preset
if
(
this
.
data
.
preset
===
'
hiro
'
){
this
.
data
.
type
=
'
pattern
'
this
.
data
.
patternUrl
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
examples/marker-training/examples/pattern-files/pattern-hiro.patt
'
}
else
if
(
this
.
data
.
preset
===
'
kanji
'
){
this
.
data
.
type
=
'
pattern
'
this
.
data
.
patternUrl
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
examples/marker-training/examples/pattern-files/pattern-kanji.patt
'
}
else
if
(
this
.
data
.
preset
===
'
area
'
){
this
.
data
.
type
=
'
area
'
}
else
{
console
.
assert
(
this
.
data
.
preset
===
''
,
'
illegal preset value
'
+
this
.
data
.
preset
)
}
// build a smoothedControls
this
.
_markerRoot
=
new
THREE
.
Group
()
scene
.
add
(
this
.
_markerRoot
)
this
.
_arMarkerControls
=
null
this
.
_multiMarkerControls
=
null
// create the controls
if
(
this
.
data
.
type
===
'
area
'
){
// if no localStorage.ARjsMultiMarkerFile, then write one with default marker
if
(
localStorage
.
getItem
(
'
ARjsMultiMarkerFile
'
)
===
null
){
THREEx
.
ArMultiMarkerUtils
.
storeDefaultMultiMarkerFile
(
arjsSystem
.
data
.
trackingBackend
)
}
// get multiMarkerFile from localStorage
console
.
assert
(
localStorage
.
getItem
(
'
ARjsMultiMarkerFile
'
)
!==
null
)
var
multiMarkerFile
=
localStorage
.
getItem
(
'
ARjsMultiMarkerFile
'
)
// create ArMultiMarkerControls
this
.
_multiMarkerControls
=
THREEx
.
ArMultiMarkerControls
.
fromJSON
(
artoolkitContext
,
scene
,
this
.
_markerRoot
,
multiMarkerFile
,
{
changeMatrixMode
:
this
.
data
.
changeMatrixMode
})
console
.
log
(
'
this.data.markerhelpers
'
,
this
.
data
.
markerhelpers
)
// display THREEx.ArMarkerHelper if needed - useful to debug
if
(
this
.
data
.
markerhelpers
===
true
){
this
.
_multiMarkerControls
.
subMarkersControls
.
forEach
(
function
(
subMarkerControls
){
// add an helper to visuable each sub-marker
var
markerHelper
=
new
THREEx
.
ArMarkerHelper
(
subMarkerControls
)
scene
.
add
(
markerHelper
.
object3d
)
})
}
}
else
if
(
this
.
data
.
type
===
'
pattern
'
||
this
.
data
.
type
===
'
barcode
'
||
this
.
data
.
type
===
'
unknown
'
){
this
.
_arMarkerControls
=
new
THREEx
.
ArMarkerControls
(
artoolkitContext
,
this
.
_markerRoot
,
this
.
data
)
}
else
console
.
assert
(
false
)
// build a smoothedControls
this
.
arSmoothedControls
=
new
THREEx
.
ArSmoothedControls
(
this
.
el
.
object3D
)
// honor arjsSystem.data.areaLearningButton
if
(
this
.
data
.
type
===
'
area
'
)
arjsSystem
.
initAreaLearningButton
()
},
remove
:
function
(){
// this._arMarkerControls.dispose()
},
update
:
function
()
{
// FIXME this mean to change the recode in trackBarcodeMarkerId ?
// var markerRoot = this.el.object3D;
// markerRoot.userData.size = this.data.size;
},
tick
:
function
(){
if
(
this
.
data
.
changeMatrixMode
===
'
cameraTransformMatrix
'
){
this
.
el
.
sceneEl
.
object3D
.
visible
=
this
.
el
.
object3D
.
visible
;
}
if
(
this
.
_multiMarkerControls
!==
null
){
// update smoothedControls parameters depending on how many markers are visible in multiMarkerControls
this
.
_multiMarkerControls
.
updateSmoothedControls
(
this
.
arSmoothedControls
)
}
// update smoothedControls position
this
.
arSmoothedControls
.
update
(
this
.
_markerRoot
)
}
});
//////////////////////////////////////////////////////////////////////////////
// define some primitives shortcuts
//////////////////////////////////////////////////////////////////////////////
AFRAME
.
registerPrimitive
(
'
a-marker
'
,
AFRAME
.
utils
.
extendDeep
({},
AFRAME
.
primitives
.
getMeshMixin
(),
{
defaultComponents
:
{
'
arjsmarker
'
:
{},
},
mappings
:
{
'
type
'
:
'
arjsmarker.type
'
,
'
size
'
:
'
arjsmarker.size
'
,
'
url
'
:
'
arjsmarker.patternUrl
'
,
'
value
'
:
'
arjsmarker.barcodeValue
'
,
'
preset
'
:
'
arjsmarker.preset
'
,
'
minConfidence
'
:
'
arjsmarker.minConfidence
'
,
'
markerhelpers
'
:
'
arjsmarker.markerhelpers
'
,
}
}));
AFRAME
.
registerPrimitive
(
'
a-marker-camera
'
,
AFRAME
.
utils
.
extendDeep
({},
AFRAME
.
primitives
.
getMeshMixin
(),
{
defaultComponents
:
{
'
arjsmarker
'
:
{
changeMatrixMode
:
'
cameraTransformMatrix
'
},
'
camera
'
:
true
,
},
mappings
:
{
'
type
'
:
'
arjsmarker.type
'
,
'
size
'
:
'
arjsmarker.size
'
,
'
url
'
:
'
arjsmarker.patternUrl
'
,
'
value
'
:
'
arjsmarker.barcodeValue
'
,
'
preset
'
:
'
arjsmarker.preset
'
,
'
minConfidence
'
:
'
arjsmarker.minConfidence
'
,
'
markerhelpers
'
:
'
arjsmarker.markerhelpers
'
,
}
}));
aframe/aframe-ar.js
浏览文件 @
3ecb176e
...
@@ -123,7 +123,7 @@ AFRAME.registerSystem('arjs', {
...
@@ -123,7 +123,7 @@ AFRAME.registerSystem('arjs', {
// handle resize of renderer
// handle resize of renderer
onResize
()
onResize
()
// TODO this is crappy
// TODO this is crappy
- code an exponential backoff - max 1 seconds
// kludge to write a 'resize' event
// kludge to write a 'resize' event
var
startedAt
=
Date
.
now
()
var
startedAt
=
Date
.
now
()
var
timerId
=
setInterval
(
function
(){
var
timerId
=
setInterval
(
function
(){
...
@@ -140,7 +140,8 @@ AFRAME.registerSystem('arjs', {
...
@@ -140,7 +140,8 @@ AFRAME.registerSystem('arjs', {
window
.
addEventListener
(
'
resize
'
,
onResize
)
window
.
addEventListener
(
'
resize
'
,
onResize
)
function
onResize
(){
function
onResize
(){
// ugly kludge to get resize on aframe... not even sure it works
// ugly kludge to get resize on aframe... not even sure it works
arToolkitSource
.
onResize
(
document
.
body
)
arToolkitSource
.
onResizeElement
()
arToolkitSource
.
copyElementSizeTo
(
document
.
body
)
var
buttonElement
=
document
.
querySelector
(
'
.a-enter-vr
'
)
var
buttonElement
=
document
.
querySelector
(
'
.a-enter-vr
'
)
if
(
buttonElement
){
if
(
buttonElement
){
...
@@ -263,7 +264,6 @@ AFRAME.registerComponent('arjsmarker', {
...
@@ -263,7 +264,6 @@ AFRAME.registerComponent('arjsmarker', {
this
.
data
.
patternUrl
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
examples/marker-training/examples/pattern-files/pattern-kanji.patt
'
this
.
data
.
patternUrl
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
examples/marker-training/examples/pattern-files/pattern-kanji.patt
'
}
else
if
(
this
.
data
.
preset
===
'
area
'
){
}
else
if
(
this
.
data
.
preset
===
'
area
'
){
this
.
data
.
type
=
'
area
'
this
.
data
.
type
=
'
area
'
// fall through
}
else
{
}
else
{
console
.
assert
(
this
.
data
.
preset
===
''
,
'
illegal preset value
'
+
this
.
data
.
preset
)
console
.
assert
(
this
.
data
.
preset
===
''
,
'
illegal preset value
'
+
this
.
data
.
preset
)
}
}
...
...
aframe/build/aframe-ar.js
浏览文件 @
3ecb176e
此差异已折叠。
点击以展开。
aframe/examples/basic.html
浏览文件 @
3ecb176e
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<a-marker
preset=
'hiro'
>
<a-marker
preset=
'hiro'
>
<!-- define the object which gonna be put on this marker -->
<!-- define the object which gonna be put on this marker -->
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double'
>
<a-torus-knot
radius=
'0.2
7
'
radius-tubular=
'0.05'
>
<a-torus-knot
radius=
'0.2
6
'
radius-tubular=
'0.05'
>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
</a-torus-knot>
</a-torus-knot>
</a-box>
</a-box>
...
...
aframe/examples/minimal.html
浏览文件 @
3ecb176e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<script
src=
"https://aframe.io/releases/0.6.0/aframe.min.js"
></script>
<script
src=
"https://aframe.io/releases/0.6.0/aframe.min.js"
></script>
<script
src=
"https://rawgit.com/jeromeetienne/ar.js/master/aframe/build/aframe-ar.js"
></script>
<script
src=
"https://rawgit.com/jeromeetienne/ar.js/master/aframe/build/aframe-ar.js"
></script>
<body
style=
'margin : 0px; overflow: hidden;'
>
<body
style=
'margin : 0px; overflow: hidden;'
>
<a-scene
embedded
ar
toolkit
=
'sourceType: webcam;'
>
<a-scene
embedded
ar
js
=
'sourceType: webcam;'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5;'
></a-box>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5;'
></a-box>
<a-marker-camera
preset=
'hiro'
></a-marker-camera>
<a-marker-camera
preset=
'hiro'
></a-marker-camera>
</a-scene>
</a-scene>
...
...
aframe/examples/mobile-performance.html
浏览文件 @
3ecb176e
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<!-- define the object which gonna be put on this marker -->
<!-- define the object which gonna be put on this marker -->
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double'
>
<a-torus-knot
radius=
'0.2
7
'
radius-tubular=
'0.05'
>
<a-torus-knot
radius=
'0.2
6
'
radius-tubular=
'0.05'
>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"3000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"3000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
</a-torus-knot>
</a-torus-knot>
</a-box>
</a-box>
...
...
aframe/examples/multiple-independent-markers.html
浏览文件 @
3ecb176e
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<!-- handle hiro marker -->
<!-- handle hiro marker -->
<a-marker
preset=
'hiro'
>
<a-marker
preset=
'hiro'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double;color:red;'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double;color:red;'
>
<a-torus-knot
radius=
'0.2
7
'
radius-tubular=
'0.05'
>
<a-torus-knot
radius=
'0.2
6
'
radius-tubular=
'0.05'
>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
</a-torus-knot>
</a-torus-knot>
</a-box>
</a-box>
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<!-- handle hiro marker -->
<!-- handle hiro marker -->
<a-marker
type=
'barcode'
barcodeValue=
'5'
>
<a-marker
type=
'barcode'
barcodeValue=
'5'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double;color:pink;'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double;color:pink;'
>
<a-torus-knot
radius=
'0.2
7
'
radius-tubular=
'0.05'
>
<a-torus-knot
radius=
'0.2
6
'
radius-tubular=
'0.05'
>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
</a-torus-knot>
</a-torus-knot>
</a-box>
</a-box>
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<!-- handle kanji marker -->
<!-- handle kanji marker -->
<a-marker
preset=
'kanji'
>
<a-marker
preset=
'kanji'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double;color:green;'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double;color:green;'
>
<a-torus-knot
radius=
'0.2
7
'
radius-tubular=
'0.05'
>
<a-torus-knot
radius=
'0.2
6
'
radius-tubular=
'0.05'
>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"5000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
</a-torus-knot>
</a-torus-knot>
</a-box>
</a-box>
...
...
aframe/examples/test-runner.html
浏览文件 @
3ecb176e
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<a-marker
preset=
'hiro'
>
<a-marker
preset=
'hiro'
>
<!-- define the object which gonna be put on this marker -->
<!-- define the object which gonna be put on this marker -->
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double'
>
<a-torus-knot
radius=
'0.2
7
'
radius-tubular=
'0.05'
>
<a-torus-knot
radius=
'0.2
6
'
radius-tubular=
'0.05'
>
</a-torus-knot>
</a-torus-knot>
</a-box>
</a-box>
</a-marker>
</a-marker>
...
...
aframe/examples/tracking-tango.html
0 → 100644
浏览文件 @
3ecb176e
<!DOCTYPE html>
<!-- include a-frame -->
<script
src=
"vendor/aframe.min.js"
></script>
<!-- include aframe-ar.js -->
<script
src=
"../aframe-ar-new.js"
></script>
<!-- jsartookit -->
<script
src=
"../../three.js/vendor/jsartoolkit5/build/artoolkit.min.js"
></script>
<script
src=
"../../three.js/vendor/jsartoolkit5/js/artoolkit.api.js"
></script>
<!-- include ar.js -->
<script
src=
"../../three.js/threex-artoolkitcontext.js"
></script>
<script
src=
"../../three.js/threex-artoolkitsource.js"
></script>
<script
src=
'../../three.js/threex-artoolkitprofile.js'
></script>
<script
src=
"../../three.js/threex-arbasecontrols.js"
></script>
<script
src=
"../../three.js/threex-armarkercontrols.js"
></script>
<script
src=
"../../three.js/threex-armarkerhelper.js"
></script>
<script
src=
"../../three.js/threex-arsmoothedcontrols.js"
></script>
<!-- include for tango trackingBackend -->
<script
src=
'../../three.js/vendor/chromium-tango/THREE.WebAR.js'
></script>
<body
style=
'margin : 0px; overflow: hidden; font-family: Monospace;'
><div
style=
'position: fixed; top: 10px; width:inherit; text-align: center; z-index: 1;'
>
<a
href=
"https://github.com/jeromeetienne/AR.js/"
target=
"_blank"
>
AR.js
</a>
- tango example for a-frame by
<a
href=
'https://twitter.com/jerome_etienne'
target=
'_blank'
>
@jerome_etienne
</a>
</div>
<a-scene
embedded
arjs=
'sourceType: webcam; trackingBackend: artoolkit;'
>
<a-box
position=
'0 0.5 0'
material=
'opacity: 0.5; side: double; color: blue;'
>
<a-torus-knot
radius=
'0.26'
radius-tubular=
'0.05'
>
<a-animation
attribute=
"rotation"
to=
"360 0 0"
dur=
"3000"
easing=
'linear'
repeat=
"indefinite"
></a-animation>
</a-torus-knot>
</a-box>
<a-marker-camera
preset=
'hiro'
></a-marker-camera>
</a-scene>
<!-- <a-scene embedded arjs='sourceType: webcam; trackingBackend: tango;'>
<a-box position='0 0.5 0' material='opacity: 0.5; side: double;color:pink;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'>
<a-animation attribute="rotation" to="360 0 0" dur="5000" easing='linear' repeat="indefinite"></a-animation>
</a-torus-knot>
</a-box>
<a-marker-camera preset='tango'></a-marker-camera>
</a-scene> -->
</body>
</html>
three.js/build/ar.js
浏览文件 @
3ecb176e
此差异已折叠。
点击以展开。
three.js/examples/dev.html
浏览文件 @
3ecb176e
...
@@ -85,10 +85,10 @@
...
@@ -85,10 +85,10 @@
onResize
()
onResize
()
})
})
function
onResize
(){
function
onResize
(){
arToolkitSource
.
onResize
()
arToolkitSource
.
onResize
Element
()
arToolkitSource
.
copySizeTo
(
renderer
.
domElement
)
arToolkitSource
.
copy
Element
SizeTo
(
renderer
.
domElement
)
if
(
arToolkitContext
.
arController
!==
null
){
if
(
arToolkitContext
.
arController
!==
null
){
arToolkitSource
.
copySizeTo
(
arToolkitContext
.
arController
.
canvas
)
arToolkitSource
.
copy
Element
SizeTo
(
arToolkitContext
.
arController
.
canvas
)
}
}
}
}
...
...
three.js/threex-artoolkitsource.js
浏览文件 @
3ecb176e
...
@@ -277,7 +277,10 @@ THREEx.ArToolkitSource.prototype.onResizeElement = function(mirrorDomElements){
...
@@ -277,7 +277,10 @@ THREEx.ArToolkitSource.prototype.onResizeElement = function(mirrorDomElements){
}
}
if
(
arguments
.
length
!==
0
)
console
.
warn
(
'
use bad signature for arToolkitSource.copyElementSizeTo
'
)
if
(
arguments
.
length
!==
0
){
debugger
console
.
warn
(
'
use bad signature for arToolkitSource.copyElementSizeTo
'
)
}
// honor default parameters
// honor default parameters
// if( mirrorDomElements !== undefined ) console.warn('still use the old resize. fix it')
// if( mirrorDomElements !== undefined ) console.warn('still use the old resize. fix it')
if
(
mirrorDomElements
===
undefined
)
mirrorDomElements
=
[]
if
(
mirrorDomElements
===
undefined
)
mirrorDomElements
=
[]
...
@@ -285,7 +288,7 @@ THREEx.ArToolkitSource.prototype.onResizeElement = function(mirrorDomElements){
...
@@ -285,7 +288,7 @@ THREEx.ArToolkitSource.prototype.onResizeElement = function(mirrorDomElements){
// Mirror _this.domElement.style to mirrorDomElements
// Mirror _this.domElement.style to mirrorDomElements
mirrorDomElements
.
forEach
(
function
(
domElement
){
mirrorDomElements
.
forEach
(
function
(
domElement
){
_this
.
copySizeTo
(
domElement
)
_this
.
copy
Element
SizeTo
(
domElement
)
})
})
}
}
...
...
webvr-polyfill/build/artoolkit-webvr-polyfill.js
浏览文件 @
3ecb176e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录