Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
66c9e6bc
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,发现更多精彩内容 >>
提交
66c9e6bc
编写于
6月 02, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixing tab after pull request
上级
3931ab0a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
53 deletion
+53
-53
aframe/aframe-ar.js
aframe/aframe-ar.js
+53
-53
未找到文件。
aframe/aframe-ar.js
浏览文件 @
66c9e6bc
...
...
@@ -4,10 +4,10 @@
AFRAME
.
registerSystem
(
'
artoolkit
'
,
{
schema
:
{
debug
:
{
type
:
'
boolean
'
,
default
:
false
},
debug
:
{
type
:
'
boolean
'
,
default
:
false
},
detectionMode
:
{
type
:
'
string
'
,
default
:
'
mono
'
,
...
...
@@ -23,13 +23,13 @@ AFRAME.registerSystem('artoolkit', {
type
:
'
number
'
,
default
:
60
},
sourceType
:
{
type
:
'
string
'
,
default
:
'
webcam
'
,
},
sourceUrl
:
{
type
:
'
string
'
,
},
sourceType
:
{
type
:
'
string
'
,
default
:
'
webcam
'
,
},
sourceUrl
:
{
type
:
'
string
'
,
},
sourceWidth
:
{
type
:
'
number
'
,
default
:
640
...
...
@@ -55,23 +55,23 @@ AFRAME.registerSystem('artoolkit', {
default
:
480
},
},
//////////////////////////////////////////////////////////////////////////////
// Code Separator
//////////////////////////////////////////////////////////////////////////////
init
:
function
()
{
var
_this
=
this
if
(
this
.
data
.
cameraParametersUrl
===
''
){
this
.
data
.
cameraParametersUrl
=
THREEx
.
ArToolkitContext
.
baseURL
+
'
../data/data/camera_para.dat
'
}
////////////////////////////////////////////////////////////////////////////////
// handle arToolkitSource
////////////////////////////////////////////////////////////////////////////////
var
arToolkitSource
=
new
THREEx
.
ArToolkitSource
(
this
.
data
)
this
.
arToolkitSource
=
arToolkitSource
arToolkitSource
.
init
(
function
onReady
(){
...
...
@@ -94,14 +94,14 @@ AFRAME.registerSystem('artoolkit', {
// handle arToolkitSource resize
// var rendererDomElement = _this.sceneEl.renderer ? _this.sceneEl.renderer.domElement : undefined
// arToolkitSource.onResize(rendererDomElement)
// var rendererDomElement = _this.sceneEl.renderer ? _this.sceneEl.renderer.domElement : undefined
// console.log('dd', _this.sceneEl.renderer.domElement)
// ugly kludge to get resize on aframe... not even sure it works
arToolkitSource
.
onResize
(
document
.
body
)
arToolkitSource
.
domElement
.
style
.
marginLeft
=
'
0px
'
var
buttonElement
=
document
.
querySelector
(
'
.a-enter-vr
'
)
if
(
buttonElement
){
...
...
@@ -118,22 +118,22 @@ AFRAME.registerSystem('artoolkit', {
// initialize it
arToolkitContext
.
init
(
function
onCompleted
(){
// // copy projection matrix to camera
// var projectionMatrixArr = arToolkitContext.arController.getCameraMatrix();
// _this.sceneEl.camera.projectionMatrix.fromArray(projprojectionMatrixArrectionMatrix);
// var projectionMatrixArr = arToolkitContext.arController.getCameraMatrix();
// _this.sceneEl.camera.projectionMatrix.fromArray(projprojectionMatrixArrectionMatrix);
})
},
tick
:
function
(
now
,
delta
){
tick
:
function
(
now
,
delta
){
if
(
this
.
arToolkitSource
.
ready
===
false
)
return
// var projectionMatrixArr = this.arToolkitContext.arController.getCameraMatrix();
// this.sceneEl.camera.projectionMatrix.fromArray(projectionMatrixArr);
// var projectionMatrixArr = this.arToolkitContext.arController.getCameraMatrix();
// this.sceneEl.camera.projectionMatrix.fromArray(projectionMatrixArr);
// copy projection matrix to camera
if
(
this
.
arToolkitContext
.
arController
!==
null
){
this
.
sceneEl
.
camera
.
projectionMatrix
.
copy
(
this
.
arToolkitContext
.
getProjectionMatrix
()
);
}
this
.
arToolkitContext
.
update
(
this
.
arToolkitSource
.
domElement
)
},
});
...
...
@@ -143,7 +143,7 @@ AFRAME.registerSystem('artoolkit', {
// Code Separator
//////////////////////////////////////////////////////////////////////////////
AFRAME
.
registerComponent
(
'
artoolkitmarker
'
,
{
dependencies
:
[
'
artoolkit
'
],
dependencies
:
[
'
artoolkit
'
],
schema
:
{
size
:
{
type
:
'
number
'
,
...
...
@@ -188,8 +188,8 @@ AFRAME.registerComponent('artoolkitmarker', {
},
update
:
function
()
{
// FIXME this mean to change the recode in trackBarcodeMarkerId ?
// var markerRoot = this.el.object3D;
// markerRoot.userData.size = this.data.size;
// var markerRoot = this.el.object3D;
// markerRoot.userData.size = this.data.size;
},
tick
:
function
(){
if
(
this
.
data
.
changeMatrixMode
===
'
cameraTransformMatrix
'
){
...
...
@@ -203,30 +203,30 @@ AFRAME.registerComponent('artoolkitmarker', {
//////////////////////////////////////////////////////////////////////////////
AFRAME
.
registerPrimitive
(
'
a-marker
'
,
AFRAME
.
utils
.
extendDeep
({},
AFRAME
.
primitives
.
getMeshMixin
(),
{
defaultComponents
:
{
artoolkitmarker
:
{},
},
mappings
:
{
'
type
'
:
'
artoolkitmarker.type
'
,
'
size
'
:
'
artoolkitmarker.size
'
,
'
url
'
:
'
artoolkitmarker.patternUrl
'
,
'
value
'
:
'
artoolkitmarker.barcodeValue
'
,
'
preset
'
:
'
artoolkitmarker.preset
'
,
defaultComponents
:
{
artoolkitmarker
:
{},
},
mappings
:
{
'
type
'
:
'
artoolkitmarker.type
'
,
'
size
'
:
'
artoolkitmarker.size
'
,
'
url
'
:
'
artoolkitmarker.patternUrl
'
,
'
value
'
:
'
artoolkitmarker.barcodeValue
'
,
'
preset
'
:
'
artoolkitmarker.preset
'
,
}
}));
AFRAME
.
registerPrimitive
(
'
a-marker-camera
'
,
AFRAME
.
utils
.
extendDeep
({},
AFRAME
.
primitives
.
getMeshMixin
(),
{
defaultComponents
:
{
artoolkitmarker
:
{
changeMatrixMode
:
'
cameraTransformMatrix
'
},
camera
:
true
,
},
mappings
:
{
'
type
'
:
'
artoolkitmarker.type
'
,
'
size
'
:
'
artoolkitmarker.size
'
,
'
url
'
:
'
artoolkitmarker.patternUrl
'
,
'
value
'
:
'
artoolkitmarker.barcodeValue
'
,
'
preset
'
:
'
artoolkitmarker.preset
'
,
}
defaultComponents
:
{
artoolkitmarker
:
{
changeMatrixMode
:
'
cameraTransformMatrix
'
},
camera
:
true
,
},
mappings
:
{
'
type
'
:
'
artoolkitmarker.type
'
,
'
size
'
:
'
artoolkitmarker.size
'
,
'
url
'
:
'
artoolkitmarker.patternUrl
'
,
'
value
'
:
'
artoolkitmarker.barcodeValue
'
,
'
preset
'
:
'
artoolkitmarker.preset
'
,
}
}));
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录