Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3: NFT (Image Tracking) + clean code + doc enhancement #742

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 24 additions & 182 deletions aframe/build/aframe-ar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a-anchor hit-testing-enabled='true'>

<!-- Add your augmented reality here -->
<a-box position='0 0.5 0' material='opacity: 0.5; side:double; color:red;'>
<a-box position='0 0 0.5' material='opacity: 0.5; side:double; color:red;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand Down
2 changes: 1 addition & 1 deletion aframe/examples/default-thinner-border.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a-scene embedded arjs='patternRatio: 0.9; sourceType: image; sourceUrl: ../../test/data/images/marker-artoolkit-pattern-pattratio-09.png;'>

<!-- define the object which gonna be put on this marker -->
<a-box position='0 0.5 0' material='opacity: 0.5; side: double'>
<a-box position='0 0 0.5' material='opacity: 0.5; side: double'>
<a-torus-knot radius='0.26' radius-tubular='0.05'>
<a-animation attribute="rotation" to="360 0 0" dur="3000" easing='linear' repeat="indefinite"></a-animation>
</a-torus-knot>
Expand Down
9 changes: 1 addition & 8 deletions aframe/examples/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
<!-- include for artoolkit trackingBackend -->
<script src='../../three.js/vendor/jsartoolkit5/build/artoolkit.min.js'></script>
<script src='../../three.js/vendor/jsartoolkit5/js/artoolkit.api.js'></script>
<!-- include for aruco trackingBackend -->
<script src='../../three.js/vendor/js-aruco/src/svd.js'></script>
<script src='../../three.js/vendor/js-aruco/src/posit1.js'></script>
<script src='../../three.js/vendor/js-aruco/src/cv.js'></script>
<script src='../../three.js/vendor/js-aruco/src/aruco.js'></script>
<script src='../../three.js/src/threex/threex-aruco/threex-arucocontext.js'></script>
<script src='../../three.js/src/threex/threex-aruco/threex-arucodebug.js'></script>
<script src='../../three.js/src/threex/threex-artoolkitprofile.js'></script>
<script src='../../three.js/src/threex/threex-artoolkitsource.js'></script>
<script src='../../three.js/src/threex/threex-artoolkitcontext.js'></script>
Expand Down Expand Up @@ -45,7 +38,7 @@
<a-anchor hit-testing-enabled='true'>

<!-- Add your augmented reality here -->
<a-box position='0 0.5 0' material='opacity: 0.5; side:double; color:red;'>
<a-box position='0 0 0.5' material='opacity: 0.5; side:double; color:red;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand Down
2 changes: 1 addition & 1 deletion aframe/examples/marker-camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a-scene embedded arjs='sourceType: webcam;'>

<a-marker preset="hiro">
<a-sphere position="0 0.5 0" radius="0.5" color="#EF2D5E"></a-sphere>
<a-sphere position="0 0 0.5" radius="0.5" color="#EF2D5E"></a-sphere>
<a-plane position="0 0 0" rotation="-90 0 0" width="1" height="1" color="#7BC8A4"></a-plane>
</a-marker>

Expand Down
4 changes: 2 additions & 2 deletions aframe/examples/marker-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
<br/>
Contact me any time at <a href='https://twitter.com/jerome_etienne' target='_blank'>@jerome_etienne</a>
</div>
<a-scene embedded arjs='sourceType: webcam; detectionMode: mono_and_matrix; matrixCodeType: 3x3; sourceWidth:1280; sourceHeight:960; displayWidth: 1280; displayHeight: 960;'>
nicolocarpignoli marked this conversation as resolved.
Show resolved Hide resolved
<a-scene embedded arjs='sourceType: webcam; detectionMode: mono_and_matrix; matrixCodeType: 3x3;'>
<!-- handle hiro marker -->
<!-- 'registerevents' will register event listeners for the marker when it is found and lost,
as defined in the inline script above -->
<a-marker preset='hiro' id='marker-hiro' registerevents>
<a-box position='0 0.5 0' material='opacity: 0.5; side: double;color:blue;'>
<a-box position='0 0 0.5' material='opacity: 0.5; side: double;color:blue;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand Down
2 changes: 1 addition & 1 deletion aframe/examples/minimal.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<script src="../build/aframe-ar.min.js"></script>
<body style='margin : 0px; overflow: hidden;'>
<a-scene embedded arjs='sourceType: webcam;'>
<a-box position='0 0.5 0' material='opacity: 0.5;'></a-box>
<a-box position='0 0 0.5' material='opacity: 0.5;'></a-box>
<a-marker-camera preset='hiro'></a-marker-camera>
</a-scene>
</body>
2 changes: 1 addition & 1 deletion aframe/examples/mobile-performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a-scene stats embedded arjs='sourceType: webcam; detectionMode: mono; maxDetectionRate: 30; canvasWidth: 240; canvasHeight: 180'>

<!-- define the object which gonna be put on this marker -->
<a-box position='0 0.5 0' material='opacity: 0.5; side: double'>
<a-box position='0 0 0.5' material='opacity: 0.5; side: double'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand Down
6 changes: 3 additions & 3 deletions aframe/examples/multiple-independent-markers.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<!-- handle hiro marker -->
<a-marker preset='hiro'>
<a-box position='0 0.5 0' material='opacity: 0.5; side: double;color:red;'>
<a-box position='0 0 0.5' material='opacity: 0.5; side: double;color:red;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand All @@ -25,7 +25,7 @@

<!-- handle matrix marker -->
<a-marker type='barcode' value='5'>
<a-box position='0 0.5 0' material='opacity: 0.5; side: double;color:pink;'>
<a-box position='0 0 0.5' material='opacity: 0.5; side: double;color:pink;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand All @@ -34,7 +34,7 @@

