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

Tracking images having unexpected offset when I set referencerspcae to "local" #9

Open
TomDDH opened this issue Aug 23, 2021 · 0 comments

Comments

@TomDDH
Copy link

TomDDH commented Aug 23, 2021

On the image tracking when I set reference to 'local', but it is working great on 'viewer' space. I don't understand what is cause the offset.
there is my code.

let session = frame.session;

session.requestAnimationFrame(onXRFrame);
let pose = !trackingPostLocal ? frame.getViewerPose(localReferenceSpace):frame.getViewerPose(viewerReferenceSpace);

if (pose) {
gl.bindFramebuffer(gl.FRAMEBUFFER, session.renderState.baseLayer.framebuffer);


const view = pose.views[0];

if (setViewportSize === false){
const viewport = session.renderState.baseLayer.getViewport(view);
renderer.setSize(viewport.width, viewport.height)
setViewportSize = true;
}

camera.matrix.fromArray(view.transform.matrix)
camera.projectionMatrix.fromArray(view.projectionMatrix);
camera.updateMatrixWorld(true);
}
@TomDDH TomDDH changed the title Tracking Have offset when I set referencerspcae to "local" Tracking images having unexpected offset when I set referencerspcae to "local" Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant