Unable to Control Camera Position in VR on Oculus Go

229 Views Asked by At

I am using aframe to create an experience for Oculus Go. I have a simple "world" and I am able to move around it using the Oculus Go controller. However, I don't seem to be able to set the initial camera position or reset the camera location at any point. The initial problem means that my viewpoint is always close to the ground.

Here is my code:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Pailou Gate</title>
        <meta name="description" content="Pailou Gate">
        <script src="../aframe/dist/aframe-master.js"></script>
        <script src="//cdn.rawgit.com/donmccurdy/aframe-extras/v4.1.2/dist/aframe-extras.min.js"></script>
    </head>
    <body>
        <a-scene background="color: #9cf" antialias="true">
            <a-assets>
                <a-asset-item id="pl" src="pl.dae"></a-asset-item>
            </a-assets>

            <a-entity wasd-controls mouse-controls look-controls movement-controls="fly: false" position="0 0 0">
                <a-entity camera position="0 4 0"></a-entity>
                <a-entity oculus-go-controls></a-entity>
                <a-entity laser-controls="hand: right"></a-entity>
            </a-entity>

            <a-light position="0 0.5 1" intensity="0.8"></a-light>
            <a-light type="point" position="20 30 -40" intensity="0.9" light="castShadow: true;"></a-light>

            <a-collada-model src="#pl" position="0 0.4 0" rotation="0 0 0" scale="1 1 1" shadow="cast: true; receive: false"></a-collada-model>

            <a-circle rotation="-90 0 0" radius="40" color="#393" position="0 -0.1 0" shadow="receive: true" roughness="1"></a-circle>
            <a-torus radius="40" arc="360" color="#6c6" rotation="-90 0 0"></a-torus>
        </a-scene>
    </body>
</html>

I think the relevant bit is the entity surrounding the camera and the camera itself. Notice that I do set the camera high, but this seems to be ignored.

Any thoughts?

Sean

1

There are 1 best solutions below

0
On

Set the position and movement controls on the camera rig (parent entity of the camera) and look-controls on the camera:

<a-entity wasd-controls position="0 4 0">
  <a-entity camera look-controls></a-entity>
</a-entity>