Skip to content

Commit

Permalink
fix for issue #4
Browse files Browse the repository at this point in the history
- need to fix this also in the master branch
- must be verified
  • Loading branch information
kalwalt committed Oct 26, 2020
1 parent 34c4770 commit 06d14c7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions editor/js/components/arcontroller.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ ArControllerComponent.prototype.startAR = function() {
console.log("saw a trackable with id", trackableId);

let markerRoot = arTrackable.attachedGameObject;
console.log(markerRoot.childNodes[0].transform.position);
arTrackable.visible = true;
console.log("visible")
// Note that you need to copy the values of the transformation matrix,
Expand All @@ -102,8 +103,10 @@ ArControllerComponent.prototype.startAR = function() {
let outQuat = quat.create();
quat.fromMat4(outQuat,markerRootMatrix);
outQuat[0]*=-1;
markerRoot.transform.setPosition(vec3.fromValues(markerRootMatrix[12],markerRootMatrix[13]*-1,markerRootMatrix[14]*-1));
markerRoot.transform.setRotation(outQuat);
//markerRoot.transform.setPosition(vec3.fromValues(markerRootMatrix[12],markerRootMatrix[13]*-1,markerRootMatrix[14]*-1));
markerRoot.childNodes[0].transform.position = [markerRootMatrix[12],markerRootMatrix[13]*-1,markerRootMatrix[14]*-1];
//markerRoot.transform.setRotation(outQuat);
markerRoot.childNodes[0].transform.rotation = outQuat;
}
});
});
Expand Down

0 comments on commit 06d14c7

Please sign in to comment.