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?
2 Answers
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.
Comments
This along-path component is also good for interpolating an entity's position along a path: https://jsbin.com/dasefeh/edit?html,output