I am looking to dynamically change the position of a view within a webvr scene. My approach involves using the position.add method.
Below is the code snippet that demonstrates how I programmatically move the camera:
<a-entity position="33 0 -33" rotation="0 180 0" look-controls id="camera"
camera="userHeight: 1.6" listener></a-entity>
The camera is moved using this code:
var obj3d = document.querySelector("#camera").object3D;
var angleobj = obj3d.getWorldDirection();
angleobj.y = 0;
obj3d.position.add(angleobj.multiplyScalar(0.004*3));
While this approach works in normal mode, it fails to move the camera in cardboard mode. How can I programmatically move the camera in cardboard view mode?