Reputation: 434
<!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>
I am using a-frame to build the above mentioned model...When I run it on my smartphone and move the device around, it detects the rotational movement but does not respond when I move forward or backward... I do not have the complete VR set(i do have a VR headset)... Is there any solution to detect movement using only the headset.
Upvotes: 2
Views: 367
Reputation: 11960
Current mobile phones cannot detect positional movement (6DoF), only rotation (3DoF). There is no good way around this, GPS location is not nearly precise enough. For mobile VR scenes, you should consider other ways of moving, like teleporting to checkpoints or pushing the cardboard button to move forward. There are examples of both in aframe-extras.
Upvotes: 3