2
<!DOCTYPE html>
<html>
<head>
<title>Forest</title>
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<script src="https://rawgit.com/feiss/aframe-environment-component/master/dist/aframe-environment-component.min.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<a-asset-item id="brainstem" src="https://cdn.aframe.io/test-models/models/brainstem/BrainStem.gltf"></a-asset-item>
</a-assets>
<a-entity environment="preset: forest; groundColor: green; grid: cross"></a-entity>
<a-entity gltf-model="#brainstem" position="0 0 -5" scale="3 3 3"></a-entity>
<a-box position="-2 0.5 -17" rotation="0 0 0" color="#4CC3D9" width="10"></a-box>
<a-box position="-2 0.5 -10" rotation="0 0 0" color="#4CC3D9" width="10"></a-box>
<a-box position="-2 0.5 -3" rotation="0 0 0" color="#4CC3D9" width="10"></a-box>
<a-box position="10 0.5 -8" rotation="0 90 0" color="brown" width="1.5" height="0.5"></a-box>
<a-sky color="black"></a-sky>
</a-scene>
</body>
</html>
我正在使用a-frame構建上述模型......當我在智能手機上運行它時,移動設備,它會檢測到旋轉運動,但在我向前或向後移動時不會響應...我沒有完整的VR設置(我有VR耳機)...是否有任何解決方案來檢測移動使用只有耳機。如何在僅使用耳機而不是控制器的webvr中進行移動,使用「Aframe」製作
在控制器的幫助下,運動是否可能?我需要添加任何其他代碼以使控制器工作...? –
請參閱文檔和示例鏈接到aframe-extras。它支持遊戲手柄,但是你需要額外的組件來實現[跟蹤控制器的傳送](https://github.com/fernandojsg/aframe-teleport-controls) –