Skip to content

Commit

Permalink
removing aruco form armarkercontrols, axes are correct as in the new …
Browse files Browse the repository at this point in the history
…jsartoolkit5 version
  • Loading branch information
kalwalt committed Feb 27, 2020
1 parent 9b3c277 commit 577f15b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 101 deletions.
32 changes: 0 additions & 32 deletions aframe/build/aframe-ar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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/marker-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<!-- '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
32 changes: 0 additions & 32 deletions three.js/build/ar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions three.js/examples/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@
side: THREE.DoubleSide
});
var mesh = new THREE.Mesh( geometry, material );
mesh.position.y = geometry.parameters.height/2
mesh.position.z = geometry.parameters.height/2
markerScene.add(mesh)

var geometry = new THREE.TorusKnotGeometry(0.3,0.1,64,16);
var material = new THREE.MeshNormalMaterial();
var mesh = new THREE.Mesh( geometry, material );
mesh.position.y = 0.5
mesh.position.z = 0.5
markerScene.add( mesh );

onRenderFcts.push(function(delta){
Expand Down
32 changes: 0 additions & 32 deletions three.js/src/threex/threex-armarkercontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ ARjs.MarkerControls = THREEx.ArMarkerControls = function(context, object3d, para

if( _this.context.parameters.trackingBackend === 'artoolkit' ){
this._initArtoolkit()
}else if( _this.context.parameters.trackingBackend === 'aruco' ){
// TODO create a ._initAruco
// put aruco second
this._arucoPosit = new POS.Posit(this.parameters.size, _this.context.arucoContext.canvas.width)
}else if( _this.context.parameters.trackingBackend === 'tango' ){
this._initTango()
}else console.assert(false)
}

Expand Down Expand Up @@ -120,20 +114,9 @@ ARjs.MarkerControls.prototype.updateWithModelViewMatrix = function(modelViewMatr
tmpMatrix.multiply(modelViewMatrix)

modelViewMatrix.copy(tmpMatrix)
}else if( this.context.parameters.trackingBackend === 'aruco' ){
// ...
}else if( this.context.parameters.trackingBackend === 'tango' ){
// ...
}else console.assert(false)


if( this.context.parameters.trackingBackend !== 'tango' ){

// change axis orientation on marker - artoolkit say Z is normal to the marker - ar.js say Y is normal to the marker
var markerAxisTransformMatrix = new THREE.Matrix4().makeRotationX(Math.PI/2)
modelViewMatrix.multiply(markerAxisTransformMatrix)
}

var renderReqd = false;

// change markerObject3D.matrix based on parameters.changeMatrixMode
Expand Down Expand Up @@ -282,18 +265,3 @@ ARjs.MarkerControls.prototype._initArtoolkit = function(){
_this.updateWithModelViewMatrix(modelViewMatrix)
}
}

//////////////////////////////////////////////////////////////////////////////
// aruco specific
//////////////////////////////////////////////////////////////////////////////
ARjs.MarkerControls.prototype._initAruco = function(){
this._arucoPosit = new POS.Posit(this.parameters.size, _this.context.arucoContext.canvas.width)
}

//////////////////////////////////////////////////////////////////////////////
// init for Artoolkit
//////////////////////////////////////////////////////////////////////////////
ARjs.MarkerControls.prototype._initTango = function(){
var _this = this
console.log('init tango ArMarkerControls')
}

0 comments on commit 577f15b

Please sign in to comment.