Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
3931ab0a
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,发现更多精彩内容 >>
提交
3931ab0a
编写于
6月 02, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync up
上级
39dc3c58
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
19 deletion
+51
-19
aframe/build/aframe-ar.js
aframe/build/aframe-ar.js
+45
-13
aframe/build/aframe-ar.min.js
aframe/build/aframe-ar.min.js
+3
-3
three.js/build/ar.min.js
three.js/build/ar.min.js
+2
-2
three.js/threex-artoolkitsource.js
three.js/threex-artoolkitsource.js
+1
-1
未找到文件。
aframe/build/aframe-ar.js
浏览文件 @
3931ab0a
...
@@ -496,7 +496,7 @@ THREEx.ArSmoothedControls = function(object3d, parameters){
...
@@ -496,7 +496,7 @@ THREEx.ArSmoothedControls = function(object3d, parameters){
// delay for lerp fixed steps - in seconds - default to 1/120
// delay for lerp fixed steps - in seconds - default to 1/120
lerpStepDelay: parameters.fixStepDelay !== undefined ? parameters.fixStepDelay : 1/60,
lerpStepDelay: parameters.fixStepDelay !== undefined ? parameters.fixStepDelay : 1/60,
// minimum delay the sub-control must be visible before this controls become visible - default to 0 seconds
// minimum delay the sub-control must be visible before this controls become visible - default to 0 seconds
minVisibleDelay: parameters.minVisibleDelay !== undefined ? parameters.minVisibleDelay : 0.
3
,
minVisibleDelay: parameters.minVisibleDelay !== undefined ? parameters.minVisibleDelay : 0.
0
,
// minimum delay the sub-control must be unvisible before this controls become unvisible - default to 0 seconds
// minimum delay the sub-control must be unvisible before this controls become unvisible - default to 0 seconds
minUnvisibleDelay: parameters.minUnvisibleDelay !== undefined ? parameters.minUnvisibleDelay : 0.2,
minUnvisibleDelay: parameters.minUnvisibleDelay !== undefined ? parameters.minUnvisibleDelay : 0.2,
}
}
...
@@ -955,8 +955,8 @@ THREEx.ArToolkitSource.prototype.init = function(onReady){
...
@@ -955,8 +955,8 @@ THREEx.ArToolkitSource.prototype.init = function(onReady){
this.domElement = domElement
this.domElement = domElement
this.domElement.style.position = 'absolute'
this.domElement.style.position = 'absolute'
this.domElement.style.top = '0px'
this.domElement.style.top = '0px'
this.domElement.style.
zIndex = '-2'
this.domElement.style.
left = '0px'
this.domElement.style.zIndex = '-2'
this.domElement.style.zIndex = '-2'
return this
return this
function onSourceReady(){
function onSourceReady(){
...
@@ -1065,14 +1065,41 @@ THREEx.ArToolkitSource.prototype._initSourceWebcam = function(onReady) {
...
@@ -1065,14 +1065,41 @@ THREEx.ArToolkitSource.prototype._initSourceWebcam = function(onReady) {
}
}
}
}
devices.forEach(function(device) {
// TODO super unclear how to get the backward facing camera...
if( device.kind !== 'videoinput' ) return
// use heuristic - on chrome android current algo is working
//
// on macosx it isnt. figure out the algo, and do if(macosx)
// - with one or two camera
//
// some issue on window
/**
* how to test
* - one or two camera on macbook
* - my phone
*/
var runOnMobile = 'ontouchstart' in window ? true : false
if( runOnMobile === true ){
pickDeviceAndroid()
}else{
pickDeviceMacosx()
}
// TODO super unclear how to get the backward facing camera...
function pickDeviceAndroid(){
devices.forEach(function(device) {
if( device.kind !== 'videoinput' ) return
constraints.video.optional = [{sourceId: device.deviceId}]
});
}
function pickDeviceMacosx(){
devices.forEach(function(device) {
if( device.kind !== 'videoinput' ) return
if( constraints.video.optional !== undefined ) return
if( constraints.video.optional !== undefined ) return
constraints.video.optional = [{sourceId: device.deviceId}]
constraints.video.optional = [{sourceId: device.deviceId}]
});
});
}
// OLD API
// OLD API
// it it finds the videoSource 'environment', modify constraints.video
// it it finds the videoSource 'environment', modify constraints.video
...
@@ -1156,17 +1183,22 @@ THREEx.ArToolkitSource.prototype.onResize = function(mirrorDomElements){
...
@@ -1156,17 +1183,22 @@ THREEx.ArToolkitSource.prototype.onResize = function(mirrorDomElements){
}
}
// honor default parameters
// honor default parameters
if( mirrorDomElements !== undefined ) console.warn('still use the old resize. fix it')
if( mirrorDomElements === undefined ) mirrorDomElements = []
if( mirrorDomElements === undefined ) mirrorDomElements = []
if( mirrorDomElements instanceof Array === false ) mirrorDomElements = [mirrorDomElements]
if( mirrorDomElements instanceof Array === false ) mirrorDomElements = [mirrorDomElements]
// Mirror _this.domElement.style to mirrorDomElements
// Mirror _this.domElement.style to mirrorDomElements
mirrorDomElements.forEach(function(domElement){
mirrorDomElements.forEach(function(domElement){
domElement.style.width = _this.domElement.style.width
_this.copySizeTo(domElement)
domElement.style.height = _this.domElement.style.height
domElement.style.marginLeft = _this.domElement.style.marginLeft
domElement.style.marginTop = _this.domElement.style.marginTop
})
})
}
}
THREEx.ArToolkitSource.prototype.copySizeTo = function(otherElement){
otherElement.style.width = this.domElement.style.width
otherElement.style.height = this.domElement.style.height
otherElement.style.marginLeft = this.domElement.style.marginLeft
otherElement.style.marginTop = this.domElement.style.marginTop
}
var THREEx = THREEx || {}
var THREEx = THREEx || {}
THREEx.ArVideoInWebgl = function(videoTexture){
THREEx.ArVideoInWebgl = function(videoTexture){
...
...
aframe/build/aframe-ar.min.js
浏览文件 @
3931ab0a
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
three.js/build/ar.min.js
浏览文件 @
3931ab0a
此差异已折叠。
点击以展开。
three.js/threex-artoolkitsource.js
浏览文件 @
3931ab0a
...
@@ -268,7 +268,7 @@ THREEx.ArToolkitSource.prototype.onResize = function(mirrorDomElements){
...
@@ -268,7 +268,7 @@ THREEx.ArToolkitSource.prototype.onResize = function(mirrorDomElements){
}
}
// 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
=
[]
if
(
mirrorDomElements
instanceof
Array
===
false
)
mirrorDomElements
=
[
mirrorDomElements
]
if
(
mirrorDomElements
instanceof
Array
===
false
)
mirrorDomElements
=
[
mirrorDomElements
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录