<!-- handle kanji marker -->
<a-marker preset='kanji'>
<a-box position='0 0.5 0' material='opacity: 0.5; side: double;color:green;'>
<a-box position='0 0 0.5' material='opacity: 0.5; side: double;color:green;'>
<a-torus-knot radius='0.26' radius-tubular='0.05'
animation="property: rotation; to:360 0 0; dur: 5000; easing: linear; loop: true">
</a-torus-knot>
Expand Down
6 changes: 0 additions & 6 deletions aframe/src/component-anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ AFRAME.registerComponent('arjs-anchor', {
markerParameters.type = _this.data.type
markerParameters.patternUrl = _this.data.patternUrl;
markerParameters.markersAreaEnabled = false
} else {
// console.assert( this.data.preset === '', 'illegal preset value '+this.data.preset)
}

markerParameters.smooth = _this.data.smooth;
Expand Down Expand Up @@ -189,8 +187,6 @@ AFRAME.registerComponent('arjs-anchor', {
} else if (_this._arAnchor.object3d.visible === false && wasVisible === true) {
_this.el.emit('markerLost')
}


}
})

Expand Down Expand Up @@ -221,8 +217,6 @@ AFRAME.registerPrimitive('a-anchor', AFRAME.utils.extendDeep({}, AFRAME.primitiv
}
}))



AFRAME.registerPrimitive('a-camera-static', AFRAME.utils.extendDeep({}, AFRAME.primitives.getMeshMixin(), {
defaultComponents: {
'camera': {},
Expand Down
9 changes: 2 additions & 7 deletions aframe/src/system-arjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AFRAME.registerSystem('arjs', {
},
debugUIEnabled: {
type: 'boolean',
default: true,
default: false,
},
areaLearningButton: {
type: 'boolean',
Expand Down Expand Up @@ -83,11 +83,9 @@ AFRAME.registerSystem('arjs', {
// Code Separator
//////////////////////////////////////////////////////////////////////////////


init: function () {
var _this = this


//////////////////////////////////////////////////////////////////////////////
// setup arProfile
//////////////////////////////////////////////////////////////////////////////
Expand All @@ -97,8 +95,6 @@ AFRAME.registerSystem('arjs', {
.performance(this.data.performanceProfile)
.defaultMarker()



//////////////////////////////////////////////////////////////////////////////
// honor this.data and setup arProfile with it
//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -175,7 +171,6 @@ AFRAME.registerSystem('arjs', {
}
}


//////////////////////////////////////////////////////////////////////////////
// honor .debugUIEnabled
//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -218,7 +213,7 @@ AFRAME.registerSystem('arjs', {
// skip it if not yet isInitialised
if (this.isReady === false) return

var arSession = this._arSession
//var arSession = this._arSession

// update arSession
this._arSession.update()
Expand Down
50 changes: 35 additions & 15 deletions three.js/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,51 @@ watch: build

build-main:
echo > build/ar.js
cat vendor/jsartoolkit5/build/artoolkit.min.js \
vendor/jsartoolkit5/js/artoolkit.api.js >> build/ar.js
cat src/threex/*.js \
cat vendor/jsartoolkit5/build/artoolkit.min.js \
vendor/jsartoolkit5/js/artoolkit.api.js >> build/ar.js
cat src/threex/threex-arbasecontrols.js \
src/threex/threex-arclickability.js \
src/threex/threex-armarkercloak.js \
src/threex/threex-armarkercontrols.js \
src/threex/threex-armarkerhelper.js \
src/threex/threex-arsmoothedcontrols.js \
src/threex/threex-artoolkitcontext.js \
src/threex/threex-artoolkitprofile.js \
src/threex/threex-artoolkitsource.js \
src/threex/threex-arvideoinwebgl.js \
src/threex/threex-hittesting-plane.js \
src/new-api/*.js \
src/markers-area/*.js >> build/ar.js

build-main-nft:
echo > build/ar-nft.js
cat vendor/jsartoolkit5/build/artoolkit-nft.min.js \
vendor/jsartoolkit5/js/artoolkit.worker.js >> build/ar-nft.js
cat src/threex/threex-arbasecontrols.js \
src/threex/threex-arclickability.js \
src/threex/threex-armarkercloak.js \
src/threex/threex-armarkercontrols-nft.js \
src/threex/threex-armarkerhelper.js \
src/threex/threex-arsmoothedcontrols.js \
src/threex/threex-artoolkitcontext-nft.js \
src/threex/threex-artoolkitprofile.js \
src/threex/threex-artoolkitsource.js \
src/threex/threex-arvideoinwebgl.js \
src/threex/threex-hittesting-plane.js \
src/new-api/*.js \
src/markers-area/*.js >> build/ar-nft.js

.PHONY: build

minify-main: build-main
$(UGLIFY) build/ar.js > build/ar.min.js

build-lean:
echo > build/ar.lean.js
cat vendor/jsartoolkit5/build/artoolkit.min.js \
vendor/jsartoolkit5/js/artoolkit.api.js >> build/ar.lean.js
cat src/threex/*.js \
src/new-api/*.js \
src/markers-area/*.js >> build/ar.lean.js

minify-lean: build-lean
$(UGLIFY) build/ar.lean.js > build/ar.lean.min.js
minify-main-nft: build-main-nft
$(UGLIFY) build/ar-nft.js > build/ar-nft.min.js

build: build-main build-lean
build: build-main build-main-nft

minify: minify-main minify-lean
minify: minify-main minify-main-nft

watchMinify: minify
fswatch -0 three.js/*.js | xargs -0 -n 1 -I {} make minify
3,533 changes: 3,533 additions & 0 deletions three.js/build/ar-nft.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions three.js/build/ar-nft.min.js

Large diffs are not rendered by default.

Loading