No movement on ios - aframe.io example runs, same(?) code not? What's the different?

老子叫甜甜 提交于 2019-12-02 06:50:21

问题


Under IOS, the solution no longer reacts to movements.

My solution has worked and now is no longer working.

Also the "hello world" example with the source code of Glitsch (see below) doesn't work anymore, but if you call the example from the a-frame start page (https://aframe.io/examples/showcase/helloworld/), it works.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Hello, WebVR!Test VR</title>
    <meta name="description" content="Test VR">        
    <script src="https://aframe.io/aframe/dist/aframe-master.min.js" ></script>
  </head>
  <body>
    <a-scene background="color: yellow">
      <a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
      <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow></a-sphere>
      <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow></a-cylinder>
      <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>
    </a-scene>
  </body>
</html>

What's the difference? What do I have to do to make my solution work under IOS again?


回答1:


Unfortunately, Chrome (m74+) and Safari (iOS 12.2+) now ship with sensor access disabled by default. The user has to enable manually on settings:

  • chrome://flags/#enable-generic-sensor in Chrome

  • Settings -> Safari -> Motion & Orientation Access in Safari iOS

Content also must be served over https.

More info on: https://github.com/aframevr/aframe/issues/3976



来源:https://stackoverflow.com/questions/56322681/no-movement-on-ios-aframe-io-example-runs-same-code-not-whats-the-differ

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!