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

Override Camera Reposition on onDocumentTouchEnd #15

Open
bwolvin opened this issue Mar 16, 2016 · 1 comment
Open

Override Camera Reposition on onDocumentTouchEnd #15

bwolvin opened this issue Mar 16, 2016 · 1 comment

Comments

@bwolvin
Copy link

bwolvin commented Mar 16, 2016

I wanted to see if there was a way to override the camera getting set back to the original position when a user manually interacts with the DOM element. Right now, I am trying the following code but it seems like something in the threeVR is overriding this getting set correctly:

function getCameraPosition() {
    var vector = new THREE.Vector3(0, 0, -1);
    vector.applyEuler(camera.rotation, camera.eulerOrder);
    return vector;
}

controls.addEventListener('userinteractionend', function () {
    camera.lookAt(position);
});
@jtreat3
Copy link

jtreat3 commented Oct 19, 2018

The problem is the orientation events are setting the camera's position, not modifying/updating it relative to where it was.
I've been struggling with this problem myself.

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

2 participants