Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
6fa0e41d
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,发现更多精彩内容 >>
提交
6fa0e41d
编写于
7月 27, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more work
上级
d0df5ed4
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
466 addition
and
171 deletion
+466
-171
aframe/aframe-ar.js
aframe/aframe-ar.js
+7
-1
aframe/build/aframe-ar.js
aframe/build/aframe-ar.js
+125
-42
aframe/build/aframe-ar.min.js
aframe/build/aframe-ar.min.js
+4
-4
aframe/examples/tracking-new-tango.html
aframe/examples/tracking-new-tango.html
+1
-1
three.js/build/ar.js
three.js/build/ar.js
+132
-45
three.js/build/ar.min.js
three.js/build/ar.min.js
+2
-2
three.js/examples/arjs-session.html
three.js/examples/arjs-session.html
+1
-1
three.js/examples/dev.html
three.js/examples/dev.html
+2
-2
three.js/src/newAPI/arjs-session.js
three.js/src/newAPI/arjs-session.js
+1
-2
three.js/threex-artoolkitcontext.js
three.js/threex-artoolkitcontext.js
+44
-15
three.js/threex-artoolkitprofile.js
three.js/threex-artoolkitprofile.js
+10
-8
three.js/threex-artoolkitsource.js
three.js/threex-artoolkitsource.js
+3
-1
webvr-polyfill/build/artoolkit-webvr-polyfill.js
webvr-polyfill/build/artoolkit-webvr-polyfill.js
+132
-45
webvr-polyfill/build/artoolkit-webvr-polyfill.min.js
webvr-polyfill/build/artoolkit-webvr-polyfill.min.js
+2
-2
未找到文件。
aframe/aframe-ar.js
浏览文件 @
6fa0e41d
...
...
@@ -304,7 +304,13 @@ console.log('this.data.markerhelpers', this.data.markerhelpers)
}
else
console
.
assert
(
false
)
// build a smoothedControls
this
.
arSmoothedControls
=
new
THREEx
.
ArSmoothedControls
(
this
.
el
.
object3D
)
this
.
arSmoothedControls
=
new
THREEx
.
ArSmoothedControls
(
this
.
el
.
object3D
,{
lerpPosition
:
0.1
,
lerpQuaternion
:
0.1
,
lerpScale
:
0.1
,
// minVisibleDelay: 0,
// minUnvisibleDelay: 0,
})
...
...
aframe/build/aframe-ar.js
浏览文件 @
6fa0e41d
此差异已折叠。
点击以展开。
aframe/build/aframe-ar.min.js
浏览文件 @
6fa0e41d
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
aframe/examples/tracking-new-tango.html
浏览文件 @
6fa0e41d
...
...
@@ -27,7 +27,7 @@
<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-marker-camera
preset=
'
area
'
></a-marker-camera>
</a-scene>
<!-- <a-scene embedded arjs='sourceType: webcam; trackingBackend: tango;'>
...
...
three.js/build/ar.js
浏览文件 @
6fa0e41d
此差异已折叠。
点击以展开。
three.js/build/ar.min.js
浏览文件 @
6fa0e41d
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
three.js/examples/arjs-session.html
浏览文件 @
6fa0e41d
<!DOCTYPE html>
<meta
name=
'viewport'
content=
'width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0'
>
<!-- three.js library -->
<script
src=
'../examples/vendor/three.js/build/three.js'
></script>
<script
src=
'../examples/vendor/three.js/build/three.
min.
js'
></script>
<!-- include for artoolkit trackingBackend -->
<script
src=
'../vendor/jsartoolkit5/build/artoolkit.min.js'
></script>
<script
src=
'../vendor/jsartoolkit5/js/artoolkit.api.js'
></script>
...
...
three.js/examples/dev.html
浏览文件 @
6fa0e41d
...
...
@@ -105,8 +105,8 @@
// detectionMode: 'color_and_matrix',
// matrixCodeType: '3x3',
//
canvasWidth: 80*3,
//
canvasHeight: 60*3,
canvasWidth
:
80
*
3
,
canvasHeight
:
60
*
3
,
maxDetectionRate
:
30
,
})
...
...
three.js/src/newAPI/arjs-session.js
浏览文件 @
6fa0e41d
...
...
@@ -17,7 +17,6 @@ ARjs.Session = function(parameters){
THREEx
.
ArMultiMarkerUtils
.
storeDefaultMultiMarkerFile
(
parameters
.
contextParameters
.
trackingBackend
)
}
//////////////////////////////////////////////////////////////////////////////
// init arSource
//////////////////////////////////////////////////////////////////////////////
...
...
@@ -35,7 +34,7 @@ ARjs.Session = function(parameters){
//////////////////////////////////////////////////////////////////////////////
// init arContext
//////////////////////////////////////////////////////////////////////////////
// create atToolkitContext
var
arContext
=
_this
.
arContext
=
new
THREEx
.
ArToolkitContext
(
parameters
.
contextParameters
)
...
...
three.js/threex-artoolkitcontext.js
浏览文件 @
6fa0e41d
...
...
@@ -8,26 +8,26 @@ THREEx.ArToolkitContext = function(parameters){
// handle default parameters
this
.
parameters
=
{
// AR backend - ['artoolkit', 'aruco', 'tango']
trackingBackend
:
parameters
.
trackingBackend
!==
undefined
?
parameters
.
trackingBackend
:
'
artoolkit
'
,
trackingBackend
:
'
artoolkit
'
,
// debug - true if one should display artoolkit debug canvas, false otherwise
debug
:
parameters
.
debug
!==
undefined
?
parameters
.
debug
:
false
,
debug
:
false
,
// the mode of detection - ['color', 'color_and_matrix', 'mono', 'mono_and_matrix']
detectionMode
:
parameters
.
detectionMode
!==
undefined
?
parameters
.
detectionMode
:
'
mono
'
,
detectionMode
:
'
mono
'
,
// type of matrix code - valid iif detectionMode end with 'matrix' - [3x3, 3x3_HAMMING63, 3x3_PARITY65, 4x4, 4x4_BCH_13_9_3, 4x4_BCH_13_5_5]
matrixCodeType
:
parameters
.
matrixCodeType
!==
undefined
?
parameters
.
matrixCodeType
:
'
3x3
'
,
matrixCodeType
:
'
3x3
'
,
// url of the camera parameters
cameraParametersUrl
:
parameters
.
cameraParametersUrl
!==
undefined
?
parameters
.
cameraParametersUrl
:
THREEx
.
ArToolkitContext
.
baseURL
+
'
parameters/camera_para.dat
'
,
cameraParametersUrl
:
THREEx
.
ArToolkitContext
.
baseURL
+
'
parameters/camera_para.dat
'
,
// tune the maximum rate of pose detection in the source image
maxDetectionRate
:
parameters
.
maxDetectionRate
!==
undefined
?
parameters
.
maxDetectionRate
:
60
,
maxDetectionRate
:
60
,
// resolution of at which we detect pose in the source image
canvasWidth
:
parameters
.
canvasWidth
!==
undefined
?
parameters
.
canvasWidth
:
640
,
canvasHeight
:
parameters
.
canvasHeight
!==
undefined
?
parameters
.
canvasHeight
:
480
,
canvasWidth
:
640
,
canvasHeight
:
480
,
// enable image smoothing or not for canvas copy - default to true
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled
imageSmoothingEnabled
:
parameters
.
imageSmoothingEnabled
!==
undefined
?
parameters
.
imageSmoothingEnabled
:
false
,
imageSmoothingEnabled
:
false
,
}
// parameters sanity check
console
.
assert
([
'
artoolkit
'
,
'
aruco
'
,
'
tango
'
].
indexOf
(
this
.
parameters
.
trackingBackend
)
!==
-
1
,
'
invalid parameter trackingBackend
'
,
this
.
parameters
.
trackingBackend
)
...
...
@@ -40,6 +40,8 @@ THREEx.ArToolkitContext = function(parameters){
this
.
_arMarkersControls
=
[]
this
.
_setParameters
(
parameters
)
}
Object
.
assign
(
THREEx
.
ArToolkitContext
.
prototype
,
THREE
.
EventDispatcher
.
prototype
);
...
...
@@ -50,6 +52,33 @@ THREEx.ArToolkitContext.baseURL = 'https://jeromeetienne.github.io/AR.js/three.j
THREEx
.
ArToolkitContext
.
REVISION
=
'
1.0.1-dev
'
/**
* set parameters
* @param {[type]} values [description]
* @return {[type]} [description]
*/
THREEx
.
ArToolkitContext
.
prototype
.
_setParameters
=
function
(
values
){
if
(
values
===
undefined
)
return
;
for
(
var
key
in
values
){
var
newValue
=
values
[
key
];
if
(
newValue
===
undefined
){
console
.
warn
(
"
THREEx.ArToolkitContext: '
"
+
key
+
"
' parameter is undefined.
"
);
continue
;
}
var
currentValue
=
this
.
parameters
[
key
];
if
(
currentValue
===
undefined
){
console
.
warn
(
"
THREEx.ArToolkitContext: '
"
+
key
+
"
' is not a property of this material.
"
);
continue
;
}
this
.
parameters
[
key
]
=
newValue
;
}
};
/**
* Create a default camera for this trackingBackend
* @param {string} trackingBackend - the tracking to user
...
...
@@ -101,7 +130,7 @@ THREEx.ArToolkitContext.prototype.init = function(onCompleted){
THREEx
.
ArToolkitContext
.
prototype
.
update
=
function
(
srcElement
){
// be sure arController is fully initialized
if
(
this
.
parameters
.
trackingBackend
===
'
artoolkit
'
&&
this
.
arController
===
null
)
return
false
;
if
(
this
.
parameters
.
trackingBackend
===
'
artoolkit
'
&&
this
.
arController
===
null
)
return
false
;
// honor this.parameters.maxDetectionRate
var
present
=
performance
.
now
()
...
...
@@ -164,7 +193,7 @@ THREEx.ArToolkitContext.prototype._initArtoolkit = function(onCompleted){
this
.
_artoolkitProjectionAxisTransformMatrix
.
multiply
(
new
THREE
.
Matrix4
().
makeRotationZ
(
Math
.
PI
))
// get cameraParameters
var
cameraParameters
=
new
ARCameraParam
(
_this
.
parameters
.
cameraParametersUrl
,
function
()
{
var
cameraParameters
=
new
ARCameraParam
(
_this
.
parameters
.
cameraParametersUrl
,
function
(){
// init controller
var
arController
=
new
ARController
(
_this
.
parameters
.
canvasWidth
,
_this
.
parameters
.
canvasHeight
,
cameraParameters
);
_this
.
arController
=
arController
...
...
@@ -308,9 +337,9 @@ THREEx.ArToolkitContext.prototype._updateAruco = function(srcElement){
THREEx
.
ArToolkitContext
.
prototype
.
_initTango
=
function
(
onCompleted
){
var
_this
=
this
// check webvr is available
if
(
navigator
.
getVRDisplays
)
{
if
(
navigator
.
getVRDisplays
){
// do nothing
}
else
if
(
navigator
.
getVRDevices
)
{
}
else
if
(
navigator
.
getVRDevices
){
alert
(
"
Your browser supports WebVR but not the latest version. See <a href='http://webvr.info'>webvr.info</a> for more info.
"
);
}
else
{
alert
(
"
Your browser does not support WebVR. See <a href='http://webvr.info'>webvr.info</a> for assistance.
"
);
...
...
@@ -325,7 +354,7 @@ THREEx.ArToolkitContext.prototype._initTango = function(onCompleted){
// get vrDisplay
navigator
.
getVRDisplays
().
then
(
function
(
vrDisplays
)
{
navigator
.
getVRDisplays
().
then
(
function
(
vrDisplays
){
if
(
vrDisplays
.
length
===
0
)
alert
(
'
no vrDisplays available
'
)
var
vrDisplay
=
_this
.
_tangoContext
.
vrDisplay
=
vrDisplays
[
0
]
...
...
@@ -339,7 +368,7 @@ THREEx.ArToolkitContext.prototype._initTango = function(onCompleted){
// NOTE it doesnt seem necessary and it fails on tango
// var canvasElement = document.createElement('canvas')
// document.body.appendChild(canvasElement)
// _this._tangoContext.requestPresent([{ source: canvasElement }]).then(function()
{
// _this._tangoContext.requestPresent([{ source: canvasElement }]).then(function(){
// console.log('vrdisplay request accepted')
// });
...
...
three.js/threex-artoolkitprofile.js
浏览文件 @
6fa0e41d
...
...
@@ -63,33 +63,35 @@ ARjs.Profile.prototype.reset = function () {
ARjs
.
Profile
.
prototype
.
performance
=
function
(
label
)
{
if
(
label
===
'
default
'
){
label
=
this
.
_guessPerformanceLabel
()
}
if
(
label
===
'
desktop-fast
'
){
this
.
contextParameters
.
source
Width
=
640
*
3
this
.
contextParameters
.
source
Height
=
480
*
3
this
.
contextParameters
.
canvas
Width
=
640
*
3
this
.
contextParameters
.
canvas
Height
=
480
*
3
this
.
contextParameters
.
maxDetectionRate
=
30
}
else
if
(
label
===
'
desktop-normal
'
){
this
.
contextParameters
.
source
Width
=
640
this
.
contextParameters
.
source
Height
=
480
this
.
contextParameters
.
canvas
Width
=
640
this
.
contextParameters
.
canvas
Height
=
480
this
.
contextParameters
.
maxDetectionRate
=
60
}
else
if
(
label
===
'
phone-normal
'
){
this
.
contextParameters
.
source
Width
=
80
*
4
this
.
contextParameters
.
source
Height
=
60
*
4
this
.
contextParameters
.
canvas
Width
=
80
*
4
this
.
contextParameters
.
canvas
Height
=
60
*
4
this
.
contextParameters
.
maxDetectionRate
=
30
}
else
if
(
label
===
'
phone-slow
'
){
this
.
contextParameters
.
source
Width
=
80
*
3
this
.
contextParameters
.
source
Height
=
60
*
3
this
.
contextParameters
.
canvas
Width
=
80
*
3
this
.
contextParameters
.
canvas
Height
=
60
*
3
this
.
contextParameters
.
maxDetectionRate
=
30
}
else
{
console
.
assert
(
false
,
'
unknonwn label
'
+
label
)
}
return
this
}
//////////////////////////////////////////////////////////////////////////////
...
...
three.js/threex-artoolkitsource.js
浏览文件 @
6fa0e41d
...
...
@@ -354,7 +354,9 @@ THREEx.ArToolkitSource.prototype.onResize2 = function(arToolkitContext, renderer
// UPDATE CAMERA
if
(
trackingBackend
===
'
artoolkit
'
){
camera
.
projectionMatrix
.
copy
(
arToolkitContext
.
getProjectionMatrix
()
);
if
(
arToolkitContext
.
arController
!==
null
){
camera
.
projectionMatrix
.
copy
(
arToolkitContext
.
getProjectionMatrix
()
);
}
}
else
if
(
trackingBackend
===
'
aruco
'
){
camera
.
aspect
=
renderer
.
domElement
.
width
/
renderer
.
domElement
.
height
;
camera
.
updateProjectionMatrix
();
...
...
webvr-polyfill/build/artoolkit-webvr-polyfill.js
浏览文件 @
6fa0e41d
此差异已折叠。
点击以展开。
webvr-polyfill/build/artoolkit-webvr-polyfill.min.js
浏览文件 @
6fa0e41d
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录