Automatically move camera A-frame js

对着背影说爱祢 提交于 2020-07-07 10:19:25

问题


I am creating flat tour using a-frame js . I wanted to move camera automatically.currently I am doing that using mouse .can anyone help me?


回答1:


To do tweening in A-Frame, you'll probably use the a-animation system:

  <a-entity camera position="0 1.6 0">
    <a-animation attribute="position"
            dur="2000"
            easing="linear"
            to="0 1.6 -10"></a-animation>
  </a-entity>

JSFiddle. To customize this, see the animation documentation.

Aside: For VR scenes, moving the camera automatically is often uncomfortable for users, and should be done rarely and without acceleration, if at all.




回答2:


This along-path component is also good for interpolating an entity's position along a path: https://jsbin.com/dasefeh/edit?html,output



来源:https://stackoverflow.com/questions/39514722/automatically-move-camera-a-frame-js

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