Reputation: 3657
Developing in ThreeJS r87 using the standard example WebVR script. Got a 3D scene successfully rendering in VR through Chrome on my phone with a Google cardboard.
When I am using VR the camera/viewer's point of view is at the centre of the world (0, 0, 0). The floor plane runs horizontally across my line-of-sight and I am looking up at all the objects.
I have tried to change the point of view of the VR headset using:
camera.position.set(0, 15, 0);
But it just seems to ignore/override it.
Is the position just always fixed now? Do I need to put all my scene objects in a group and move it around to create the effect of my user moving/flying around the scene?
Looking through the ThreeJS library I can see that concepts such as user height exists in other headsets: https://github.com/mrdoob/three.js/blob/dev/examples/js/controls/VRControls.js#L58 But support for them seem to be flaky too.
I dug deeper beyond ThreeJS to VRDisplay and found things like VRDisplay.getPose() to get an instance of VRPose but that's in the process of being deprecated and I'm not sure why?
Explanation and solution would be much appreciated.
Upvotes: 3
Views: 1223
Reputation: 21
Have you tried putting the camera in a group?
var user = new THREE.Group();
user.position.set( 0, 15, 0 );
scene.add( user );
user.add( camera );
Upvotes: 2