Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
e559ddd3
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,发现更多精彩内容 >>
提交
e559ddd3
编写于
2月 25, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
started handling profile
上级
7152fff3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
97 addition
and
35 deletion
+97
-35
three.js/TODO.md
three.js/TODO.md
+0
-5
three.js/examples/dev.html
three.js/examples/dev.html
+7
-29
three.js/threex-artoolkitcontext.js
three.js/threex-artoolkitcontext.js
+1
-1
three.js/threex-artoolkitprofile.js
three.js/threex-artoolkitprofile.js
+89
-0
未找到文件。
three.js/TODO.md
已删除
100644 → 0
浏览文件 @
7152fff3
-
GOAL: works well using only the positional tracking, not the stereo display
-
thus it works well with all three.js examples
-
handle resize - currently the canvas isnt using the css it should
-
LATER: make it work with a-frame
three.js/examples/dev.html
浏览文件 @
e559ddd3
...
...
@@ -9,6 +9,7 @@
<!-- include threex.artoolkit -->
<script
src=
"../threex-artoolkitsource.js"
></script>
<script
src=
"../threex-artoolkitcontext.js"
></script>
<script
src=
"../threex-artoolkitprofile.js"
></script>
<script
src=
"../threex-armarkercontrols.js"
></script>
<body
style=
'margin : 0px; overflow: hidden;'
><div
style=
'position: absolute; top: 10px; width:100%; text-align: center;'
;
>
...
...
@@ -58,22 +59,10 @@
// handle arToolkitSource
////////////////////////////////////////////////////////////////////////////////
var
arToolkitSource
=
new
THREEx
.
ArToolkitSource
({
// to read from the webcam
sourceType
:
'
webcam
'
,
// to read from an image
// sourceType : 'image',
// sourceUrl : '../../data/images/img.jpg',
// to read from a video
// sourceType : 'video',
// sourceUrl : '../../data/videos/headtracking.mp4',
// sourceWidth: 80*3,
// sourceHeight: 60*3,
//
})
var
artoolkitProfile
=
new
THREEx
.
ArToolkitProfile
(
'
guess
'
)
var
arToolkitSource
=
new
THREEx
.
ArToolkitSource
(
artoolkitProfile
.
sourceParameters
)
arToolkitSource
.
init
(
function
onReady
(){
// handle resize of renderer
...
...
@@ -91,14 +80,7 @@
// create atToolkitContext
var
arToolkitContext
=
new
THREEx
.
ArToolkitContext
({
cameraParametersUrl
:
'
../../data/data/camera_para.dat
'
,
detectionMode
:
'
mono
'
,
imageSmoothingEnabled
:
false
,
maxDetectionRate
:
30
,
sourceWidth
:
arToolkitSource
.
parameters
.
sourceWidth
,
sourceHeight
:
arToolkitSource
.
parameters
.
sourceHeight
,
})
var
arToolkitContext
=
new
THREEx
.
ArToolkitContext
(
artoolkitProfile
.
contextParameters
)
// initialize it
arToolkitContext
.
init
(
function
onCompleted
(){
// copy projection matrix to camera
...
...
@@ -120,11 +102,7 @@
var
markerRoot
=
new
THREE
.
Group
scene
.
add
(
markerRoot
)
var
artoolkitMarker
=
new
THREEx
.
ArMarkerControls
(
arToolkitContext
,
markerRoot
,
{
type
:
'
pattern
'
,
patternUrl
:
'
../../data/data/patt.hiro
'
// patternUrl : '../../data/data/patt.kanji'
})
var
artoolkitMarker
=
new
THREEx
.
ArMarkerControls
(
arToolkitContext
,
markerRoot
,
artoolkitProfile
.
defaultMarkerParameters
)
//////////////////////////////////////////////////////////////////////////////////
// add an object in the scene
...
...
three.js/threex-artoolkitcontext.js
浏览文件 @
e559ddd3
...
...
@@ -25,7 +25,7 @@ THREEx.ArToolkitContext = function(parameters){
// 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
:
tru
e
,
imageSmoothingEnabled
:
parameters
.
imageSmoothingEnabled
!==
undefined
?
parameters
.
imageSmoothingEnabled
:
fals
e
,
}
this
.
arController
=
null
;
...
...
three.js/threex-artoolkitprofile.js
0 → 100644
浏览文件 @
e559ddd3
var
THREEx
=
THREEx
||
{}
THREEx
.
ArToolkitProfile
=
function
(
label
){
if
(
label
===
'
guess
'
)
label
=
this
.
_guessLabel
()
this
.
reset
()
this
.
setProfile
(
label
)
}
THREEx
.
ArToolkitProfile
.
prototype
.
reset
=
function
()
{
this
.
sourceParameters
=
{}
this
.
contextParameters
=
{}
this
.
defaultMarkerParameters
=
{}
};
THREEx
.
ArToolkitProfile
.
prototype
.
_guessLabel
=
function
()
{
// TODO implement this
return
'
desktop
'
};
THREEx
.
ArToolkitProfile
.
prototype
.
setProfile
=
function
(
label
)
{
if
(
'
desktop
'
){
this
.
desktopProfile
()
}
else
if
(
'
mobile
'
){
this
.
mobileProfile
()
}
else
console
.
assert
(
'
false
'
)
};
THREEx
.
ArToolkitProfile
.
prototype
.
desktopProfile
=
function
()
{
this
.
sourceParameters
=
{
// to read from the webcam
sourceType
:
'
webcam
'
,
// to read from an image
// sourceType : 'image',
// sourceUrl : '../../data/images/img.jpg',
// to read from a video
// sourceType : 'video',
// sourceUrl : '../../data/videos/headtracking.mp4',
// sourceWidth: 80*3,
// sourceHeight: 60*3,
//
}
this
.
contextParameters
=
{
cameraParametersUrl
:
THREEx
.
ArToolkitContext
.
baseURL
+
'
../data/data/camera_para.dat
'
,
detectionMode
:
'
mono
'
,
maxDetectionRate
:
30
,
}
this
.
defaultMarkerParameters
=
{
type
:
'
pattern
'
,
// patternUrl : THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro'
patternUrl
:
THREEx
.
ArToolkitContext
.
baseURL
+
'
../data/data/patt.kanji
'
}
}
THREEx
.
ArToolkitProfile
.
prototype
.
mobileProfile
=
function
()
{
this
.
sourceParameters
=
{
// to read from the webcam
sourceType
:
'
webcam
'
,
// to read from an image
// sourceType : 'image',
// sourceUrl : '../../data/images/img.jpg',
// to read from a video
// sourceType : 'video',
// sourceUrl : '../../data/videos/headtracking.mp4',
sourceWidth
:
80
*
3
,
sourceHeight
:
60
*
3
,
//
}
this
.
contextParameters
=
{
cameraParametersUrl
:
THREEx
.
ArToolkitContext
.
baseURL
+
'
../data/data/camera_para.dat
'
,
detectionMode
:
'
mono
'
,
maxDetectionRate
:
30
,
sourceWidth
:
this
.
sourceParameters
.
sourceWidth
,
sourceHeight
:
this
.
sourceParameters
.
sourceHeight
,
}
this
.
defaultMarkerParameters
=
{
type
:
'
pattern
'
,
// patternUrl : THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro'
patternUrl
:
THREEx
.
ArToolkitContext
.
baseURL
+
'
../data/data/patt.kanji
'
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录