问题
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