首页 > 解决方案 > 无法在 Oculus Go 上控制 VR 中的相机位置

问题描述

我正在使用 aframe 为 Oculus Go 创建体验。我有一个简单的“世界”,我可以使用 Oculus Go 控制器在它周围移动。但是,我似乎无法在任何时候设置初始相机位置或重置相机位置。最初的问题意味着我的观点总是贴近地面。

这是我的代码:

<!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>

我认为相关位是相机周围的实体和相机本身。请注意,我确实将相机设置得很高,但这似乎被忽略了。

有什么想法吗?

肖恩

标签: aframeoculusgo

解决方案


设置相机装备(相机的父实体)上的位置和移动控制以及相机上的外观控制:

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

推荐阅读