1
votes

When an AFrame <scene> gets loaded and a camera component has been set with look-controls enabled, how does the current orientation of the device (mobile) set the values of rotation and position of the camera?

Since a scene will have a certain point of origin. I have found that when open the scene from different positions the initial view is different, while I would like it to be the "look ahead" view.

The code is simple:

<a-entity camera="userHeight:1.6" look-controls></a-entity>

1
Here is my observation. I load the url containing the scene is an <iframe>. Which ever direction I am facing, the origin is ahead of me (because the camera is set behind a few metres). That is as expected. Now, if I change my orientation (say turn left) and dynamically (via javascript) load a <a-scene>, it keeps the original position of the origin and shows the new scene as though the camera has moved to the left.RmR

1 Answers

1
votes

look-controls takes the orientation from the sensors of the phone that is absolute and not relative to where you position the camera initially in the scene. The initial values are overridden by those coming from the sensors. Phones in 2017 do not have positional tracking but have a head neck model and calculate the position of your eyes with respect of the base of your neck which is the rotation pivot.

I don't know the context of your application but in VR you cannot rely on the same degree of control of the camera that you would have on a traditional 3D application. If you require the user to look in a certain direction you can place hints or indications to influence the user's behavior.