0

I recently upgrade my aframe from 0.5.0 directly to 0.8.1 due to Chrome v65 compatibility issue. One of the changes, as documented is that Aframe no longer controls camera pose, which will be controlled directly by three.js.

There is a recent PR here about the change: https://github.com/aframevr/aframe/pull/3327

This change removes the userHeight parameter support for camera position. In my application, I would need the camera to be at (0, 0, 0) in both VR and non-VR mode.

I tried to use:

<a-entity camera position="0 0 0"> </a-entity>

or

<a-camera position="0 0 0"> </a-camera>

but the result of both of them is that the camera is position at (0, 0, 0) before entering VR. After entering VR, the it is at (0, 1.6, 0) and after exiting VR, it remains at (0, 1.6, 0).

The question is: how do I set the camera postion to (0, 0, 0) in both VR and non-VR mode in aframe@0.8.1?

Also, this answer is no longer valid right?

Fei
  • 1,906
  • 20
  • 36

2 Answers2

4

I had a similar issue to this with camera rotation when I updated to 0.8.

From what I understand, the latest version has now moved the position and rotation management to threejs.

In order to resolve this, you should use a "rig" around the camera and set your position on the rig. The rig is simply a parent entity, that the children will get the relative settings from.

<a-entity id="cameraRig" position="0 1.6 0">
    <a-camera></a-camera>
</a-entity>
Beyerz
  • 787
  • 2
  • 9
  • 20
  • Thanks for the help! However, I don't think this would help me in my case. After some investigation, I see that after entering VR, the height of the camera is set to hard coded value 1.6 . I resolved the problem by changing it to 0. – Fei Mar 22 '18 at 03:07
  • that is one solution you could use. keep in mind that the camera primitive is default to 1.6, if you want to avoid this, you could also use a plaint entity with the camera component, which has a default height of 0 – Beyerz Apr 08 '18 at 13:59
1

Does wrapping your camera in an entity help?

https://aframe.io/docs/0.8.0/primitives/a-camera.html#manually-positioning-the-camera

<a-entity position="0 1.6 0">
    <a-camera look-controls position="0 0 0"></a-camera>
</a-entity>
Noam Almosnino
  • 866
  • 1
  • 6
  • 8
  • Thanks for the help! However, I don't think this would help me in my case. After some investigation, I see that after entering VR, the height of the camera is set to hard coded value 1.6 . I resolved the problem by changing it to 0. – Fei Mar 22 '18 at 03:08
  • I am having the same issue... how did you hardcode the camera y value? – sidd May 03 '18 at 09:19
  • @sidd I changed the source code of aframe. You could search 1.6 in your aframe-master.js :) Hope it helps after this long time. – Fei Jan 30 '19 at 09:10
  • @Fei Thanks for keeping me in the loop – sidd Jan 30 '19 at 11:19