Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
e90356f0
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,发现更多精彩内容 >>
提交
e90356f0
编写于
7月 29, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use new classnames
上级
a87242a0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
32 deletion
+34
-32
three.js/threex-artoolkitcontext.js
three.js/threex-artoolkitcontext.js
+19
-18
three.js/threex-artoolkitprofile.js
three.js/threex-artoolkitprofile.js
+0
-1
three.js/threex-artoolkitsource.js
three.js/threex-artoolkitsource.js
+15
-13
未找到文件。
three.js/threex-artoolkitcontext.js
浏览文件 @
e90356f0
var
ARjs
=
ARjs
||
{}
var
THREEx
=
THREEx
||
{}
THREEx
.
ArToolkitContext
=
function
(
parameters
){
ARjs
.
Context
=
THREEx
.
ArToolkitContext
=
function
(
parameters
){
var
_this
=
this
_this
.
_updatedAt
=
null
...
...
@@ -17,7 +18,7 @@ THREEx.ArToolkitContext = function(parameters){
matrixCodeType
:
'
3x3
'
,
// url of the camera parameters
cameraParametersUrl
:
THREEx
.
ArToolkit
Context
.
baseURL
+
'
parameters/camera_para.dat
'
,
cameraParametersUrl
:
ARjs
.
Context
.
baseURL
+
'
parameters/camera_para.dat
'
,
// tune the maximum rate of pose detection in the source image
maxDetectionRate
:
60
,
...
...
@@ -67,12 +68,12 @@ THREEx.ArToolkitContext = function(parameters){
}
}
Object
.
assign
(
THREEx
.
ArToolkit
Context
.
prototype
,
THREE
.
EventDispatcher
.
prototype
);
Object
.
assign
(
ARjs
.
Context
.
prototype
,
THREE
.
EventDispatcher
.
prototype
);
//
THREEx.ArToolkit
Context.baseURL = '../'
//
ARjs.
Context.baseURL = '../'
// default to github page
THREEx
.
ArToolkit
Context
.
baseURL
=
'
https://jeromeetienne.github.io/AR.js/three.js/
'
THREEx
.
ArToolkit
Context
.
REVISION
=
'
1.0.1-dev
'
ARjs
.
Context
.
baseURL
=
'
https://jeromeetienne.github.io/AR.js/three.js/
'
ARjs
.
Context
.
REVISION
=
'
1.0.1-dev
'
...
...
@@ -81,7 +82,7 @@ THREEx.ArToolkitContext.REVISION = '1.0.1-dev'
* @param {string} trackingBackend - the tracking to user
* @return {THREE.Camera} the created camera
*/
THREEx
.
ArToolkit
Context
.
createDefaultCamera
=
function
(
trackingBackend
){
ARjs
.
Context
.
createDefaultCamera
=
function
(
trackingBackend
){
console
.
assert
(
false
,
'
use ARjs.Utils.createDefaultCamera instead
'
)
// Create a camera
if
(
trackingBackend
===
'
artoolkit
'
){
...
...
@@ -98,7 +99,7 @@ THREEx.ArToolkitContext.createDefaultCamera = function( trackingBackend ){
//////////////////////////////////////////////////////////////////////////////
// init functions
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Context
.
prototype
.
init
=
function
(
onCompleted
){
ARjs
.
Context
.
prototype
.
init
=
function
(
onCompleted
){
var
_this
=
this
if
(
this
.
parameters
.
trackingBackend
===
'
artoolkit
'
){
this
.
_initArtoolkit
(
done
)
...
...
@@ -124,7 +125,7 @@ THREEx.ArToolkitContext.prototype.init = function(onCompleted){
////////////////////////////////////////////////////////////////////////////////
// update function
////////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Context
.
prototype
.
update
=
function
(
srcElement
){
ARjs
.
Context
.
prototype
.
update
=
function
(
srcElement
){
// be sure arController is fully initialized
if
(
this
.
parameters
.
trackingBackend
===
'
artoolkit
'
&&
this
.
arController
===
null
)
return
false
;
...
...
@@ -165,12 +166,12 @@ THREEx.ArToolkitContext.prototype.update = function(srcElement){
////////////////////////////////////////////////////////////////////////////////
// Add/Remove markerControls
////////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Context
.
prototype
.
addMarker
=
function
(
arMarkerControls
){
ARjs
.
Context
.
prototype
.
addMarker
=
function
(
arMarkerControls
){
console
.
assert
(
arMarkerControls
instanceof
THREEx
.
ArMarkerControls
)
this
.
_arMarkersControls
.
push
(
arMarkerControls
)
}
THREEx
.
ArToolkit
Context
.
prototype
.
removeMarker
=
function
(
arMarkerControls
){
ARjs
.
Context
.
prototype
.
removeMarker
=
function
(
arMarkerControls
){
console
.
assert
(
arMarkerControls
instanceof
THREEx
.
ArMarkerControls
)
// console.log('remove marker for', arMarkerControls)
var
index
=
this
.
arMarkerControlss
.
indexOf
(
artoolkitMarker
);
...
...
@@ -181,7 +182,7 @@ THREEx.ArToolkitContext.prototype.removeMarker = function(arMarkerControls){
//////////////////////////////////////////////////////////////////////////////
// artoolkit specific
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Context
.
prototype
.
_initArtoolkit
=
function
(
onCompleted
){
ARjs
.
Context
.
prototype
.
_initArtoolkit
=
function
(
onCompleted
){
var
_this
=
this
// set this._artoolkitProjectionAxisTransformMatrix to change artoolkit projection matrix axis to match usual webgl one
...
...
@@ -252,7 +253,7 @@ THREEx.ArToolkitContext.prototype._initArtoolkit = function(onCompleted){
/**
* return the projection matrix
*/
THREEx
.
ArToolkit
Context
.
prototype
.
getProjectionMatrix
=
function
(
srcElement
){
ARjs
.
Context
.
prototype
.
getProjectionMatrix
=
function
(
srcElement
){
// FIXME rename this function to say it is artoolkit specific - getArtoolkitProjectMatrix
...
...
@@ -275,14 +276,14 @@ THREEx.ArToolkitContext.prototype.getProjectionMatrix = function(srcElement){
return
projectionMatrix
}
THREEx
.
ArToolkit
Context
.
prototype
.
_updateArtoolkit
=
function
(
srcElement
){
ARjs
.
Context
.
prototype
.
_updateArtoolkit
=
function
(
srcElement
){
this
.
arController
.
process
(
srcElement
)
}
//////////////////////////////////////////////////////////////////////////////
// aruco specific
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Context
.
prototype
.
_initAruco
=
function
(
onCompleted
){
ARjs
.
Context
.
prototype
.
_initAruco
=
function
(
onCompleted
){
this
.
arucoContext
=
new
THREEx
.
ArucoContext
()
// honor this.parameters.canvasWidth/.canvasHeight
...
...
@@ -303,7 +304,7 @@ THREEx.ArToolkitContext.prototype._initAruco = function(onCompleted){
}
THREEx
.
ArToolkit
Context
.
prototype
.
_updateAruco
=
function
(
srcElement
){
ARjs
.
Context
.
prototype
.
_updateAruco
=
function
(
srcElement
){
// console.log('update aruco here')
var
_this
=
this
var
arMarkersControls
=
this
.
_arMarkersControls
...
...
@@ -331,7 +332,7 @@ THREEx.ArToolkitContext.prototype._updateAruco = function(srcElement){
//////////////////////////////////////////////////////////////////////////////
// tango specific
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Context
.
prototype
.
_initTango
=
function
(
onCompleted
){
ARjs
.
Context
.
prototype
.
_initTango
=
function
(
onCompleted
){
var
_this
=
this
// check webvr is available
if
(
navigator
.
getVRDisplays
){
...
...
@@ -374,7 +375,7 @@ THREEx.ArToolkitContext.prototype._initTango = function(onCompleted){
}
THREEx
.
ArToolkit
Context
.
prototype
.
_updateTango
=
function
(
srcElement
){
ARjs
.
Context
.
prototype
.
_updateTango
=
function
(
srcElement
){
// console.log('update aruco here')
var
_this
=
this
var
arMarkersControls
=
this
.
_arMarkersControls
...
...
three.js/threex-artoolkitprofile.js
浏览文件 @
e90356f0
var
ARjs
=
ARjs
||
{}
var
THREEx
=
THREEx
||
{}
/**
...
...
three.js/threex-artoolkitsource.js
浏览文件 @
e90356f0
var
ARjs
=
ARjs
||
{}
var
THREEx
=
THREEx
||
{}
THREEx
.
ArToolkitSource
=
function
(
parameters
){
ARjs
.
Source
=
THREEx
.
ArToolkitSource
=
function
(
parameters
){
var
_this
=
this
this
.
ready
=
false
...
...
@@ -49,7 +50,7 @@ THREEx.ArToolkitSource = function(parameters){
//////////////////////////////////////////////////////////////////////////////
// Code Separator
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
init
=
function
(
onReady
,
onError
){
ARjs
.
Source
.
prototype
.
init
=
function
(
onReady
,
onError
){
var
_this
=
this
if
(
this
.
parameters
.
sourceType
===
'
image
'
){
...
...
@@ -85,7 +86,7 @@ THREEx.ArToolkitSource.prototype.init = function(onReady, onError){
////////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
_initSourceImage
=
function
(
onReady
)
{
ARjs
.
Source
.
prototype
.
_initSourceImage
=
function
(
onReady
)
{
// TODO make it static
var
domElement
=
document
.
createElement
(
'
img
'
)
domElement
.
src
=
this
.
parameters
.
sourceUrl
...
...
@@ -110,7 +111,7 @@ THREEx.ArToolkitSource.prototype._initSourceImage = function(onReady) {
////////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
_initSourceVideo
=
function
(
onReady
)
{
ARjs
.
Source
.
prototype
.
_initSourceVideo
=
function
(
onReady
)
{
// TODO make it static
var
domElement
=
document
.
createElement
(
'
video
'
);
domElement
.
src
=
this
.
parameters
.
sourceUrl
...
...
@@ -147,7 +148,7 @@ THREEx.ArToolkitSource.prototype._initSourceVideo = function(onReady) {
// handle webcam source
////////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
_initSourceWebcam
=
function
(
onReady
,
onError
)
{
ARjs
.
Source
.
prototype
.
_initSourceWebcam
=
function
(
onReady
,
onError
)
{
var
_this
=
this
// init default value
...
...
@@ -226,7 +227,7 @@ THREEx.ArToolkitSource.prototype._initSourceWebcam = function(onReady, onError)
//////////////////////////////////////////////////////////////////////////////
// Handle Mobile Torch
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
hasMobileTorch
=
function
(){
ARjs
.
Source
.
prototype
.
hasMobileTorch
=
function
(){
var
stream
=
arToolkitSource
.
domElement
.
srcObject
if
(
stream
instanceof
MediaStream
===
false
)
return
false
...
...
@@ -248,7 +249,7 @@ THREEx.ArToolkitSource.prototype.hasMobileTorch = function(){
* toggle the flash/torch of the mobile fun if applicable.
* Great post about it https://www.oberhofer.co/mediastreamtrack-and-its-capabilities/
*/
THREEx
.
ArToolkit
Source
.
prototype
.
toggleMobileTorch
=
function
(){
ARjs
.
Source
.
prototype
.
toggleMobileTorch
=
function
(){
// sanity check
console
.
assert
(
this
.
hasMobileTorch
()
===
true
)
...
...
@@ -284,7 +285,7 @@ THREEx.ArToolkitSource.prototype.toggleMobileTorch = function(){
// handle resize
////////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
onResizeElement
=
function
(
mirrorDomElements
){
ARjs
.
Source
.
prototype
.
onResizeElement
=
function
(
mirrorDomElements
){
var
_this
=
this
var
screenWidth
=
window
.
innerWidth
var
screenHeight
=
window
.
innerHeight
...
...
@@ -342,7 +343,7 @@ THREEx.ArToolkitSource.prototype.onResizeElement = function(mirrorDomElements){
})
}
THREEx
.
ArToolkit
Source
.
prototype
.
copyElementSizeTo
=
function
(
otherElement
){
ARjs
.
Source
.
prototype
.
copyElementSizeTo
=
function
(
otherElement
){
otherElement
.
style
.
width
=
this
.
domElement
.
style
.
width
otherElement
.
style
.
height
=
this
.
domElement
.
style
.
height
otherElement
.
style
.
marginLeft
=
this
.
domElement
.
style
.
marginLeft
...
...
@@ -353,7 +354,7 @@ THREEx.ArToolkitSource.prototype.copyElementSizeTo = function(otherElement){
// Code Separator
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkit
Source
.
prototype
.
copySizeTo
=
function
(){
ARjs
.
Source
.
prototype
.
copySizeTo
=
function
(){
console
.
warn
(
'
obsolete function arToolkitSource.copySizeTo. Use arToolkitSource.copyElementSizeTo
'
)
this
.
copyElementSizeTo
.
apply
(
this
,
arguments
)
}
...
...
@@ -362,14 +363,15 @@ THREEx.ArToolkitSource.prototype.copySizeTo = function(){
// Code Separator
//////////////////////////////////////////////////////////////////////////////
THREEx
.
ArToolkitSource
.
prototype
.
onResize
=
function
(
arToolkitContext
,
renderer
,
camera
){
var
trackingBackend
=
arToolkitContext
.
parameters
.
trackingBackend
ARjs
.
Source
.
prototype
.
onResize
=
function
(
arToolkitContext
,
renderer
,
camera
){
if
(
arguments
.
length
!==
3
){
console
.
warn
(
'
obsolete function arToolkitSource.onResize. Use arToolkitSource.onResizeElement
'
)
return
this
.
onResizeElement
.
apply
(
this
,
arguments
)
}
var
trackingBackend
=
arToolkitContext
.
parameters
.
trackingBackend
// RESIZE DOMELEMENT
if
(
trackingBackend
===
'
artoolkit
'
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录