-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
Render the rest of the A-Frame Scene outside the MindAR Target #537
Comments
I tried placing objects outside the MindAR target, but they are automatically hidden. Here's the behavior I would like to achieve:
I tried using onTargetFound: function () {
console.log('Target found');
},
onTargetLost: function () {
console.log('Target lost');
}, I noticed that in the A-Frame "Hello World" example (https://aframe.io/examples/showcase/helloworld/), the sensors are working quite well. |
@dariocavada This is exactly what I wanted to do. I basically just want to use the image tracking to initialize the camera location in a virtual scene. The user can then look around, assuming the camera stays in the same place. I kinda, almost got this working with this: const target = document.querySelector(".ar-target");
target.addEventListener("targetFound", event => {
setTimeout(() => {
var upsideDown = document.querySelector(".upside-down")
var targetPosition = new THREE.Vector3();
var targetOrientation = new THREE.Quaternion();
target.object3D.getWorldPosition(targetPosition);
target.object3D.getWorldQuaternion(targetOrientation);
upsideDown.object3D.setRotationFromQuaternion(targetOrientation);
upsideDown.object3D.position.x = targetPosition.x / 1000;
upsideDown.object3D.position.y = targetPosition.y / 1000;
upsideDown.object3D.position.z = targetPosition.z / 1000;
camera.components.camera.camera.near = 0.1;
camera.components.camera.camera.updateProjectionMatrix();
}, 100);
console.log("Pausing tracking... ");
camera.setAttribute("look-controls", "enabled", true);
mindarSystem.pause(true);
}); The tricky parts that took me a bit to figure out:
This still does not work properly. The virtual scene is not close to staying in sync with the physical scene when using the look-controls. I would be very grateful if anyone has suggestions to get this working. |
TLDR: Is there a way to render the rest of the scene outside of the MindAR target?
I know that is stated in the documentation that:
But I think that being able to explore the rest of the scene using the Magic Window while interacting with the marker's positions is something that enhances a lot of augmented reality experiences.
In AR.js, this is currently possible, but the positions of the objects anchored to the marker get an offset. There are things that can be worked around, but the thing stopping me from using AR.js is that I don't know how to pause the AR.js engine in order to use the camera for other things, as it is possible in MindAR.
The text was updated successfully, but these errors were encountered: