2017-10-12 6 views
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> 

위의 모델을 빌드 할 때 프레임을 사용하고 있습니다 ... 스마트 폰에서 실행할 때 장치를 움직이면 회전 운동을 감지하지만 앞으로 또는 뒤로 움직일 때 반응하지 않습니다 ... 완전한 VR 세트가 없습니다 (저는 VR 헤드셋이 있습니다) ... 움직임을 감지하는 솔루션이 있습니까 헤드셋 만."Aframe"을 사용하여 만든 컨트롤러가 아닌 헤드셋 만 사용하여 webvr에서 이동을 수행하는 방법

답변

3

현재 휴대 전화는 위치 이동 (6DoF), 회전 (3DoF) 만 감지 할 수 있습니다. 이 주변에는 좋은 방법이 없습니다, GPS 위치가 충분히 정확하지 않습니다. 모바일 VR 장면의 경우, 체크 포인트로 순간 이동하거나 판지 버튼을 앞으로 움직 이도록 이동하는 등의 다른 방법을 고려해야합니다. 두 가지 예가 모두 aframe-extras에 있습니다.

+0

컨트롤러를 사용하여 동작을 수행 할 수 있습니까? 컨트롤러를 작동 시키려면 다른 코드를 추가해야합니까? –

+0

aframe-extras 링크의 문서 및 예를 참조하십시오. 게임 패드를 지원하지만 [추적 컨트롤러로 순간 이동] (https://github.com/fernandojsg/aframe-teleport-controls)과 같은 추가 구성 요소가 필요합니다. –