I'm trying to adapt my existing three.js project to work with WebVR. I've made decent progress -- I can look around the scene in VR, but I'm unable to move the camera position away from the initial place it gets spawned (which appears to be close to 0,0,0
, it seems like there is a predefined userHeight
that gets factored in)
Once I call renderer.vr.setDevice( vrDisplay )
it seems like a new camera is created and the existing camera that my scene was using is no longer used. I'd like to keep using that camera, or at least inherit most of its properties.
I've noticed that there is a renderer.vr.getCamera()
method (link to source) but I haven't found any examples or documentation of how to use it (or if I should use it). Curiously, this method accepts a camera
as an argument, which is a bit unintuitive for a getter
. Looking at the code, it seems like the function should be called setCamera
and left me a bit confused. I tried calling the function and passing in my existing camera
but it had no effect.
Any help is appreciated. I am using a Google Daydream View on the latest version of Android/Chrome using Three.js R91